Guide | Install AMD OpenCL on: Pop!OS & some Ubuntu Derivates | Linux, amdgpu, amdgpu-pro, rocm, rocr

Hello,
I used your command and Blender now detect the Radeon VII but i have some errors :

Des erreurs ont été rencontrées pendant l’exécution :
amdgpu-dkms
amdgpu
amdgpu-pro-rocr-opencl
amdgpu-pro
amdgpu-pro-lib32
E: Sub-process /usr/bin/dpkg returned an error code (1)

In Blender I can render in WP but sometimes freeze.
F12 render freeze often on the first tile !

Blender 2.93.4 (from archive)
drivers : amdgpu-pro-21.30-1290604-ubuntu-20.04
Radeon VII
Pop os 21.04

Good day, just reporting that the following worked for me:

OS: Pop!OS 21.04
Kernel: 5.13.0-7614-generic
Driver: amdgpu-pro-21.30-1290604-ubuntu-20.04
GPU: Radeon RX570 4GB

  1. Append |pop to OS list on line 147 of the amdgpu-install script
  2. Run ./amdgpu-install --no-dkms --opencl=legacy
  3. sudo modprobe amdgpu

Note:

  • Check for any AMD-related blacklist configuration files in /etc/modprobe.d. I had a blacklist-amd.conf lingering from previous troubleshooting steps that had me scratch my head for a bit, wondering why amdgpu would load manually but not automatically… : )
1 Like

Here to report some more odd behavior :slight_smile:

My installation broke a couple days ago after upgrading my firmware. Checking my dpkg log, I realized this morning that my kernel was upgraded to 5.13.0-7614-generic (I usually try to skip this when updating many packages at once but I must have been careless).

Long story short, the whole system became unbootable with the drivers installed and I had to refresh my Pop installation. I currently have it working with:

Driver: 20.40
GPU: Radeon RX 5700 XT
Blender: 2.93.4
Kernel: 5.13.0-7614-generic

Not sure what ultimately got it back into a working state, but I would reiterate a point from the original post: ensure you have installed the opencl-headers ocl-icd-libopencl1 packages. It wasn’t until I did this that it started working again. Even then, it took a couple attempts so I’m not sure what made it finally work.

2 Likes

Thanks for this. Had to downgrade to amdgpu 20.40 to get this working on a Pop!_OS 21.04 installation I have running alongside my main Ubuntu 20.04 install. Also reiterate that opencl-headers ocl-icd-libopencl1 packages are necessary.

Somewhat bad news. AMD changed their Linux driver distribution method. For the version 21.40.1 AMD provides direct link to one small executable that is requesting the rest of the packages automatically over the network. Either this installer can be modified or Linux users of different distros than Ubuntu/RHEL will need to compile ROCm drivers from source.

The drivers are targeting enterprise so it is understandable that distro choice is limited, but with the upcoming ROCm in Blender this can end with a lot of troubles for Linux desktop users. Time will tell how this will play out.

On a side note. LLVM12 dropped in my repo. After upgrading I’m able to install AMDGPU drivers version 21.30 with the following command:

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

Notice “r” in rocr. The rocm with “m” doesn’t work. Also the script is trying to install dkms anyway. Luckily I don’t have kernel headers for the kernel I’m running and this step is skipped during driver install.
OpenCL rendering works.

1 Like

Using Pop_OS! 21.10 beta with 21.40.1 drivers

  1. nano /etc/os-release, set ID=ubuntu
  2. Install .deb from http://amd.com support for Ubuntu 20.04
  3. sudo amdgpu-install --usecase=graphics,multimedia,lrt --no-dkms
  4. sudo apt install opencl-headers
  5. revert 1) and reboot

Both latest Blender and Davinci Resolve detect and use the cards I have!

4 Likes

After some fiddling, I can get the driver installer for 21.40.1 completing its work on PopOS 21.10 with an RX580 only if I have the drivers for 21.20 installed manually first.

I am struggling to verify what is installed as the modinfo only reports a src version.

I strongly doubt I run the 21.40.1 version of amdgpu drivers.

Can somebody confirm their output for ‘modinfo amdgpu | grep -i version’ ?
For some reason, I only get the srcversion which does not help me.

https://lists.debian.org/debian-ai/2021/11/threads.html#00054
Check mails with AMD ROCm packaging.
If this endeavor succeeds it might ease installation process for average Debian user quite a lot.

1 Like

Thanks @silex for this pointer. Wouldn’t that mean it will only support recent AMD GPU architectures only though?

1 Like

That’s great news! Thanks for the mailing list, I’ll read it to the bottom.

@Blenderis new Rocm versions seem to support Polaris 11 cards as well.
(but maybe blender won´t work with it, right now.)

Maybe this is also an interesting test object for me later. :grinning:

1 Like

No prob. I got it from this thread: https://devtalk.blender.org/t/cycles-amd-hip-device-feedback/

Afaik people from this mailing list got ROCm compiled for everything newer than and including MI25 which is Vega (?).

Correction - compilation was successful for Radeon VII. The rest arch mentioned above are the preliminary targets.

1 Like

After a bit more investigation, I noticed a recent update to the amdgpu-install script on Dec 6, 2021 to version 21.40.2.40502.

Actual formal documentation can be found here:
https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation_new.html#ubuntu-20-04

The installation can now complete without error message however I have no opencl acceleration in Blender (not fully surprised given recent posts here).

With that new driver setup I have the following:

>clinfo                                                                                                                                           
Number of platforms                               1
  Platform Name                                   AMD Accelerated Parallel Processing
  Platform Vendor                                 Advanced Micro Devices, Inc.
  Platform Version                                OpenCL 2.2 AMD-APP (3361.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                                 0

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  AMD Accelerated Parallel Processing
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   No devices found in platform [AMD Accelerated Parallel Processing?]
  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 Loaderns
  ICD loader Vendor                               OCL Icd free softwarens
  ICD loader Version                              2.2.14ns
  ICD loader Profile                              OpenCL 3.0ns

and a tiny bit too level for me:

>sudo /opt/rocm-4.5.2/bin/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:                    Intel(R) Core(TM) i5-8600K CPU @ 3.60GHz
  Uuid:                    CPU-XX                             
  Marketing Name:          Intel(R) Core(TM) i5-8600K CPU @ 3.60GHz
  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)                             
  Cacheline Size:          64(0x40)                           
  Max Clock Freq. (MHz):   4300                               
  BDFID:                   0                                  
  Internal Node ID:        0                                  
  Compute Unit:            6                                  
  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:                    32811408(0x1f4a990) KB             
      Allocatable:             TRUE                               
      Alloc Granule:           4KB                                
      Alloc Alignment:         4KB                                
      Accessible by all:       TRUE                               
    Pool 2                   
      Segment:                 GLOBAL; FLAGS: KERNARG, FINE GRAINED
      Size:                    32811408(0x1f4a990) KB             
      Allocatable:             TRUE                               
      Alloc Granule:           4KB                                
      Alloc Alignment:         4KB                                
      Accessible by all:       TRUE                               
    Pool 3                   
      Segment:                 GLOBAL; FLAGS: COARSE GRAINED      
      Size:                    32811408(0x1f4a990) KB             
      Allocatable:             TRUE                               
      Alloc Granule:           4KB                                
      Alloc Alignment:         4KB                                
      Accessible by all:       TRUE                               
  ISA Info:                
*******                  
Agent 2                  
*******                  
  Name:                    gfx803                             
  Uuid:                    GPU-XX                             
  Marketing Name:          Radeon RX 580 Series               
  Vendor Name:             AMD                                
  Feature:                 KERNEL_DISPATCH                    
  Profile:                 BASE_PROFILE                       
  Float Round Mode:        NEAR                               
  Max Queue Number:        128(0x80)                          
  Queue Min Size:          4096(0x1000)                       
  Queue Max Size:          131072(0x20000)                    
  Queue Type:              MULTI                              
  Node:                    1                                  
  Device Type:             GPU                                
  Cache Info:              
    L1:                      16(0x10) KB                        
  Chip ID:                 26591(0x67df)                      
  Cacheline Size:          64(0x40)                           
  Max Clock Freq. (MHz):   1340                               
  BDFID:                   256                                
  Internal Node ID:        1                                  
  Compute Unit:            36                                 
  SIMDs per CU:            4                                  
  Shader Engines:          4                                  
  Shader Arrs. per Eng.:   1                                  
  WatchPts on Addr. Ranges:4                                  
  Features:                KERNEL_DISPATCH 
  Fast F16 Operation:      FALSE                              
  Wavefront Size:          64(0x40)                           
  Workgroup Max Size:      1024(0x400)                        
  Workgroup Max Size per Dimension:
    x                        1024(0x400)                        
    y                        1024(0x400)                        
    z                        1024(0x400)                        
  Max Waves Per CU:        40(0x28)                           
  Max Work-item Per CU:    2560(0xa00)                        
  Grid Max Size:           4294967295(0xffffffff)             
  Grid Max Size per Dimension:
    x                        4294967295(0xffffffff)             
    y                        4294967295(0xffffffff)             
    z                        4294967295(0xffffffff)             
  Max fbarriers/Workgrp:   32                                 
  Pool Info:               
    Pool 1                   
      Segment:                 GLOBAL; FLAGS: COARSE GRAINED      
      Size:                    8388608(0x800000) KB               
      Allocatable:             TRUE                               
      Alloc Granule:           4KB                                
      Alloc Alignment:         4KB                                
      Accessible by all:       FALSE                              
    Pool 2                   
      Segment:                 GROUP                              
      Size:                    64(0x40) KB                        
      Allocatable:             FALSE                              
      Alloc Granule:           0KB                                
      Alloc Alignment:         0KB                                
      Accessible by all:       FALSE                              
  ISA Info:                
    ISA 1                    
      Name:                    amdgcn-amd-amdhsa--gfx803          
      Machine Models:          HSA_MACHINE_MODEL_LARGE            
      Profiles:                HSA_PROFILE_BASE                   
      Default Rounding Mode:   NEAR                               
      Default Rounding Mode:   NEAR                               
      Fast f16:                TRUE                               
      Workgroup Max Size:      1024(0x400)                        
      Workgroup Max Size per Dimension:
        x                        1024(0x400)                        
        y                        1024(0x400)                        
        z                        1024(0x400)                        
      Grid Max Size:           4294967295(0xffffffff)             
      Grid Max Size per Dimension:
        x                        4294967295(0xffffffff)             
        y                        4294967295(0xffffffff)             
        z                        4294967295(0xffffffff)             
      FBarrier Max Size:       32                                 
*** Done *** 

I will continue my investigation to see if I can get my setup going or if it is a dead end

Are you sure that you are on a Blender version earlier than 3.0 to try OpenCL acceleration?

You shouldn’t need root to run rocminfo, if your user is in render and video groups.
That’s a first requirement before trying anything in the stack remotely evolved like running Blender on HIP.

I have a hard time wrapping my head around

  • OpenCL in deb-based-distributions package management (there is a mesa ICD loader, but loads of virtual packages),
  • ROCm OpenCL
  • ROCm HIP - OpenCL connection.

Sure enough idiot me did not bother trying blender 3.0…

I lost a few brain cells going through the maze of the evolution of AMD installer this morning

After trying again, I confirm there is no support showing in Blender 3.0.

I also had an issue with suspend/sleep option which I use a lot so that is a showstopper.

As there seems to be very active development and my card is unlikely to have full support, I will stick to v2.93.6 and drivers v21.20 until the installer improves and formal support for the RX580 is confirmed as it seems unlikely but hopefully I will be proven wrong.

Maybe @Denzil-Ferreira was showing that openCL still worked with Blender3.0, although the Blender foundation announced that it dropped support… I have not followed closely enough wouldn’t want to mislead you…

Thanks for the clarification @Maxzor - I also read about the drop of OpenCL in 3.0 and double checking, it is not clear the version used by @Denzil-Ferreira .

For now, I will stick to what works for my setup and wait for maturity to come.

Hey! I forgot to check what version of Blender this was, but it was the one installed from Pop App Store directly! I can’t confirm this atm as I’m on Fedora 35 now :man_facepalming:

@Denzil-Ferreira still hard to say as the PopOS app store has 2 options, the deb version which is on 2.93.3 and the flatpak which is on 3.x

Hi yes, you are correct, it’s the 2.93.3 version (.deb). Just for fun, I installed the flatpack 3.x and there is no OpenCL on the preferences, only CUDA is there.

2 Likes

Hi,Can somebody help me. I tried install several drivers but none of them work properly.
I am working on ubuntu 20.04.3LTS and radeon 6600 xt. I need direct instructions which drivers should i download and what part should i install bc i am an idiot
thanks in advance