I am running a relatively large project on a multi GPU system containing one GTX 980Ti and one GTX 1070. The project only uses one of the GPUs when executed.
I compiled with the arch flags for both compute capabilities:
--generate-code arch=compute_52,code=sm_52
--generate-code arch=compute_61,code=sm_61
In the code each of the following API calls has its own error handling and just to be sure the error code really originated from the API call I also ran it once with a call to cudaGetLastError() preceding each actual API call.
In the code, the first cuda related commands executed are:
...
int device{ 0 };
int driver_version{ 0 };
int runtime_version{ 0 };
cudaDeviceProp device_property;
cudaSetDevice(device);
cudaGetDeviceProperties(&device_property, device );
cudaDriverGetVersion(&driver_version );
cudaRuntimeGetVersion( &runtime_version );
followed by outputting their return values, which works correctly and outputs the expected values.
Then the next call is to cudaHostRegister to page-lock a buffer provided by a different module of the project to allow for asynchronous data transfers.
cudaHostRegister(h_Ptr, bytes, cudaHostRegisterPortable);
this fails with error (30) “unknown error”.
Some investigation showed that this error only occurs when both GPUs are visible. As soon as I provide
CUDA_VISIBLE_DEVICES=0,-1,1
or
CUDA_VISIBLE_DEVICES=1,-1,0
to make either of the GPUs invisible the project runs without issues on either of the GPUs!
Does anyone have an idea what might cause this behavior?
System:
- CUDA 8.0.44
- Nvidia drivers tested: 367.44, 370.28
- Ubuntu 14.04.5 LTS
- kernel: 4.4.0-45-lowlatency
nvidia-smi returns the following:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 367.44 Driver Version: 367.44 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 980 Ti Off | 0000:05:00.0 On | N/A |
| 26% 62C P8 26W / 250W | 362MiB / 6077MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
| 1 GeForce GTX 1070 Off | 0000:06:00.0 Off | N/A |
| 27% 37C P8 10W / 100W | 1MiB / 8113MiB | 0% Default |
+-------------------------------+----------------------+----------------------+