install command opencl blender 3d kubuntu 20.04

Asked by Alexander Yankovskiy

I'm working on free project "3d animation how engine works" in Blender 3D, it will be free for use 3D animation.

I choosed Kubuntu 20.04, because results in Viewport animation (I think it is OpenGL) 5-7% faster then Win10 with the same video card, and Kubuntu GPU drivers + 5-7% faster then AMD Ubuntu official drivers.

My problem/question:

I don't have OpenCL in Blender3D and I don' know how to install it ( but I want : ) ) because I'm new in Kubuntu. I tried to install OpenCL from official AMD Ubuntu driver package optional, script from official AMD source was " ./ambgpu-install --no-dkms --opencl=pal --headless " yes, in this case I have a choice in OpenCL in Blender it shows my Ryzen 2600x and RX 580 but it works extremely sloooooow, it such slow that my laptop with Nvidia 1650 with CUDA Win10 working like a rocket in comparing with OpenCL RX 580 in Kubuntu. So I think that AMD OpenCL drivers works not very good.

And now I want to try "mesa 20.2.6-0ubuntu0.20.04.1 source package in Ubuntu" --- " mesa-opencl-icd " to make Blender3D works good in OpenCL Cycles in Kubuntu with Ryzen 5 + RX580.

The qustion:

How to install OpenCL from mesa package in Kubuntu 20.04 ? Please help. I know a magic word "Linux is a power, power is a LinuX".

Thanks in advance.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu mesa Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
Best Manfred Hampl (m-hampl) said :
#1

Execute the command in a terminal window:

sudo apt install mesa-opencl-icd

Revision history for this message
Alexander Yankovskiy (euclid666) said :
#2

No results, unfortunately. I've executed the command in terminal -- 1. something extracting 2. something installed - no errors and no OpenCL in Blender.

I use Blender 2.91.2.

I have OpenGL version - 4.6 (Compability Profile) Mesa 20.2.6 and it's works great and I think that Blender use it in viewport because it works faster in LinuX than in Win10, but I have not OpenCL in Blender (it should be in blender-edit-preferences-system- opencl choice).

Maybe I should "to explain" Blender that "you should to take openCL right there, take it" or something else.

I've found some folder in Blender ---> blender-291.2-linux64>2.92>scripts>addons>cycles>source>kernel>kernels>opencl there are files .cl and .h but I don't understand what this mean, maybe I should change something in this files ?

Revision history for this message
Alexander Yankovskiy (euclid666) said :
#3

I've executed command in terminal ---clinfo--- and it shows:

Number of platforms 1
  Platform Name Clover
  Platform Vendor Mesa
  Platform Version OpenCL 1.1 Mesa 20.2.6
  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.38.0, 5.8.0-44-generic, LLVM 11.0.0)
  Device Vendor AMD
  Device Vendor ID 0x1002
  Device Version OpenCL 1.1 Mesa 20.2.6
  Driver Version 20.2.6
  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 1340MHz
  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 0 / 0 (n/a)
    float 4 / 4
    double 2 / 2 (cl_khr_fp64)
  Half-precision Floating-point support (n/a)
  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 4294967296 (4GiB)
  Error Correction support No
  Max memory allocation 3435973836 (3.2GiB)
  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 2147483392 (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

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.38.0, 5.8.0-44-generic, LLVM 11.0.0)
  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.38.0, 5.8.0-44-generic, LLVM 11.0.0)
  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.38.0, 5.8.0-44-generic, LLVM 11.0.0)

ICD loader properties
  ICD loader Name OpenCL ICD Loader
  ICD loader Vendor OCL Icd free software
  ICD loader Version 2.2.11
  ICD loader Profile OpenCL 2.1

Revision history for this message
Alexander Yankovskiy (euclid666) said :
#4

Thanks Manfred Hampl, that solved my question.

Revision history for this message
Alexander Yankovskiy (euclid666) said :
#5

Now I understand how to use terminal /* sudo apt install "any mesa package name "*/ , thanks to Manfred Hampl.

And about OpenCL:

I think it will be hopeless in future to use OpenCL in animation because Eevee (OpenGL) becomes more powerful each time in new Blender 3D version. So I think I'll try to make all my 3D animation in OpenGL (Eevee).

Thanks to Mesa for AMD video cards support, as mesa drivers for AMD GPU are good, especially OpenGL works nice. I hope Mesa will support AMD drivers in future.

"LinuX is a power, power is a LinuX" (GNU LinuX)