Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exclusive compute mode with OpenCL+NVidia

Tags:

c

cuda

opencl

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.

like image 410
lokli Avatar asked Apr 23 '10 09:04

lokli


1 Answers

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.

like image 138
excray Avatar answered Oct 02 '22 13:10

excray