You are not logged in.

#1 2023-07-03 23:01:03

gomi
Member
Registered: 2023-02-01
Posts: 27

SOLVED OpenCL not working on Desktop

Trying to install OpenCL for use with darktable. Running 6.4.1-arch1-1 with AMD Ryzen 5 5600G on a desktop.

 $ lspci -k | grep -A 3 -E "(VGA|3D)"
05:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Cezanne [Radeon Vega Series / Radeon Vega Mobile Series] (rev c9)
	Subsystem: Gigabyte Technology Co., Ltd Cezanne [Radeon Vega Series / Radeon Vega Mobile Series]
	Kernel driver in use: amdgpu
	Kernel modules: amdgpu

After reading the wiki GPGPU page elected to go for hip-runtime-amd after checking mesa was already installed and installing clinfo and mesa-utils.

The installations all appeared to go well but after installing hip-runtime-amd then:

 # ls /lib/dri
crocus_dri.so  kms_swrast_dri.so  radeonsi_dri.so    zink_dri.so
d3d12_dri.so   nouveau_dri.so	  swrast_dri.so
i915_dri.so    r300_dri.so	  virtio_gpu_dri.so
iris_dri.so    r600_dri.so	  vmwgfx_dri.so 

so all modules from the installation are there (I expected to see only one, radeonsi_dri.so as that is the correct one for my GPU).

 $ ls /etc/OpenCL/vendors
ls: cannot access '/etc/OpenCL/vendors': No such file or directory 

clinfo simply elicits "Number of platforms 0".

and

 $ /opt/rocm/bin/clinfo | grep -i "image support"
bash: /opt/rocm/bin/clinfo: No such file or directory 

Testing whether darktable could pick up what I couldn't see:

 $ darktable -d opencl
     0.0368 [dt_get_sysresource_level] switched to 1 as `default'
     0.0368   total mem:       31438MB
     0.0368   mipmap cache:    3929MB
     0.0368   available mem:   15719MB
     0.0368   singlebuff:      245MB
     0.0368   OpenCL tune mem: OFF
     0.0368   OpenCL pinned:   OFF
[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,*/*/*/!0,*'
[opencl_init] opencl_mandatory_timeout: 400
[opencl_init] opencl library 'libOpenCL' found on your system and loaded
[opencl_init] could not get platforms: Unknown OpenCL error
[opencl_init] FINALLY: opencl is NOT AVAILABLE and NOT ENABLED.
     2.0166 [lib_load_module] failed to open `midi': libportmidi.so.2: cannot open shared object file: No such file or directory 

Not sure how that last line got there or what it means. I am due an eye test and cannot make out exactly what the device priority says but it doesn't look healthy on the face of it. Should it be much higher and how would I make it so?

On a more positive note, it confirms OpenCL is in  there but how do I trace the "Unknown OpenCL error"?

It seems OpenCL is in there somewhere but hidden from use. Any pointers to how I can get it working please?

<edit> Apologies, missed out DT version - darktable 4.4.1 </edit>

<further edit> Just tried to start darktable again so I could extract journal entries without having many pages of it:

 # journalctl -r
Jul 04 00:08:38 mingus dbus-daemon[439]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.Avahi.service': Unit dbus-org.freedesktop.Avahi.service not found.
Jul 04 00:08:38 mingus dbus-daemon[439]: [system] Activating via systemd: service name='org.freedesktop.Avahi' unit='dbus-org.freedesktop.Avahi.service' requested by ':1.102' (uid=1000 pid=33671 comm="/usr/bin/darktable")
Jul 04 00:08:38 mingus org.darktable.darktable.desktop[33671]:      2.0373 [lib_load_module] failed to open `midi': libportmidi.so.2: cannot open shared object file: No such file or directory
Jul 04 00:08:36 mingus systemd[532]: Started Application launched by gnome-shell.
Jul 04 00:07:33 mingus systemd[532]: app-gnome-org.darktable.darktable-32955.scope: Consumed 2.126s CPU time.
Jul 04 00:07:20 mingus gnome-shell[690]: g_closure_unref: assertion 'closure->ref_count > 0' failed
Jul 04 00:07:20 mingus gnome-shell[690]: g_closure_unref: assertion 'closure->ref_count > 0' failed
Jul 04 00:05:56 mingus gnome-shell[690]: g_closure_unref: assertion 'closure->ref_count > 0' failed
Jul 04 00:05:56 mingus gnome-shell[690]: g_closure_unref: assertion 'closure->ref_count > 0' failed
Jul 04 00:05:38 mingus dbus-daemon[439]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.Avahi.service': Unit dbus-org.freedesktop.Avahi.service not found.
Jul 04 00:05:38 mingus dbus-daemon[439]: [system] Activating via systemd: service name='org.freedesktop.Avahi' unit='dbus-org.freedesktop.Avahi.service' requested by ':1.99' (uid=1000 pid=32955 comm="/usr/bin/darktable")
Jul 04 00:05:38 mingus org.darktable.darktable.desktop[32955]:      2.0221 [lib_load_module] failed to open `midi': libportmidi.so.2: cannot open shared object file: No such file or directory
Jul 04 00:05:36 mingus systemd[532]: Started Application launched by gnome-shell.
Jul 04 00:03:04 mingus rtkit-daemon[833]: Supervising 5 threads of 3 processes of 1 users.
Jul 04 00:03:04 mingus rtkit-daemon[833]: Supervising 5 threads of 3 processes of 1 users.
Jul 04 00:02:14 mingus rtkit-daemon[833]: Supervising 5 threads of 3 processes of 1 users.
Jul 04 00:02:14 mingus rtkit-daemon[833]: Supervising 5 threads of 3 processes of 1 users.
Jul 04 00:00:14 mingus systemd[1]: shadow.service: Deactivated successfully.
Jul 04 00:00:14 mingus systemd[1]: Started Verify integrity of password and group files. 

Is Gnome's "Avahi" service the culprit? </further edit>

Last edited by gomi (2023-07-04 21:13:13)

Offline

#2 2023-07-04 11:28:48

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,024

Re: SOLVED OpenCL not working on Desktop

After reading the wiki GPGPU page elected to go for hip-runtime-amd

DT uses OpenCL , not HIP (for Blender it's the reverse.)  Check section 4.3 of that wiki page to see which package you need.

Focus on getting clinfo (both from extra & rocm ) to see your device and its capabilities.
Once basic OpenCL config is working, revisit darktable .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2023-07-04 21:11:21

gomi
Member
Registered: 2023-02-01
Posts: 27

Re: SOLVED OpenCL not working on Desktop

Sincere thanks for that clarification, @Lone_Wolf. I have to confess getting confused and reading the page a few times before deciding. It began with my decision to install both the GIMP and Blender so that probably added to the confusion.

So another problem resolved. Life will be so much easier for anybody with a similar misunderstanding who finds this post!

Last edited by gomi (2023-07-04 21:14:32)

Offline

Board footer

Powered by FluxBB