Device id is now properly set when using MPI and there are multiple visible GPUs per node

This commit is contained in:
jpekkila
2019-11-26 16:54:56 +02:00
parent 53695d66a3
commit 5e3caf086e

View File

@@ -1242,7 +1242,9 @@ acDeviceRunMPITest(void)
////////////////////////////////////////////////////////////////////////////////////////////////
Device device;
acDeviceCreate(0, submesh_info, &device);
int devices_per_node = -1;
cudaGetDeviceCount(&devices_per_node);
acDeviceCreate(pid % devices_per_node, submesh_info, &device);
acDeviceLoadMesh(device, STREAM_DEFAULT, submesh);
// Benchmark