Failed to load library libOpenCL.so.1
Today I came back to my OpenCL project (can be found here). I have had not tried it on my fresh Ubuntu 22 installation on my Dell g15 with RTX 3050 Ti. Altough I’ve got NVIDIA driver metapackage installed my program reported that there is some problem with shared library:
You can check if the driver is selected in system About window. So there it is in my case, but nvidia-selector
command reports that I have nvidia-driver-525 which is weird as drivers tab says I have installed driver 470. On the other hand, running nvidia-smi
command says I have enable driver 470. Weird.
I came across some solution which says that I should install libopencl-clang-dev
:
sudo apt install libopencl-clang-dev
I restarted IntelliJ IDEA 2022.3 Community Edition and even proceeded with system reboot to no avail, still the same issue. Next thing to check is libOpenCL library symlink looking for missing either symlink itself or target files:
ls -la /usr/lib/x86_64-linux-gnu/ | grep libOpenCL
I have both.
Finally I found a post stating that I should have ocl-icd-opencl-dev:
sudo apt-get purge ocl-icd-opencl-dev
sudo apt-get autoremove # this could be risky however
sudo apt-get install ocl-icd-opencl-dev
And voilà I got it working. However I have only GPU recognized, no CPU on the list of available devices. That is weird but most probably I should install some Intel SDK or at least their libraries to have it working also for CPU. NVIDIA package do not provide runtime for CPU. Now I remember that for book project I have been running it on Windows instead of Linux…