AMD Radeon OpenCL

Just installed Zorin OS 16 Pro, need some guidance in getting openCL going for an AMD 550X. Tried the tutorial here: https://help.zorin.com/docs/hardware/activate-amd-radeon-drivers/#proprietary-amdgpu-pro-drivers with no success, just a list of unmet dependencies:

it:1 http://us.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease                                                                                          
Hit:3 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease                                                                                        
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease                                                                                           
Hit:5 http://ppa.launchpad.net/zorinos/apps/ubuntu focal InRelease                                                                                         
Get:6 https://repo.radeon.com/amdgpu/21.50.2/ubuntu bionic InRelease [5,462 B]                                                                             
Hit:7 http://archive.canonical.com/ubuntu focal InRelease                                                                                                  
Get:8 https://repo.radeon.com/rocm/apt/5.0.2 ubuntu InRelease [1,816 B]                                                      
Hit:9 http://ppa.launchpad.net/zorinos/drivers/ubuntu focal InRelease                                                                     
Hit:10 https://packages.zorinos.com/stable focal InRelease
Hit:11 https://packages.zorinos.com/patches focal InRelease
Get:12 https://repo.radeon.com/amdgpu/21.50.2/ubuntu bionic/proprietary amd64 Packages [3,538 B]
Hit:13 http://ppa.launchpad.net/zorinos/patches/ubuntu focal InRelease                      
Hit:14 https://packages.zorinos.com/apps focal InRelease                                       
Get:15 https://repo.radeon.com/amdgpu/21.50.2/ubuntu bionic/proprietary i386 Packages [2,877 B]
Get:16 https://repo.radeon.com/amdgpu/21.50.2/ubuntu bionic/main amd64 Packages [13.7 kB]                              
Get:17 https://repo.radeon.com/amdgpu/21.50.2/ubuntu bionic/main i386 Packages [12.8 kB]                               
Hit:18 https://packages.zorinos.com/drivers focal InRelease                                    
Get:19 https://repo.radeon.com/rocm/apt/5.0.2 ubuntu/main amd64 Packages [27.0 kB]
Hit:20 http://ppa.launchpad.net/zorinos/stable/ubuntu focal InRelease 
Hit:21 https://packages.zorinos.com/premium focal InRelease
Fetched 67.2 kB in 2s (31.3 kB/s)
Reading package lists... Done
Hit:1 http://us.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://security.ubuntu.com/ubuntu focal-security InRelease                                                                                           
Hit:3 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease                                                                                          
Hit:4 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease                                                                                        
Hit:5 http://archive.canonical.com/ubuntu focal InRelease                                                                                                  
Hit:6 http://ppa.launchpad.net/zorinos/apps/ubuntu focal InRelease                                                                               
Hit:7 https://repo.radeon.com/amdgpu/21.50.2/ubuntu bionic InRelease                                                         
Hit:8 https://repo.radeon.com/rocm/apt/5.0.2 ubuntu InRelease                                                                
Hit:9 http://ppa.launchpad.net/zorinos/drivers/ubuntu focal InRelease                                                        
Hit:10 https://packages.zorinos.com/stable focal InRelease                                             
Hit:11 https://packages.zorinos.com/patches focal InRelease              
Hit:12 http://ppa.launchpad.net/zorinos/patches/ubuntu focal InRelease
Hit:13 https://packages.zorinos.com/apps focal InRelease                 
Hit:14 https://packages.zorinos.com/drivers focal InRelease              
Hit:15 http://ppa.launchpad.net/zorinos/stable/ubuntu focal InRelease
Hit:16 https://packages.zorinos.com/premium focal InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
linux-headers-5.13.0-39-generic is already the newest version (5.13.0-39.44~20.04.1).
linux-headers-5.13.0-39-generic set to manually installed.
linux-modules-extra-5.13.0-39-generic is already the newest version (5.13.0-39.44~20.04.1).
linux-modules-extra-5.13.0-39-generic set to manually installed.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 amdgpu-pro : Depends: amdgpu but it is not going to be installed
              Depends: libgl1-amdgpu-pro-glx but it is not going to be installed
              Depends: libgl1-amdgpu-pro-ext but it is not going to be installed
 amdgpu-pro-lib32 : Depends: amdgpu but it is not going to be installed
                    Depends: amdgpu-lib32 but it is not going to be installed
                    Depends: libgl1-amdgpu-pro-glx:i386
E: Unable to correct problems, you have held broken packages.

Really need to get this going for darktable use. Any help would be appreciated. Thanks

Rather than trying to install the proprietary driver, can you first try

sudo nano /etc/default/grub

Add these parameters:
radeon.cik_support=0 radeon.si_support=0 amdgpu.cik_support=1 amdgpu.si_support=1 amdgpu.dpm=1 amdgpu.dc=1
after "quiet splash" so that it looks exactly like:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash radeon.cik_support=0 radeon.si_support=0 amdgpu.cik_support=1 amdgpu.si_support=1 amdgpu.dpm=1 amdgpu.dc=1"

Once done, tap ctrl+x to exit, then the y key to say yes, then the enter key.
Now run this command, which will update the grub and also reboot your computer:

sudo update-grub && sudo reboot

Test the AMD performance.

Thanks for offering help. Unfortunately, still no OpenCL being activated.

Did successfully edit and update grub and reboot, here's the edited GRUB file lines as a sanity check:

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash radeon.cik_support=0 radeon.si_support=0 amdgpu.cik_support=1 amdgpu.si_support=1 amdgpu.dpm=1 amdgpu.dc=1"
GRUB_CMDLINE_LINUX=""

This is the first time trying to activate OpenCL on a Ubuntu based distro for me. Just came off 3 years of Manjaro, which if I recall needed Mesa, AMD-GPU and perhaps ROCM to get things running. It did finally work.
Any further help would be appreciated. I'm assuming that the problem with my first attempt at installing the proprietary drivers was due to unmet dependencies. Is part of the solution to track down packages that contain them and install? Sorry, but I'm a bit baffled at this point. I have Zorin Core on my laptop, which has Nvidia, and all is well there.

AMD promotes itself as Open Source friendly and even donates to Linux. In spite of this, the reality is that AMD is quite protective of its proprietary drivers.
You should revert your grub file back to "quiet splash" if the above is not working.

Initially add the 32bit architecture:

sudo dpkg --add-architecture i386

Then run

sudo apt --fix-broken install

I have no way of knowing, currently, if you have amdgpu-pro files partially installed or not.If sudo apt --fix-broken install gives more errors, then please try the steps outlined here to resolve:

You MUST be sure to grab the driver that is for Focal Fossa (Ubuntu 20.04); using a driver for a higher version can cause a libc6 dependency error that you cannot resolve.
So, please double check the driver you downloaded.

Thanks. Was not able to boot to a GUI after some more attempts. Will do a reinstall of Zorin OS 16 pro and start over. Will try the grub route first, before attempting any proprietary driver install.

Thanks for your help. Still no luck. After a fresh install, tried the GRUB route, no success, went back to the original grub file, added the 32 bit support, downloaded the 20.04 version AMD driver installer, did the ubunto to zorin edit, ran it. It ran without error, but it did throw up some warnings about modules possibly missing. On reboot clinfo shows platforms 0.

Wondering if the best bet is to pick up an NVidia card now that prices are dropping and go down that route?
If the NVidia card approach seems sensible, any recommendations for a card that would give me a bit of a bump over my existing Radeon 550x would be appreciated. I'm not a gamer, just doing a lot of darktable, GIMP and Hugin work. The existing card was suitable for my uses speedwise with openCL. I'd rather keep the investment modest, since I'll have this computer for only another year or so.

Perhaps you can grab the modules
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/amdgpu
and elevate to root, then move the modules into

/lib/firmware/amdgpu

Thanks, added a few more modules to the /lib/firmware/amdgpu directory, but still come up with the following ones missing after an uninstall/reinstall of the amd drivers. Can't seem to find them anywhere:

Possible missing firmware /lib/firmware/amdgpu/yellow_carp_gpu_info.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/vangogh_gpu_info.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/ip_discovery.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/cyan_skillfish_rlc.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/cyan_skillfish_mec2.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/cyan_skillfish_mec.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/cyan_skillfish_me.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/cyan_skillfish_pfp.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/cyan_skillfish_ce.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/cyan_skillfish_sdma1.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/cyan_skillfish_sdma.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi10_mes.bin for module amdgpu

I think I've hit a wall with this, and am not sure what to do going forward.

If it's any help, here's the info on the graphics card:
Graphics:
Device-1: AMD Lexa PRO [Radeon 540/540X/550/550X / RX 540X/550/550X]
driver: amdgpu v: 5.13.11.21.50
Display: x11 server: X.Org 1.20.13 driver: amdgpu
resolution: 2560x1600~60Hz
OpenGL: renderer: Radeon RX550/550 Series
v: 4.6.14800 Core Profile Context 21.50

You can double check here of any remaining missing:

Generally, the "possible missing firmware" message is a Placeholder and can be ignored.
In your case, it is worth trying out... Since... AMD... and that you are having Graphics Glitches.

Found one, uninstalled and reinstalled, same result.
I found a video dealing with ROCm installation on Ubuntu 20.04, may follow along with that tomorrow. Will report back with success or failure. Thanks

Have you tried running

./amdgpu-install --opencl=legacy --headless --no-dkms

Within the downloaded amd driver directory?

I'm going to hold off on any further attempts at openCL on the current Zorin OS and the Radeon card. It's been quite time consuming. I did try the ROCm install, it also failed. Seems to be a lack of support for the kernel/card combo. I'm going to look for an Nvidia card to try, and revisit the install at that time. I haven't found any guidance for the non-LTS Ubuntu base that seems to work. Seems like this problem is common to Ubuntu, Debian, Mint, Zorin, as well as Fedora. Just for a sanity check, I did ran a Manjaro Gnome live USB a few minutes ago, and installing the opencl-amd package from the AUR via the Pamac graphical installer resulted in an active openCL in a couple minutes. While I didn't want to go back to Manjaro, looks like it may be a path forward for now. It's a shame, I really like Zorin OS 16 core on my laptop, and have no plans to change it any time soon. Thanks for the advice along the way, as alway, Linux is a learning experience!

1 Like

Hi- Back at it today, new GPU not happening without a power supply udate, not now.

Fresh attempt at a fresh install of Zorin.
I'm ran the install you suggested, got this back:

/usr/bin$ ./amdgpu-install --opencl=legacy --headless --no-dkms
ERROR: using '--no-dkms' with '--opencl=legacy' is not supported

So wondering what to try next? Which do you think needs dropping?
I've got a timeshift BU to the initial install restore point, so hopefully if things blow up , I can get back to a good starting point. Thanks

Ah... right... the command works with the AMDGPU driver, not the AMDGPUPRO driver...
I was sniffing around and found this guide:

Of which the conclusion left me chuckling a bit.

Oh yes, I've read that one, and it left me scratching my head. It's from 2019, things don't seem better in Ubuntu land now. Similar problems with Fedora.
I'm guessing since the point of this exercise is to only install the opencl driver portion, and leave the kernel driver alone, my first try should be with the opencl legacy switch. Here goes nothing...

Well, at least it was quick: Removed the --no-dkms switch and got this:

E: Command line option --headless is not understood in combination with the other options

1 Like

Are you performing that command on the Proprietary AMDGPU driver? Or on the Pro driver?
Or are you performing it in terminal, not within the AMDGPU driver directory?

It is frustrating.
AMD... openly and on the surface... shows support for Linux. Beneath the surface, it is less so.
AMD is fiercely protective on the proprietary drivers. As much as Nvidia has been in the past.
At one time... Nvidia was Linux-Bane. The times have changed slightly, to where Nvidia is easier to deal with than AMD.
Intel currently remains the only truly cooperative manufacturer.

An analogy may be the Microsoft Secure Boot.
MS signed on Linux packages for the BIOS Secure Boot, showing support and cooperation.
How sweet.
Except... they did not sign all the packages. Only... most of them. So, some packages will still not work on Secure Boot. And MS knows it.
AMD is similar. They provide enough of the drivers for Generic Working. Most peoples machines will work just fine. But not everyones.

Or are you performing it in terminal, not within the AMDGPU driver directory?
In terminal, cd into the AMDGPU driver directory.clinfo

Just ran:

amdgpu-install --opencl=rocr

It installed, but clinfo returned:

Number of platforms                               1
  Platform Name                                   AMD Accelerated Parallel Processing
  Platform Vendor                                 Advanced Micro Devices, Inc.
  Platform Version                                OpenCL 2.2 AMD-APP (3406.0)
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd cl_amd_event_callback 
  Platform Host timer resolution                  1ns
  Platform Extensions function suffix             AMD

  Platform Name                                   AMD Accelerated Parallel Processing
Number of devices                                 0

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  No platform
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   No platform
  clCreateContext(NULL, ...) [default]            No platform
  clCreateContext(NULL, ...) [other]              No 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

amdgpu-install --vulkan=amdvlk,pro
clinfo
Number of platforms                               1
  Platform Name                                   AMD Accelerated Parallel Processing
  Platform Vendor                                 Advanced Micro Devices, Inc.
  Platform Version                                OpenCL 2.2 AMD-APP (3406.0)
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd cl_amd_event_callback 
  Platform Host timer resolution                  1ns
  Platform Extensions function suffix             AMD

  Platform Name                                   AMD Accelerated Parallel Processing
Number of devices                                 0

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  No platform
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   No platform
  clCreateContext(NULL, ...) [default]            No platform
  clCreateContext(NULL, ...) [other]              No 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

Still nothing on reboot, although it DID reboot.

I'd hardly consider this a case of good support from AMD. But I do find that it is strange that it was so easy on Manjaro. One package, and boom! It just worked. And of course, the install of Zorin 16 core on my Nvidia thinkpad worked just fine. So I guess I need to find a low power Nvidia card for my pc to get this to happen. In the meantime, I'll continue on Zorin without openCL.

Can you try the 20.50 AMD driver with the 5.16 kernel?

This was 21.50, where can I get the 20.50? I'm only seeing 21.40 on the previous versions of the AMD site.

I haven't updated a kernel on ZOrin. Do I need a tool like mainline? or is there a utility in Zorin. Also, is the kernel selectable in GRUB at boot. Thanks

Took a look with Synaptic, nothing newer that 5.13. Do I need to add another repository?