OpenCL with RX 580 and Fedora 39

According to my notes, I had opencl working in Fedora 38 with this repo (GitHub - CosmicFusion/fedora-amdgpu-pro: A repository that provides the proprietary driver for fedora without having to deal with hassle of getting RHEL repo to work , and it has 32 bit libraries), but now
./package-builder.sh amdocl-legacy 64
404’s downloading from AMD and doesn’t produce an RPM. I upgraded from 38 to 39, and I’ve uninstalled the old amdocl-legacy and libdrm-pro (since they were broken) and installed rocm-opencl and rocm-runtime from fedora, but doesn’t recognize my old card.

I’ve also tried the AMD installer, manually pointed to the RHEL 9.3 repo for rpms. But the 6.3 DKMS modules don’t build with a 6.6 or 6.7 kernel, AFAICT.

Is there an easy way to get OpenCL working for Darktable on Fedora 39 with my old card? Or a hard way?

1 Like

Your not the first person today with this issue

The ROCm packages are in Fedora btw :

dnf search rocm
Last metadata expiration check: 0:18:56 ago on Tue 13 Feb 2024 10:44:28 AM EST.

======== Name & Summary Matched: rocm ========

rocm-clinfo.x86_64 : ROCm OpenCL platform and device tool
rocm-comgr.x86_64 : AMD ROCm LLVM Code Object Manager
rocm-comgr-devel.x86_64 : AMD ROCm LLVM Code Object Manager
rocm-device-libs.x86_64 : AMD ROCm LLVM bit code libraries
rocm-hip.x86_64 : ROCm HIP platform and device tool
rocm-hip-devel.x86_64 : ROCm HIP development package
rocm-opencl.x86_64 : ROCm OpenCL platform and device tool
rocm-opencl-devel.x86_64 : ROCm OpenCL development package
rocm-runtime.x86_64 : ROCm Runtime Library
rocm-runtime-devel.x86_64 : ROCm Runtime development files
rocm-smi.x86_64 : ROCm System Management Interface Library
rocm-smi.noarch : AMD ROCm System Management Interface
rocm-smi-devel.x86_64 : ROCm SMI Library development files
rocminfo.x86_64 : ROCm system info utility

All you need is the OpenCL package? What software requires it?

1 Like

@manithree According to the Repo maintainer :

AMDGPU-PRO CosmicFusion repo has been deprecated

since Fedora 36. . .

Referencing a way to install the driver now :

https://repo.radeon.com/rocm/rhel9/5.6/

1 Like

I think the next steps for us to help in troubleshooting these issues would be to post a guide with links and How To’s

ROCm drivers on Fedora > 38

dnf install rocm-*

dnf search rocm

======= Name & Summary Matched: rocm ======

rocm-clinfo.x86_64 : ROCm OpenCL platform and device tool
rocm-comgr.x86_64 : AMD ROCm LLVM Code Object Manager
rocm-comgr-devel.x86_64 : AMD ROCm LLVM Code Object Manager
rocm-device-libs.x86_64 : AMD ROCm LLVM bit code libraries
rocm-hip.x86_64 : ROCm HIP platform and device tool
rocm-hip-devel.x86_64 : ROCm HIP development package
rocm-opencl.x86_64 : ROCm OpenCL platform and device tool
rocm-opencl-devel.x86_64 : ROCm OpenCL development package
rocm-runtime.x86_64 : ROCm Runtime Library
rocm-runtime-devel.x86_64 : ROCm Runtime development files
rocm-smi.x86_64 : ROCm System Management Interface Library
rocm-smi.noarch : AMD ROCm System Management Interface
rocm-smi-devel.x86_64 : ROCm SMI Library development files
rocminfo.x86_64 : ROCm system info utility

1 Like

I can’t install any of those rpms because:
`Problem 1: conflicting requests

  • nothing provides rock-dkms needed by rocm-dkms-5.6.0.50600-67.el9.x86_64 from amdgpu`

and there’s no rock-dkms in that repo.

Yes, I know. I mentioned those in my OP. I did try installing rocm-* and re-booting, but they didn’t work in Fedora 38, and they still don’t recognize my card in Fedora 39, with or without ROC_ENABLE_PRE_VEGA.

As I said in my OP, Darktable.

If a HowTo exists, I would love a link to it. All I can find is other people having no success like me.

If you installed the ROCm drivers from Fedora repo, what does rocminfo return ? Here is my result :

rocminfo

ROCk module is loaded
=====================    
HSA System Attributes    
=====================    
Runtime Version:         1.1
System Timestamp Freq.:  1000.000000MHz
Sig. Max Wait Duration:  18446744073709551615 (0xFFFFFFFFFFFFFFFF) (timestamp count)
Machine Model:           LARGE                              
System Endianness:       LITTLE                             

==========               
HSA Agents               
==========               
*******                  
Agent 1                  
*******                  
  Name:                    AMD Ryzen 5 5600H with Radeon Graphics
  Uuid:                    CPU-XX                             
  Marketing Name:          AMD Ryzen 5 5600H with Radeon Graphics
  Vendor Name:             CPU

I’m running on the APU, I get the ROCk module is loaded but Darktable does not pick up the OpenCL, (although I’m in a flatpak and need to test the .rpm )

Running clinfo returns :


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                                     gfx90c:xnack-
  Device Vendor                                   Advanced Micro Devices, Inc.
  Device Vendor ID                                0x1002
  Device Version                                  OpenCL 2.0 
  Driver Version                                  3558.0 (HSA1.1,LC)
  Device OpenCL C Version                         OpenCL C 2.0 
  Device Type                                     GPU
  Device Board Name (AMD)                         AMD Radeon Graphics
  Device PCI-e ID (AMD)                           0x1638
  Device Topology (AMD)                           PCI-E, 0000:05:00.0
  Device Profile                                  FULL_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Linker Available                                Yes

@manithree Hey there, Currently working on gathering the info. This might take me a couple hours or so, since there are so many post and discord conversations for me to comb through. Also I’m looking into getting a concise way of aggregating this info with the impending release of GIMP3.0 soon.

Apparently this one ( which was more trusted ) might not work anymore either? I was told recently . . If you are feeling adventurous you can try it. I will continue to Post here my findings, and hopefully get you up and going.


When I run flatpak run org.darktable.Darktable -d all I do get :

0.0784 [pwstorage_new] Creating new context 0x55fd00416d30
     0.0784 [pwstorage_new] using libsecret backend for username/password storage.
     0.0887 [add_job] 0 |      0.0887 detect opencl devices | queue: 4 | priority: 0
     0.0888 [run_job+] 03 417242164.473215      0.0888 detect opencl devices | queue: 4 | priority: 0
     0.0888 [wb_presets] loading wb_presets from `/app/share/darktable/wb_presets.json'
     0.0889 [dt_dlopencl_init] could not find default opencl runtime library 'libOpenCL'
     0.0889 [dt_dlopencl_init] could not find default opencl runtime library 'libOpenCL.so'
     0.0891 [opencl_init] opencl library 'libOpenCL.so.1' found on your system and loaded, preference 'default path'

but again, that could be a flatpak issue. . .

$ rocminfo
ROCk module is loaded
=====================    
HSA System Attributes    
=====================    
Runtime Version:         1.1
System Timestamp Freq.:  1000.000000MHz
Sig. Max Wait Duration:  18446744073709551615 (0xFFFFFFFFFFFFFFFF) (timestamp count)
Machine Model:           LARGE                              
System Endianness:       LITTLE                             
Mwaitx:                  DISABLED
DMAbuf Support:          YES

==========               
HSA Agents               
==========               
*******                  
Agent 1                  
*******                  
  Name:                    Intel(R) Xeon(R) CPU           W3520  @ 2.67GHz
  Uuid:                    CPU-XX                             
  Marketing Name:          Intel(R) Xeon(R) CPU           W3520  @ 2.67GHz
  Vendor Name:             CPU                                
  Feature:                 None specified                     
  Profile:                 FULL_PROFILE                       
  Float Round Mode:        NEAR                               
  Max Queue Number:        0(0x0)                             
  Queue Min Size:          0(0x0)                             
  Queue Max Size:          0(0x0)                             
  Queue Type:              MULTI                              
  Node:                    0                                  
  Device Type:             CPU                                
  Cache Info:              
    L1:                      32768(0x8000) KB                   
  Chip ID:                 0(0x0)                             
  ASIC Revision:           0(0x0)                             
  Cacheline Size:          64(0x40)                           
  Max Clock Freq. (MHz):   2661                               
  BDFID:                   0                                  
  Internal Node ID:        0                                  
  Compute Unit:            8                                  
  SIMDs per CU:            0                                  
  Shader Engines:          0                                  
  Shader Arrs. per Eng.:   0                                  
  WatchPts on Addr. Ranges:1                                  
  Features:                None
  Pool Info:               
    Pool 1                   
      Segment:                 GLOBAL; FLAGS: FINE GRAINED        
      Size:                    24585448(0x17724e8) KB             
      Allocatable:             TRUE                               
      Alloc Granule:           4KB                                
      Alloc Alignment:         4KB                                
      Accessible by all:       TRUE                               
    Pool 2                   
      Segment:                 GLOBAL; FLAGS: KERNARG, FINE GRAINED
      Size:                    24585448(0x17724e8) KB             
      Allocatable:             TRUE                               
      Alloc Granule:           4KB                                
      Alloc Alignment:         4KB                                
      Accessible by all:       TRUE                               
    Pool 3                   
      Segment:                 GLOBAL; FLAGS: COARSE GRAINED      
      Size:                    24585448(0x17724e8) KB             
      Allocatable:             TRUE                               
      Alloc Granule:           4KB                                
      Alloc Alignment:         4KB                                
      Accessible by all:       TRUE                               
  ISA Info:                
*** Done **
$ rocm-clinfo 
Number of platforms:				1
  Platform Profile:				FULL_PROFILE
  Platform Version:				OpenCL 2.1 AMD-APP (3590.0)
  Platform Name:				AMD Accelerated Parallel Processing
  Platform Vendor:				Advanced Micro Devices, Inc.
  Platform Extensions:				cl_khr_icd cl_amd_event_callback 


  Platform Name:				AMD Accelerated Parallel Processing
Number of devices:				0

Several months ago, the flatpak was said not to work with OpenCL. I’ve been running the rpm since then.

Yeah, I just tried the .rpm and it works with OpenCL on my APU. We have a similar config so I find it strange that it’s not picking it up.

That one builds an rpm that installs, but it doesn’t build the -legacy rpm, and I suspect that’s why it still doesn’t detect my card.

I don’t remember how long ago I initially got this working. Probably Fedora 36 or earlier. But, IIRC, open source rocm doesn’t support my old card, and the AMD proprietary opencl required the -legacy version, not the latest.

I think you are right, ROCm 5.x is for gfx_9XX The RX580 is gfx_8xx so ROCm 3.0 is the last version that can work.

Generation: Polaris
Codename: Ellesmere
Graphics/Compute: GFX8 (gfx803)
Display Core Engine: 11.2
Unified Video Decoder: 6.3
Video Compression Engine: 3.4
System DMA: 3.0.0
CLRX: GCN 1.2.0

How about you try again but replace the spec file and make some modifications if needed. :thinking:

Use CosmicFusions .spec file to build the -legacy since Glorious .spec does not have it.
Or add that line to the file and see if it builds?

Provides: config(opencl-legacy-amdgpu-pro-icd) = %{major}-%{minor}.%{ubuntu}

That’s a lot easier said than done. If you can find the opencl-legacy-amdgpu-pro-icd .deb file somewhere, I’ll try it. But it appears to have disappeared completely from repo.radeon.com

@manithree I’m gonna be off till the morning, but I think we can get this done since you said you built the Glorious Eggroll one and just need --legacy .

There’s been a lot of buzz on the new Mesa implementation called rusticl apparently it will solve all our problems and achieve world peace.

https://repo.radeon.com/amdgpu-install/

I don’t know what I’m going to do when GIMP3.0 comes out with these issues. . . GEGL and plugins needs OpenCL.

I tried rusticl. It didn’t help.

Rusticl isn’t really enabled by default yet. For Radeon, you must set the RUSTICL_ENABLE=radeonsi and RUSTICL_FEATURES=fp16,fp64 environment variables. After that you can enable Rusticl in Darktable (there’s a “RustiCL” checkbox right below “AMD ROCm”).

Note that I didn’t attempt to do anything with it, but the setting is there. OpenCL with Rusticl works under Wine at least.

BlockquoteRUSTICL_ENABLE=radeonsi RUSTICL_FEATURES=fp16,fp64 darktable -d opencl

[opencl_init] OpenCL successfully initialized. internal numbers and names of available devices: [opencl_init] 0 'rusticl AMD Radeon RX 580 Series' 1.1117 [opencl_init] FINALLY: opencl is AVAILABLE and ENABLED.

That does appear to be progress, but with the fedora darktable package, any attempt to open an image in the darkroom causes a core dump. But thanks. Maybe there’s still hope for OpenCL on my old rig.

I’d recommend the flatpak at this point.

Even before AMD dropped OpenCL support for older cards and I had it working with Darktable rpm, I never got the Flatpak to work with OpenCL. But, just to make sure, I replicated that failure today.

graphics_darktable rpm build also dumps core.

Just checked unfortunately. . .

Since the hurdle is that OpenCL is not in the Flatpak runtime, and there is a ton of (Feet Shuffling, Hand Waving) opinions on a 100MB runtime of the OpenCL versions and if it should be packaged like OpenGL/Nvidia OpenGL, Until that “Hurdle” is leaped/jumped ANY flatpak in need of it won’t work without any workarounds. . .

That is an actual frustration.

Isnt that possible by allowing the needed flatpak xdg-host-os access and doing something like

OPENCL_LIBRARY=/path/to/amd/opencl/library.so

As a Flatpak environment variable (flatseal, kde settings)?