# multi-GPU running error

**URL:** <https://gpusph.discourse.group/t/multi-gpu-running-error/149>\
**Category:** Issues\
**Created:** [May 26, 2021, 8:46am UTC](https://gpusph.discourse.group/t/multi-gpu-running-error/149 "2021-05-26T08:46:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![joshua](https://avatars.discourse-cdn.com/v4/letter/j/48db29/32.png) [@joshua](https://gpusph.discourse.group/u/joshua)\
**Post date:** [May 26, 2021, 8:46am UTC](https://gpusph.discourse.group/t/multi-gpu-running-error/149/1 "2021-05-26T08:46:35Z")

</div>

I used the multi-GPU running command with 2,4,6 GPUs.  
2 GPUs can run but the results are unreasonable.  
4 and 5 GPUs cannot run succesfully.  
Single GPU performs well.  
Is there any requirement for compilation for multi-GPUs?  
For example, the GCC, MPI, CUDA versions?

Best regards,  
Joshua

---

<div class="post-metadata">

**Author:** ![giuseppe.bilotta](https://yyz2.discourse-cdn.com/free1/user_avatar/gpusph.discourse.group/giuseppe.bilotta/32/72_2.png) [@giuseppe.bilotta](https://gpusph.discourse.group/u/giuseppe.bilotta)\
**Post date:** [May 26, 2021, 7:22pm UTC](https://gpusph.discourse.group/t/multi-gpu-running-error/149/2 "2021-05-26T19:22:21Z")

</div>

Hello @joshua, thanks for your interest in GPUSPH.

Results in the multi-GPU case should be the same as single-GPU, so if you’re seeing significant difference you’ve either hit a bug or there’s something wrong with your setup. MPI is not necessary for multi-GPU on the same device, and as long as the CUDA version is supported, and the GCC version is supported by your CUDA version, it work fine.

There is however a known bug in [Thrust shipped with CUDA 11](https://github.com/NVIDIA/thrust/issues/1341) that causes issues with the particle sort. The issue is much more apparent in multi-GPU, but can also affect single-GPU runs. This should be fixed in CUDA 11.3, and a workaround for the issue has also been pushed to the `next` branch of GPUSPH. Can you try either and see if it fixes the issue for you?
