tags:

views:

288

answers:

1

Hi, I have a question to exclusive compute mode with NVidia+OpenCL.

I can set up exclusive compute mode (page 74 from cuda programming guide 3.0) with nvidia-smi on a nvidia-gpu . that means, only one program can compute on gpu.

cuda runtime schedules than app automatically.

but I have a problem with opencl-programs in this case: if one application runs on a gpu with setted exclusive compute mode and second opencl-program calls clGetDeviceInfo(..., CL_DEVICE_AVAILABLE, ...) with the same GPU is the result == CL_TRUE. After that if opencl-app tries to create a context on this device, than crashes the running app (both).

How can i find out an available GPU with OpenCL?

Thanks.

+1  A: 

clGetDeviceIds returns the number of devices and their device Ids. Then you can check if each of the device is available or not. Iam not sure if it would resolve the crash though.