Instructions after the wall of text
Last year I made a definitive switch from macOS to Linux as my primary desktop use
This was not my first time using Linux, as my adventure with computing began in the 1990s precisely with Linux Debian 1.3 aka Bo.
Over the years I have always used Linux in various complementary systems to macOS as my main system, and exactly one year ago I definitely made the switch to Linux for my main system as well.
The choice obviously fell on Debian because it is the one I know best. I started with first with Debian stable. It all worked right the first time, but for desktop use it was quite limited and some devices didnât work well especially the bluetooth support. I also felt like using newer applications and switched to unstable.
But exactly as the name says, it is not stable and you have to live with several compromises. Reluctantly I decided to abandon Debian in favor of Kubuntu to stay in an area I know. All is well, the devices work perfectly, and I must admit that for a few months I was very satisfied with my choice. But even in Kubuntu things were not perfect, particularly the management of packages with snap of which I just could not appreciate the concepts.
I have heard the good and bad of the various rolling releases and somewhat by accident I landed on Tumbleweed. Never made a better choice. Installed everything and configured the snapshots. Everything still works from day one. In this year the only real big problem for me were the drivers for my AMD RX 6700 XT GPU and OpenCL support for darktable which is the main reason for my switch.
The compromise I found was RustiCL which I used until a few days ago, when I found this post that prompted me to investigate the situation better. And I finally succeeded. Not only OpenCL in darktable but also HIP on Blender and OpenCL in Resolve Da Vinci.
I leave my instructions below both for future reference and to help those who like me occasionally run into difficulties.
As geeky as I am and can move well through complex situations for the average person, I am unfortunately not a black belt in OpenCL, HIC, drivers, kernels, Vulkan, Mesa, and all these layers needed to make a GPU work. This is the one positive aspect I miss about macOS where I never had to worry about making the GPU work.
My setup is based on Tumbleweed and Your mileage may vary.
What I have learned in Linux is that every configuration is different and all it takes is even a small detail - a different PATH, one library more or less - and what works for me, will not work for another. For this reason, my post is not intended to be a complete guide or tutorial. It is probably not even complete and there is missing or misleading information for your configuration. Use it as a reference and adapt it to your needs. In any case, do not hold me responsible if you mess up your setup.
I hope that having shared my frustration and solution can help those who have encountered the same difficulties as me. If this post was helpful to you, please let me know by commenting below.
Thanks to everyone that makes Tumbleweed the best linux experience I have ever had.
Instructions
First of all, I removed the Mesa packages for RustCL:
sudo zypper rm Mesa-libRusticlOpenCL Mesa-libOpenCL
Added the repos from Leap 15.6:
sudo zypper addrepo https://repo.radeon.com/amdgpu/6.2/sle/15.6/main/x86_64/ amdgpu
sudo zypper addrepo https://repo.radeon.com/rocm/zyp/zypper/ rocm
sudo zypper ref
To activate OpenCL in darktable
sudo zypper in rocm-opencl rocm-opencl-icd-loader
sudo reboot
Test with clinfo
the information about OpenCL:
clinfo | egrep -m 6 "Name|Vendor|Version"
Platform Name Portable Computing Language
Platform Vendor The pocl project
Platform Version OpenCL 3.0 PoCL 3.1 Linux, RelWithDebInfo, RELOC, SPIR, LLVM 16.0.6, SLEEF, FP16, DISTRO, POCL_DEBUG
Platform Extensions with Version cl_khr_icd 0x400000 (1.0.0)
Platform Numeric Version 0xc00000 (3.0.0)
Platform Name AMD Accelerated Parallel Processing
Something that is very important that I never consider in my previous attempts:
- make a backup of ./config/darktable e.g.
mv ~/.config/darktable ~/.config/darktable-backup
This step is important because it for darktable recreate the full config and in my case it recognized the new GPU driver.
Run darktable, enable ROCm and activate OpenCL support from the settings.
After some test, I moved the newly created darktablerc
in my previous ~/.config/darktable-backup
folder and renamed it to be the default folder:
mv ~/.config/darktable/darktablerc ~/.config/darktable-backup/darktablerc
rm -rf ~/.config/darktable
mv ~/.config/darktable-backup ~/.config/darktable
Use also darktable-cltest
to test if openCL is available and enable/disabled. After verifying that evertyhing was ok, I used Sarunasâ benchmarks as a reference to do some benchmarks and for the first time I can see very good performances:
darktable-cli setubal.orf setubal.orf.xmp test.jpg --core -d perf -d opencl
4.1880 [dev_process_export] pixel pipeline processing took 2.119 secs (3.575 CPU)
5.3875 [export_job] exported to `test_19.jpg'
[opencl_summary_statistics] device 'AMD Accelerated Parallel Processing gfx1031' (0): 197 out of 197 events were successful and 0 events lost. max event=196
To activate HIP in Blender
I found out that these are the minimum required packages to activate HIP:
sudo zypper in rocm-cmake rocm-core rocm-device-libs rocm-llvm rocm-opencl rocm-opencl-icd-loader rocminfo hip-devel hip-runtime-amd hipcc
Add the ROCm path:
export PATH=$PATH:/opt/rocm-6.2.0/bin
I had to add the PATH environment variable in KDE as well:
'PATH=/opt/rocm-6.2.0/bin:/usr/local/bin:/usr/bin:/bin'
In Blender > Preferences the GPU option is now available.
To activate the GPU in Resolve Da Vinci:
Download Resolve da Vinci from the website:
cd ~/Downloads/DaVinci_Resolve_18.6.6_Linux/
chmod +x DaVinci_Resolve_18.6.6_Linux.run
After a first run the installer complains about some missing libraries: libapr1 and libapr-util1
Iâve only installed libapr1 from opi:
opi libapr1
and run the installer skipping the library check:
SKIP_PACKAGE_CHECK=1 ./DaVinci_Resolve_Studio_18.1_Linux.run
After the installation I had other issues, and looking for them on forums and reddit I did:
sudo cp /usr/lib64/libglib-2.0.so.0 /opt/resolve/libs/
sudo cp /usr/lib64/libgdk_pixbuf-2.0.so.0 /opt/resolve/libs/
and disabled some libraries:
cd /opt/resolve/libs
sudo mkdir disabled-libraries
sudo mv libglib* disabled-libraries
sudo mv libgio* disabled-libraries
sudo mv libgmodule* disabled-libraries
I had to install also the following packages:
sudo zypper in libxcrypt-compat libcurl libcurl-devel mesa-libGLU
Now is it possibile to run Resolve da Vinci from the terminal or the Application Launchder:
/opt/resolve/bin/resolve
In Preferences > Memory and GPU the GPU configuration shows the GPU and the OpenCL support.
References
ROCm Quick start
ROCm Post install these steps are very important, do not ignore them