Created attachment 10676 [details] hardware info Unable to build any OpenCL program with libclc. libclc needs update. Missing '/usr/lib64/clc/gfx909-amdgcn-mesa-mesa3d.bc' Looks like libclc way too old for AMD Ryzen 3 5300U. Way to reproduce: apt-get install libMesaOpenCL clinfo libclc ocl-icd ocl-icd-devel git clone https://github.com/rsnemmen/OpenCL-examples.git cd OpenCL-examples/add_numbers; make ./add_numbers fatal error: cannot open file '/usr/lib64/clc/gfx909-amdgcn-mesa-mesa3d.bc': No such file or directory $ ls /usr/lib64/clc/gfx*.bc /usr/lib64/clc/gfx900-amdgcn--.bc /usr/lib64/clc/gfx900-amdgcn-mesa-mesa3d.bc /usr/lib64/clc/gfx902-amdgcn--.bc /usr/lib64/clc/gfx902-amdgcn-mesa-mesa3d.bc /usr/lib64/clc/gfx904-amdgcn--.bc /usr/lib64/clc/gfx904-amdgcn-mesa-mesa3d.bc /usr/lib64/clc/gfx906-amdgcn--.bc /usr/lib64/clc/gfx906-amdgcn-mesa-mesa3d.bc
Created attachment 10677 [details] glxinfo
Created attachment 10678 [details] clinfo
у нас древняя версия clc clc нужно собирать из llvm
(In reply to Valery Inozemtsev from comment #3) > у нас древняя версия clc > clc нужно собирать из llvm Ок, я попробую, но вслепую: насколько оно будет прилично работать — сказать не смогу, виднее будет тем, кто напрямую работает с OpenCL.
See #322784 for details. Updated libclc works fine for me, I was able to built mesa/rusticl with it and clinfo works too: NULL platform behavior clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...) rusticl clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...) Success [MESA] clCreateContext(NULL, ...) [default] Success [MESA] clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT) Success (1) Platform Name rusticl Device Name AMD Radeon HD 7700 Series (verde, LLVM 16.0.5, DRM 3.49, 6.1.0-lks-wks-alt6.32) clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU) No devices found in platform clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU) Success (1) Platform Name rusticl Device Name AMD Radeon HD 7700 Series (verde, LLVM 16.0.5, DRM 3.49, 6.1.0-lks-wks-alt6.32) 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) Success (1) Platform Name rusticl Device Name AMD Radeon HD 7700 Series (verde, LLVM 16.0.5, DRM 3.49, 6.1.0-lks-wks-alt6.32) Also tested with darktable/luxmark.
Given GPU output just an example, it should work on recent GPU too (and Intel as well).
libclc-13.0.1-alt1.x86_64.rpm contains: /usr/lib64/clc/gfx900-amdgcn--.bc /usr/lib64/clc/gfx900-amdgcn-mesa-mesa3d.bc /usr/lib64/clc/gfx902-amdgcn--.bc /usr/lib64/clc/gfx902-amdgcn-mesa-mesa3d.bc /usr/lib64/clc/gfx904-amdgcn--.bc /usr/lib64/clc/gfx904-amdgcn-mesa-mesa3d.bc /usr/lib64/clc/gfx906-amdgcn--.bc /usr/lib64/clc/gfx906-amdgcn-mesa-mesa3d.bc No gfx909-amdgcn-mesa-mesa3d.bc So it will not work on my hardware. >>Updated libclc works fine for me, I was able to built mesa/rusticl with it and clinfo works too: Your hardware just too old. >>Given GPU output just an example, it should work on recent GPU too (and Intel as well). It does not work on my AMD Ryzen 3 5300U. libclc need update.
(In reply to Iakunin Andrei from comment #7) > libclc-13.0.1-alt1.x86_64.rpm > contains: > /usr/lib64/clc/gfx900-amdgcn--.bc > /usr/lib64/clc/gfx900-amdgcn-mesa-mesa3d.bc > /usr/lib64/clc/gfx902-amdgcn--.bc > /usr/lib64/clc/gfx902-amdgcn-mesa-mesa3d.bc > /usr/lib64/clc/gfx904-amdgcn--.bc > /usr/lib64/clc/gfx904-amdgcn-mesa-mesa3d.bc > /usr/lib64/clc/gfx906-amdgcn--.bc > /usr/lib64/clc/gfx906-amdgcn-mesa-mesa3d.bc > > No gfx909-amdgcn-mesa-mesa3d.bc > So it will not work on my hardware. > > >>Updated libclc works fine for me, I was able to built mesa/rusticl with it and clinfo works too: > Your hardware just too old. For modern hardware you can use rocm-opencl-runtime instead: ❯ clinfo Number of platforms 1 Platform Name AMD Accelerated Parallel Processing Platform Vendor Advanced Micro Devices, Inc. Platform Version OpenCL 2.1 AMD-APP (3558.0) Platform Profile FULL_PROFILE Platform Extensions cl_khr_icd cl_amd_event_callback Platform Extensions function suffix AMD Platform Host timer resolution 1ns Platform Name AMD Accelerated Parallel Processing Number of devices 1 Device Name gfx1031 BTW gfx909 is supported too. > > >>Given GPU output just an example, it should work on recent GPU too (and Intel as well). > It does not work on my AMD Ryzen 3 5300U. libclc need update. Use rocm-opencl-runtime and forget about libclc.
❯ sudo apt-get install ocl-icd-devel [sudo] password for lakostis: Reading Package Lists... Done Building Dependency Tree... Done The following extra packages will be installed: opencl-headers The following NEW packages will be installed: ocl-icd-devel opencl-headers 0 upgraded, 2 newly installed, 0 removed and 47 not upgraded. Need to get 0B/88.4kB of archives. After unpacking 868kB of additional disk space will be used. Do you want to continue? [Y/n] Committing changes... Preparing... #################################################################################################### [100%] Updating / installing... 1: opencl-headers-2.2-alt1 #################################################################################################### [ 50%] 2: ocl-icd-devel-2.2.14-alt1 #################################################################################################### [100%] egrep: warning: egrep is obsolescent; using grep -E egrep: warning: egrep is obsolescent; using grep -E Done. ❯ make gcc -std=c99 -Wall -DUNIX -g -DDEBUG -m64 -o add_numbers add_numbers.c -lOpenCL add_numbers.c: In function ‘main’: add_numbers.c:197:4: warning: ‘clCreateCommandQueue’ is deprecated [-Wdeprecated-declarations] 197 | queue = clCreateCommandQueue(context, device, 0, &err); | ^~~~~ In file included from add_numbers.c:14: /usr/include/CL/cl.h:1443:1: note: declared here 1443 | clCreateCommandQueue(cl_context /* context */, | ^~~~~~~~~~~~~~~~~~~~ OpenCL-examples/add_numbers on master [?] via v12.2.1-gcc took 3s ❯ ./ add_numbers add_numbers.c add_numbers.cl Makefile OpenCL-examples/add_numbers on master [?] via v12.2.1-gcc took 4s ❯ clinfo Number of platforms 1 Platform Name AMD Accelerated Parallel Processing Platform Vendor Advanced Micro Devices, Inc. Platform Version OpenCL 2.1 AMD-APP (3558.0) Platform Profile FULL_PROFILE Platform Extensions cl_khr_icd cl_amd_event_callback Platform Extensions function suffix AMD Platform Host timer resolution 1ns ... OpenCL-examples/add_numbers on master [?] via v12.2.1-gcc took 3s ❯ ./add_numbers Computed sum = 2016.0. Check passed.
> Use rocm-opencl-runtime and forget about libclc. Ok. But what about p10? rocm-opencl-runtime appears only in sisyphus. And it is quite new, from 28 may 2023.
(In reply to Iakunin Andrei from comment #10) > > Use rocm-opencl-runtime and forget about libclc. > Ok. But what about p10? rocm-opencl-runtime appears only in sisyphus. And it > is quite new, from 28 may 2023. I'm on sisyphus so dunno about p10. In theory, one could build llvm15.0 for p10, then rocm-5.4.x can be backported too.