I thought I succeeded in installing OpenCL on AMD on Ubuntu 22.04. At least, clinfo -l writes:
Platform #0: AMD Accelerated Parallel Processing
However, it doesn’t work in darktable. When started with -d opencl -d perf flags, it writes:
[opencl_init] opencl related configuration options:
[opencl_init] opencl: ON
[opencl_init] opencl_scheduling_profile: 'default'
[opencl_init] opencl_library: 'default path'
[opencl_init] opencl_device_priority: '*/!0,*/*/*'
[opencl_init] opencl_mandatory_timeout: 200
[opencl_init] opencl_synch_cache: false
[opencl_init] opencl library 'libOpenCL' found on your system and loaded
[opencl_init] found 1 platform
[opencl_init] could not get device id: CL_DEVICE_NOT_FOUND
[opencl_init] found 0 device
[opencl_init] FINALLY: opencl is NOT AVAILABLE on this system.
[opencl_init] initial status of opencl enabled flag is OFF.
Hi Michal, as far as I know, ATI drivers lacks OpenCL image support in linux (at least a year ago), required by darktable.
MESA drivers developers are working to add this feature in their code, but I don’t know if this is released, yet.
This is the link to a branch in github containing their work: https://github.com/vedranmiletic/mesa/tree/r600-image-support.
Michele
I’m sorry that I can’t exactly tell. I’ve left linux for a while now and haven’t used it much. But I think rocm-opencl is all I needed (and its dependencies). I probably also added my user to video + render group.
Download and install the latest Radeon installer package for Ubuntu from AMD.
Open a terminal and run:
amdgpu-install -y --usecase=opencl --no-dkms
sudo usermod -a -G render $LOGNAME
Restart your computer
This should give you a minimal and open source only installation of AMD OpenCL that works with darktable.
Alternatively, if you’re sure you have already installed the latest version of AMD OpenCL correctly, you may just need to run one of the following and then restart your computer:
sudo usermod -a -G render $LOGNAME
or
sudo usermod -a -G video $LOGNAME
The terminal output you posted indicates that OpenCL may be installed, but it can’t see your graphics card (“[opencl_init] found 0 device”).
Number of platforms 1
Platform Name AMD Accelerated Parallel Processing
Platform Vendor Advanced Micro Devices, Inc.
Platform Version OpenCL 2.1 AMD-APP (3452.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, ...) No platform
clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...) No platform
clCreateContext(NULL, ...) [default] No platform
clCreateContext(NULL, ...) [other]
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
I am getting the same. Linux Mint 20.3 here with AMD A4-7210 APU with AMD Radeon R3 Graphics × 4
I followed @inquisitvepand’s instructions. Darktable starts with
$ darktable -d opencl -d perf
[opencl_init] opencl related configuration options:
[opencl_init] opencl: ON
[opencl_init] opencl_scheduling_profile: ‘default’
[opencl_init] opencl_library: ‘default path’
[opencl_init] opencl_device_priority: ‘/!0,//’
[opencl_init] opencl_mandatory_timeout: 200
[opencl_init] opencl_synch_cache: false
[opencl_init] opencl library ‘libOpenCL’ found on your system and loaded
[opencl_init] found 1 platform
[opencl_init] could not get device id: CL_DEVICE_NOT_FOUND
[opencl_init] found 0 device
[opencl_init] FINALLY: opencl is NOT AVAILABLE on this system.
[opencl_init] initial status of opencl enabled flag is OFF.
I have installed Intel Neo driver for my i7 8700 inbuilt 630 GPU and opencl is available but am not sure about its performance. Will do some testing.
In the meantime I request all DT users using AMD card and using Ubuntu 22.04 or equivalent distros for help.
By the way everything was working with Ubuntu 20.04 and previous AMD driver for this Distro.
Ok, I just upgraded the GPU in my desktop system and I might be able to help a bit. I am by no means a GPU expert, nor a darktable developer. I’m just a retired computer programmer/programming manager with a long history of digging into inscrutable technical documentation and trying to make sense of it all…
For the record, I am currently using Ubuntu 22.04. I was using a Radeon RX 580 in my desktop and it worked well with OpenCL under 20.04.
However, with my upgrade to 22.04, I decided to upgrade my GPU. I replaced the RX 580 today with a Radeon RX 6650 XT. I used inquisitivepanda’s instructions for the install and they worked for ME. BUT my new GPU is a current model - not an older model like my RX 580.
My RX 580 - like Michal Kvasnička’s RX 550 - is an older GPU architecture and so you need to change the amdgpu-install command a bit. So, when you’re installing the AMD software, you HAVE TO make sure what generation your GPU is. In the case of the RX 550/580, it’s older than Vega 10, and here’s what AMD says about that in the install instructions:
There are two OpenCL implementations available:
. ROCr: Provides support for Vega 10 and newer hardware.
. Legacy: Provides support for hardware older than Vega 10.
So to install OpenCL for a legacy product like the RX 550/580, you need to specify:
–opencl=legacy
in your command line.
It also appears that Rajkhand’s A4-7210 would also be a legacy product. But…
GPU drivers and related software like OpenCL are fearsomely complex. And while it’s not official by any means, if you look at: Wikipedia’s List of AMD graphics processing units
You will notice that the line indicating ‘AMD Support’ goes back only so far. Older stuff MAY NOT work with the legacy OpenCL driver - I really don’t know.
The amdgpu-install command has a lot of options, which you can see with command:
amdgpu-install --help
And there is also the command:
amdgpu-install --list-usecase
which gives you a list of all the use cases
The --list-usecase command returns the following tidbit (along with all the possible use-cases):
If --usecase option is not present, the default selection is "dkms,graphics,opencl,hip"
So, you should be able to issue the command:
amdgpu-install -y --usecase=graphics,hip --opencl=legacy --no-dkms
Which I think would be the equivalent of the command you quoted, while allowing you to specify the legacy OpenCL driver. HOWEVER, I have not tried this myself. I don’t have a desktop with a GPU that needs a legacy OpenCL driver.
=-=-=-=-=-=-=-
When I installed the 20.04 version of amdgpu-install a couple of years ago the documentation had a lot of discussion about the --usecase= parameters. In the current version, --usecase= item isn’t even mentioned - meaning that most people will get the default values, which are listed above.
The --opencl=legacy option - I believe - requires the operator to accept an end-user license agreement (EULA) for the licensed software that’s being installed. I believe the -y switch automatically accepts the EULA for you. The non-legacy version is open source, so no EULA is needed.
Appreciate the help, but it didn’t work. I did get it to install after reading on AMDs website. I think I installed way more than I needed, not to worry however. Oh and yes, it did pop up a text box to get me to accept the EULA.
Unfortunately Darktable still cannot use opencl on my system (same startup message)
Getting following error ERROR: using '--no-dkms' with '--opencl=legacy' is not supported
can someone explain meaning of --no-dkms and why it is required?
[opencl_init] OpenCL successfully initialized.
[opencl_init] here are the internal numbers and names of OpenCL devices available to darktable:
[opencl_init] 0 'Intel(R) UHD Graphics 630 [0x3e92]'
[opencl_init] 1 'Ellesmere'
[opencl_init] FINALLY: opencl is AVAILABLE on this system.
[opencl_init] initial status of opencl enabled flag is ON.
[opencl_init] set scheduling profile to default.
[dt_opencl_update_priorities] these are your device priorities:
[dt_opencl_update_priorities] image preview export thumbs preview2
[dt_opencl_update_priorities] 1 0 1 0 0
[dt_opencl_update_priorities] -1 -1 0 1 1
[dt_opencl_update_priorities] show if opencl use is mandatory for a given pixelpipe:
[dt_opencl_update_priorities] image preview export thumbs preview2
[dt_opencl_update_priorities] 1 0 1 1 1
[opencl_synchronization_timeout] synchronization timeout set to 200
[dt_opencl_update_priorities] these are your device priorities:
[dt_opencl_update_priorities] image preview export thumbs preview2
[dt_opencl_update_priorities] 1 0 1 0 0
[dt_opencl_update_priorities] -1 -1 0 1 1
[dt_opencl_update_priorities] show if opencl use is mandatory for a given pixelpipe:
[dt_opencl_update_priorities] image preview export thumbs preview2
[dt_opencl_update_priorities] 1 0 1 1 1
[opencl_synchronization_timeout] synchronization timeout set to 200
In my case I never had this error. As I am not an expert for many days I was experimenting, installing/uninstalling various things, but am not sure why today I was able to get success so I am sending you my terminal History file of all the trial and errors of past many days. I only got success in line 917.
Hope some expert can analyze and shade some light
DKMS refers to Linux’s Dynamic Kernel Module Support. The error message is saying that a dynamically loaded kernel module is required for legacy OpenCL support.
I’m not on a Linux machine at the moment, but you should be able to find the tools to build kernel modules pretty readily.