I have a problem when trying to run OpenCL code on my nVidia GPU after upgrading the NVIDIA proprietary driver to v. 520.56.06. I have a hybrid system:
inxi -G
Graphics:
Device-1: Intel HD Graphics 530 driver: i915 v: kernel
Device-2: NVIDIA GM107M [GeForce GTX 960M] driver: nvidia v: 520.56.06
Device-3: Sunplus Innovation Integrated_Webcam_HD type: USB
driver: uvcvideo
Display: x11 server: X.Org v: 21.1.4 with: Xwayland v: 22.1.3 driver: X:
loaded: intel,nvidia unloaded: modesetting dri: i965 gpu: i915
resolution: 1920x1080~60Hz
OpenGL: renderer: Mesa Intel HD Graphics 530 (SKL GT2) v: 4.6 Mesa 22.2.1
(no Optimus installed, I use prime-run to run apps on the GeForce GPU). I have opencl-nvidia installed, it seems to be detected ok:
$ clinfo --list
Platform #0: Clover
Platform #1: NVIDIA CUDA
`-- Device #0: NVIDIA GeForce GTX 960M
But I cannot access it when I try to run opencl-examples, e.g.:
$ git clone https://github.com/rsnemmen/OpenCL-examples.git
$ cd OpenCL-examples
$ cd add_numbers
$ make
$ ./add_numbers
Couldn't access any devices: File exists
$ prime-run ./add_numbers
Couldn't access any devices: File exists
I suspect I’m supposed to set some environment variables, but I don’t know which.
I’m testing this because the mandelbulber2 app with opencl support,
https://aur.archlinux.org/packages/mandelbulber2-opencl-git
is broken ever since the nvidia driver upgrade. I am trying to figure out if this is a broken driver issue, or simply a matter of setting up the environment properly.
Otherwise, the driver/GPU seems to be functioning properly, e.g. I can run CuPy kernels on the GPU.