Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Enable OpenCL GPU rendering for AMD GPU

Need help with peripherals or devices?
Post Reply
Message
Author
wiiliam
Posts: 10
Joined: 2016-01-29 01:04

Enable OpenCL GPU rendering for AMD GPU

#1 Post by wiiliam »

I'm having trouble finding out how to enable GPU cycles rendering. I've asked this on multiple subreddits, but have gotten zero luck.

I'm using an RX 580 on Debian sid this is what I've done so far:
  • contrib non-free enabled in my sources.list
  • CYCLES_OPENCL_SPLIT_KERNEL_TEST=1 inside /etc/environment
  • ocl-icd-opencl-dev installed
  • installed ROCm
  • followed the steps here (blender stack exchange), but I still don't see the GPU option being available for me.
The last option that I did not only failed to install the AMDPRO driver, it also gave me black screen. I had to switch to a TTY and uninstall to get back to my desktop.

How do I enable GPU Cycles rendering?

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Enable OpenCL GPU rendering for AMD GPU

#2 Post by Head_on_a_Stick »

I think you need the mesa-opencl-icd package as well. I am presuming you have already installed the firmware-amd-graphics package and confirmed that the amdgpu kernel driver is in use.

Also check if the environmental variable is actually being applied:

Code: Select all

[ $CYCLES_OPENCL_SPLIT_KERNEL_TEST = 1 ] && echo yup || echo nope
And confirm OpenCL support with:

Code: Select all

clinfo
https://packages.debian.org/buster/clinfo

Then open Blender and navigate to File → User Preferences... → System and you should see an OpenCL option for the "Cycles Compute Device" option:

Image

I can do this with my lowly Vega 8 graphics chip in buster so it should work for your RX580 in sid. Unfortunately Blender crashes for me if I try to actually use it but it can at least be selected as an option.

I also have

Code: Select all

VDPAU_DRIVER=radeonsi
set in /etc/environment.d/99vdpau.conf but I don't know if that is relevant here.
deadbang

wiiliam
Posts: 10
Joined: 2016-01-29 01:04

Re: Enable OpenCL GPU rendering for AMD GPU

#3 Post by wiiliam »

I've checked that the environmental variable is actually applied, mesa-opencl-icd was already installed.

clinfo shows this:

Code: Select all

Number of platforms                               1
  Platform Name                                   Clover
  Platform Vendor                                 Mesa
  Platform Version                                OpenCL 1.1 Mesa 19.3.3
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd
  Platform Extensions function suffix             MESA

  Platform Name                                   Clover
Number of devices                                 1
  Device Name                                     Radeon RX 580 Series (POLARIS10, DRM 3.35.0, 5.4.0-4-amd64, LLVM 9.0.1)
  Device Vendor                                   AMD
  Device Vendor ID                                0x1002
  Device Version                                  OpenCL 1.1 Mesa 19.3.3
  Driver Version                                  19.3.3
  Device OpenCL C Version                         OpenCL C 1.1 
  Device Type                                     GPU
  Device Profile                                  FULL_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Max compute units                               36
  Max clock frequency                             1411MHz
  Max work item dimensions                        3
  Max work item sizes                             256x256x256
  Max work group size                             256
  Preferred work group size multiple              64
  Preferred / native vector sizes                 
    char                                                16 / 16      
    short                                                8 / 8       
    int                                                  4 / 4       
    long                                                 2 / 2       
    half                                                 8 / 8        (cl_khr_fp16)
    float                                                4 / 4       
    double                                               2 / 2        (cl_khr_fp64)
  Half-precision Floating-point support           (cl_khr_fp16)
    Denormals                                     No
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
  Single-precision Floating-point support         (core)
    Denormals                                     No
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  No
  Double-precision Floating-point support         (cl_khr_fp64)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
  Address bits                                    64, Little-Endian
  Global memory size                              8589934592 (8GiB)
  Error Correction support                        No
  Max memory allocation                           6871947673 (6.4GiB)
  Unified memory for Host and Device              No
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       32768 bits (4096 bytes)
  Global Memory cache type                        None
  Image support                                   No
  Local memory type                               Local
  Local memory size                               32768 (32KiB)
  Max number of constant args                     16
  Max constant buffer size                        2147483647 (2GiB)
  Max size of kernel argument                     1024
  Queue properties                                
    Out-of-order execution                        No
    Profiling                                     Yes
  Profiling timer resolution                      0ns
  Execution capabilities                          
    Run OpenCL kernels                            Yes
    Run native kernels                            No
  Device Extensions                               cl_khr_byte_addressable_store cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_fp64 cl_khr_fp16

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  Clover
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   Success [MESA]
  clCreateContext(NULL, ...) [default]            Success [MESA]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  Success (1)
    Platform Name                                 Clover
    Device Name                                   Radeon RX 580 Series (POLARIS10, DRM 3.35.0, 5.4.0-4-amd64, LLVM 9.0.1)
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  Success (1)
    Platform Name                                 Clover
    Device Name                                   Radeon RX 580 Series (POLARIS10, DRM 3.35.0, 5.4.0-4-amd64, LLVM 9.0.1)
  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                                 Clover
    Device Name                                   Radeon RX 580 Series (POLARIS10, DRM 3.35.0, 5.4.0-4-amd64, LLVM 9.0.1)

ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.2.12
  ICD loader Profile                              OpenCL 2.2
I haven't checked for radeonsi, but I check for it according to the arch wiki

Code: Select all

grep -iE 'vdpau | dri driver' /var/log/Xorg.0.log

[     8.438] (II) AMDGPU(0): [DRI2]   DRI driver: radeonsi
[     8.438] (II) AMDGPU(0): [DRI2]   VDPAU driver: radeonsi
I'll report back when I also add it to my environment conf. As of now, I still don't see the option for OpenCL GPU rendering enabled for me.
---
I just added VDPAU_DRIVER=radeonsi to /etc/environment.d/99vdpau.conf. It still didn't work. The command above to grep for vdpau didn't change either. Turns out that the VDPAU_DRIVER variable didn't apply when it was placed in the conf file. Putting it in /etc/environment did the job, but still doesn't work with blender.

Image
Btw, is there a way to shrink image dimensions here? I tried adding width/height and that didn't work.

Post Reply