Score:0

OpenCL can't see drivers on ubuntu

mp flag

I'm trying to setup opencl for C++ development in ubuntu(22.04) but when I run clinfo I'm geting the following output:

root@turgut-N56VZ:/etc/OpenCL/vendors# clinfo
Number of platforms                               1
  Platform Name                                   Clover
  Platform Vendor                                 Mesa
  Platform Version                                OpenCL 1.1 Mesa 22.0.5
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd
  Platform Extensions function suffix             MESA

  Platform Name                                   Clover
Number of devices                                 0

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  Clover
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   No devices found in platform [Clover?]
  clCreateContext(NULL, ...) [default]            No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  No devices found in platform

ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.2.14
  ICD loader Profile                              OpenCL 3.0

I can't use it in programs because it says No devices found in platform. When I go to my vendors folder I can see mt .so files present there.

root@turgut-N56VZ:~# cd /etc/OpenCL/vendors/
root@turgut-N56VZ:/etc/OpenCL/vendors# ls
intel.icd  mesa.icd  nvidia.icd
root@turgut-N56VZ:/etc/OpenCL/vendors# ls -la
total 20
drwxr-xr-x 2 root   root   4096 Ara  2 09:31 .
drwxr-xr-x 3 root   root   4096 Kas 24 13:07 ..
-rw-r--r-- 1 turgut turgut   28 Şub 15  2019 intel.icd
-rw-r--r-- 1 root   root     19 Tem  6 09:37 mesa.icd
-rw-r--r-- 1 root   root     22 Kas  3  2021 nvidia.icd
root@turgut-N56VZ:/etc/OpenCL/vendors# cat intel.icd
/usr/local/lib/libigdrcl.so
root@turgut-N56VZ:/etc/OpenCL/vendors# cat nvidia.icd
libnvidia-opencl.so.1

And when I grep to see my drivers I get:

turgut@turgut-N56VZ:~$ lshw -c video | grep driver
WARNING: you should run this program as super-user.
       configuration: driver=nvidia latency=0
       configuration: depth=32 driver=i915 latency=0 resolution=1920,1080
WARNING: output may be incomplete or inaccurate, you should run this program as super-user.

I've tried running these commands to no avail:

turgut@turgut-N56VZ:~$ sudo usermod -a -G video $LOGNAME
turgut@turgut-N56VZ:~$ sudo usermod -a -G render $LOGNAME

And finally these are my device information:

turgut@turgut-N56VZ:~$ sudo lshw -c display
[sudo] password for turgut: 
  *-display                 
       description: VGA compatible controller
       product: GK107M [GeForce GT 650M]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
       configuration: driver=nvidia latency=0
       resources: irq:35 memory:f6000000-f6ffffff memory:e0000000-efffffff memory:f0000000-f1ffffff ioport:e000(size=128) memory:f7000000-f707ffff
  *-display
       description: VGA compatible controller
       product: 3rd Gen Core processor Graphics Controller
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       logical name: /dev/fb0
       version: 09
       width: 64 bits
       clock: 33MHz
       capabilities: msi pm vga_controller bus_master cap_list rom fb
       configuration: depth=32 driver=i915 latency=0 resolution=1920,1080
       resources: irq:28 memory:f7400000-f77fffff memory:d0000000-dfffffff ioport:f000(size=64) memory:c0000-dffff

So why can't my opencl detect and use them? What can I do to make it see them? I can import and compile opencl just fine but I get runtime errors saying No devices found in platform.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.