Bug 1212515

Summary: [OpenCL] clinfo fails to see devices
Product: [openSUSE] openSUSE Distribution Reporter: Egbert Eich <eich>
Component: X.OrgAssignee: Gfx Bugs <gfx-bugs>
Status: RESOLVED FIXED QA Contact: Gfx Bugs <gfx-bugs>
Severity: Normal    
Priority: P3 - Medium CC: patrik.jakobsson
Version: Leap 15.4   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE Leap 15.3   
Whiteboard:
Found By: Development Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Egbert Eich 2023-06-19 13:30:28 UTC
clinfo - using ocl-icd, libMesaOpenCL, Gallium LLVM-pipe fails to detect any devices, although at least one (NOUVEAU) should be available in the system.

The issue seems to be in libMesaOpenCL - it see to occur in the constructor of the clover:platform object:
src/gallium/frontends/clover/core/platform.cpp
In the code
      try {
         if (ldev)
            devs.push_back(create<device>(*this, ldev));
      } catch (error &) {
         pipe_loader_release(&ldev, 1);
      }
devs.push_back(...) seems to fail so that the exception handler is called.
clover::platform.devs remains empty.
Comment 1 Stefan Dirsch 2023-06-19 13:49:18 UTC
Hmm. Are you sure NOUVEAU already supports OpenCL? I'm not ... even with Intel you need an external driver. Patrik is trying hard to package it. I'm afraid any of Mesa's OpenCL drivers is far from being usable ... :-(
Comment 2 Stefan Dirsch 2023-06-19 13:53:32 UTC
(In reply to Stefan Dirsch from comment #1)
> Hmm. Are you sure NOUVEAU already supports OpenCL? I'm not ... even with
> Intel you need an external driver. Patrik is trying hard to package it. 

JFYI [1]

>I'm afraid any of Mesa's OpenCL drivers is far from being usable ... :-(

[1] https://build.opensuse.org/package/show/X11:XOrg/intel-opencl
Comment 3 Egbert Eich 2023-06-19 14:06:45 UTC
(In reply to Stefan Dirsch from comment #1)
> Hmm. Are you sure NOUVEAU already supports OpenCL? I'm not ... even with
> Intel you need an external driver. Patrik is trying hard to package it. I'm
> afraid any of Mesa's OpenCL drivers is far from being usable ... :-(

I don't think it matters at the point to which I've traced the problem down to whether nouveau supports OpenCL. I would have traced this onward but I got stuck at the level of sophistication in C++.
Comment 4 Egbert Eich 2023-06-19 14:12:26 UTC
Regarding the intel openCL implementation - it is not even clear how to use this. ocl-icd doesn't use the path /usr/share/OpenCL/vendors. Copying intel.icd to /etc/OpenCL/vendors did cause a crash, however.
But this is an altogether different topic.
Comment 5 Stefan Dirsch 2023-06-19 14:22:35 UTC
(In reply to Egbert Eich from comment #4)
> Regarding the intel openCL implementation - it is not even clear how to use
> this. ocl-icd doesn't use the path /usr/share/OpenCL/vendors. 

Indeed. We still don't use this path before Tumbleweed. On TW, we try first try /etc/OpenCL/vendors. If this fails, we use  /usr/share/OpenCL/vendors. But you can also overwrite this path with an environment variable called OCL_ICD_VENDORS and then link drivers you're interested in from there.

> Copying intel.icd to /etc/OpenCL/vendors did cause a crash, however.

This is a known issue, Patrik fixed meanwhile. See https://bugzilla.suse.com/show_bug.cgi?id=1212193

> But this is an altogether different topic.

Yeah, I know.
Comment 6 Stefan Dirsch 2023-06-19 14:56:30 UTC
We're currently discussing a related topic in boo#1212394. I agree that we have an improvable situation with OpenCL. :-(
Comment 7 Patrik Jakobsson 2023-06-20 07:34:19 UTC
Egbert, I think clover is mostly deprecated these days. RustiCL is what seems to be getting the attention. Perhaps you can try that? However, RustiCL doesn't work for me on AMDGPU but you might have better luck with Nouveau.
Comment 8 Egbert Eich 2023-06-20 09:42:05 UTC
(In reply to Patrik Jakobsson from comment #7)
> Egbert, I think clover is mostly deprecated these days. RustiCL is what
> seems to be getting the attention. Perhaps you can try that? However,
> RustiCL doesn't work for me on AMDGPU but you might have better luck with
> Nouveau.

clover is what I get by default on 15.4. - Mesa there is somewhat older: 21.2.4.
I'd update to 15.5 as Mesa there is slightly newer, however, I need to be able to shut down my machine entirely for this. Not sure if this will give me Rusti by default - I can research how to manually switch to it, maybe you can beat me to it with some hints?
Comment 9 Stefan Dirsch 2023-06-20 10:37:54 UTC
AFAIK rusticl came with Mesa 22.3, so it's not yet on Leap 15.4 with Mesa 21.2.4. The only thing I can tell you is that one. Good that it has been added it to the changelog.

-------------------------------------------------------------------
Mon Jan 16 22:44:11 UTC 2023 - Martin Hauke <mardnh@gmx.de>

- Add support for Rusticl - Mesa's new OpenCL implementation.
  * See https://docs.mesa3d.org/rusticl
  You will need to set your environment to use it
  * See https://docs.mesa3d.org/envvars#rusticl-environment-variables
Comment 10 Stefan Dirsch 2024-03-29 01:02:25 UTC
Things should look much better with Leap 15.5 now. Also we fixed remaining issues in libOpenCL1 about the icd path on sle15-sp5/Leap 15.5, which are already officiallly available as package updates thru our maintenance channels. Closing for now. Please feel free to reopen, if there are still issues with libOpenCL and intel-opencl on Leap 15.5.