You are not logged in.

#1 2023-08-30 02:18:07

takenji1989
Member
Registered: 2016-06-29
Posts: 15

[Solved: Workaround] Darktable crashes with rocm or rusticl

I've been trying to get Darktable (version 4.4.2) to work with OpenCL on my Radeon RX 6750 XT, but haven't had much luck.  I first tried using rocm (version 5.6.0-1 in my case) and clearing ~/.cache/darktable as suggested here, but it causes Darktable to crash:

% darktable -d opencl
     0.1091 [dt_get_sysresource_level] switched to 3 as `unrestricted'
     0.1091   total mem:       64253MB
     0.1091   mipmap cache:    8031MB
     0.1091   available mem:   1028063MB
     0.1091   singlebuff:      64253MB
     0.1091   OpenCL tune mem: OFF
     0.1091   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,*/*/*'
[opencl_init] opencl_mandatory_timeout: 200
[opencl_init] opencl library 'libOpenCL' found on your system and loaded
[opencl_init] found 1 platform
[opencl_init] found 1 device

[dt_opencl_device_init]
   DEVICE:                   0: 'gfx1031'
   PLATFORM NAME & VENDOR:   AMD Accelerated Parallel Processing, Advanced Micro Devices, Inc.
   CANONICAL NAME:           amdacceleratedparallelprocessinggfx1031
   DRIVER VERSION:           3570.0 (HSA1.1,LC)
   DEVICE VERSION:           OpenCL 2.0 
   DEVICE_TYPE:              GPU
   GLOBAL MEM SIZE:          12272 MB
   MAX MEM ALLOC:            10431 MB
   MAX IMAGE SIZE:           16384 x 16384
   MAX WORK GROUP SIZE:      256
   MAX WORK ITEM DIMENSIONS: 3
   MAX WORK ITEM SIZES:      [ 1024 1024 1024 ]
   ASYNC PIXELPIPE:          NO
   PINNED MEMORY TRANSFER:   NO
   MEMORY TUNING:            NO
   FORCED HEADROOM:          400
   AVOID ATOMICS:            NO
   MICRO NAP:                250
   ROUNDUP WIDTH:            16
   ROUNDUP HEIGHT:           16
   CHECK EVENT HANDLES:      128
   TILING ADVANTAGE:         0.000
   DEFAULT DEVICE:           NO
   KERNEL BUILD DIRECTORY:   /usr/share/darktable/kernels
   KERNEL DIRECTORY:         /home/USER/.cache/darktable/cached_v1_kernels_for_AMDAcceleratedParallelProcessinggfx1031_35700HSA11LC
   CL COMPILER OPTION:       -cl-fast-relaxed-math
PHI node has multiple entries for the same basic block with different incoming values!
  %967 = phi float [ %largephi.extractslice0, %sw.default ], [ %largephi.extractslice055, %sw.bb667 ], [ %largephi.extractslice059, %sw.bb663 ], [ %largephi.extractslice063, %sw.bb659 ], [ %largephi.extractslice067, %sw.bb655 ], [ %largephi.extractslice071, %sw.bb646 ], [ %largephi.extractslice075, %_Z4fmodff.exit16 ], [ %largephi.extractslice079, %_Z4fmodff.exit13 ], [ %largephi.extractslice083, %_Z4fmodff.exit ], [ %largephi.extractslice087, %sw.bb562 ], [ %largephi.extractslice091, %sw.bb555 ], [ %largephi.extractslice095, %sw.bb533 ], [ %largephi.extractslice099, %if.then502 ], [ %largephi.extractslice0103, %if.else517 ], [ %largephi.extractslice0107, %if.then456 ], [ %largephi.extractslice0111, %if.else471 ], [ %largephi.extractslice0115, %if.then393 ], [ %largephi.extractslice0119, %if.else408 ], [ %largephi.extractslice0123, %if.then338 ], [ %largephi.extractslice0127, %if.else353 ], [ %largephi.extractslice0131, %if.then283 ], [ %largephi.extractslice0135, %if.else298 ], [ %largephi.extractslice0139, %if.then224 ], [ %largephi.extractslice0143, %if.else241 ], [ %largephi.extractslice0147, %sw.bb193 ], [ %largephi.extractslice0151, %sw.bb180 ], [ %largephi.extractslice0155, %sw.bb168 ], [ %largephi.extractslice0159, %sw.bb158 ], [ %largephi.extractslice0163, %sw.bb147 ], [ %largephi.extractslice0167, %if.then116 ], [ %largephi.extractslice0171, %if.else131 ], [ %largephi.extractslice0175, %sw.bb71 ], [ %largephi.extractslice0179, %sw.bb ], [ %largephi.extractslice0183, %if.end ], [ %largephi.extractslice0187, %if.end ], [ %largephi.extractslice0191, %if.end ], [ %largephi.extractslice0195, %if.end ], [ %largephi.extractslice0199, %if.end ]
label %if.end
  %largephi.extractslice0195 = extractelement <4 x float> %div, i64 0
  %largephi.extractslice0183 = extractelement <4 x float> %div, i64 0
in function blendop_Lab
LLVM ERROR: Broken function found, compilation aborted!

After looking around some more, I found this post, so I tried using opencl-rusticl-mesa (version 1:23.1.6-40) instead of rocm, and clearing ~/.cache/darktable, but that caused both Darktable and X to crash instead:

% RUSTICL_ENABLE=radeonsi darktable -d opencl
     0.1079 [dt_get_sysresource_level] switched to 3 as `unrestricted'
     0.1079   total mem:       64253MB
     0.1079   mipmap cache:    8031MB
     0.1079   available mem:   1028063MB
     0.1079   singlebuff:      64253MB
     0.1079   OpenCL tune mem: OFF
     0.1079   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,*/*/*'
[opencl_init] opencl_mandatory_timeout: 200
[opencl_init] opencl library 'libOpenCL' found on your system and loaded
[opencl_init] found 1 platform
[opencl_init] found 1 device

[dt_opencl_device_init]
   DEVICE:                   0: 'AMD Radeon RX 6750 XT (navi22, LLVM 16.0.6, DRM 3.52, 6.4.12-arch1-1)'
   PLATFORM NAME & VENDOR:   rusticl, Mesa/X.org
   CANONICAL NAME:           rusticlamdradeonrx6750xt
   DRIVER VERSION:           23.1.6-arch1.4
   DEVICE VERSION:           OpenCL 3.0 
   DEVICE_TYPE:              GPU
   GLOBAL MEM SIZE:          12288 MB
   MAX MEM ALLOC:            2048 MB
   MAX IMAGE SIZE:           16384 x 16384
   MAX WORK GROUP SIZE:      1024
   MAX WORK ITEM DIMENSIONS: 3
   MAX WORK ITEM SIZES:      [ 1024 1024 1024 ]
   ASYNC PIXELPIPE:          NO
   PINNED MEMORY TRANSFER:   NO
   MEMORY TUNING:            NO
   FORCED HEADROOM:          400
   AVOID ATOMICS:            NO
   MICRO NAP:                250
   ROUNDUP WIDTH:            16
   ROUNDUP HEIGHT:           16
   CHECK EVENT HANDLES:      128
   TILING ADVANTAGE:         0.000
   DEFAULT DEVICE:           NO
   KERNEL BUILD DIRECTORY:   /usr/share/darktable/kernels
   KERNEL DIRECTORY:         /home/USER/.cache/darktable/cached_v1_kernels_for_rusticlAMDRadeonRX6750XT_2316arch14
   CL COMPILER OPTION:       -cl-fast-relaxed-math
   KERNEL LOADING TIME:       0.4950 sec
[opencl_init] OpenCL successfully initialized. Internal numbers and names of available devices:
[opencl_init]		0	'rusticl AMD Radeon RX 6750 XT'
[opencl_init] FINALLY: opencl is AVAILABLE and ENABLED.
[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]		0	-1	0	0	-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]		0	0	0	0	0
[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]		0	-1	0	0	-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]		0	0	0	0	0
[opencl_synchronization_timeout] synchronization timeout set to 200
    16.6759 [dt_opencl_check_tuning] use 10448MB (tunemem=OFF, pinning=OFF) on device `rusticl AMD Radeon RX 6750 XT' id=0
amdgpu: The CS has been rejected (-125), but the context isn't robust.
amdgpu: The process will be terminated.

Any suggestions here?  I'll post some diagnostic info in the next post in this thread.

Last edited by takenji1989 (2023-09-03 14:37:39)

Offline

#2 2023-08-30 02:20:54

takenji1989
Member
Registered: 2016-06-29
Posts: 15

Re: [Solved: Workaround] Darktable crashes with rocm or rusticl

% uname -a
Linux threeflex 6.4.12-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 24 Aug 2023 00:38:14 +0000 x86_64 GNU/Linux
% lspci -k
00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Starship/Matisse Root Complex
	Subsystem: Micro-Star International Co., Ltd. [MSI] Starship/Matisse Root Complex
00:00.2 IOMMU: Advanced Micro Devices, Inc. [AMD] Starship/Matisse IOMMU
	Subsystem: Micro-Star International Co., Ltd. [MSI] Starship/Matisse IOMMU
00:01.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
00:01.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Starship/Matisse GPP Bridge
	Subsystem: Advanced Micro Devices, Inc. [AMD] Starship/Matisse GPP Bridge
	Kernel driver in use: pcieport
00:01.3 PCI bridge: Advanced Micro Devices, Inc. [AMD] Starship/Matisse GPP Bridge
	Subsystem: Advanced Micro Devices, Inc. [AMD] Starship/Matisse GPP Bridge
	Kernel driver in use: pcieport
00:02.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
00:03.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
00:03.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Starship/Matisse GPP Bridge
	Subsystem: Advanced Micro Devices, Inc. [AMD] Starship/Matisse GPP Bridge
	Kernel driver in use: pcieport
00:04.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
00:05.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
00:07.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
00:07.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Starship/Matisse Internal PCIe GPP Bridge 0 to bus[E:B]
	Subsystem: Advanced Micro Devices, Inc. [AMD] Starship/Matisse Internal PCIe GPP Bridge 0 to bus[E:B]
	Kernel driver in use: pcieport
00:08.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge
00:08.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Starship/Matisse Internal PCIe GPP Bridge 0 to bus[E:B]
	Subsystem: Advanced Micro Devices, Inc. [AMD] Starship/Matisse Internal PCIe GPP Bridge 0 to bus[E:B]
	Kernel driver in use: pcieport
00:08.2 PCI bridge: Advanced Micro Devices, Inc. [AMD] Starship/Matisse Internal PCIe GPP Bridge 0 to bus[E:B]
	Subsystem: Advanced Micro Devices, Inc. [AMD] Starship/Matisse Internal PCIe GPP Bridge 0 to bus[E:B]
	Kernel driver in use: pcieport
00:08.3 PCI bridge: Advanced Micro Devices, Inc. [AMD] Starship/Matisse Internal PCIe GPP Bridge 0 to bus[E:B]
	Subsystem: Advanced Micro Devices, Inc. [AMD] Starship/Matisse Internal PCIe GPP Bridge 0 to bus[E:B]
	Kernel driver in use: pcieport
00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller (rev 61)
	Subsystem: Micro-Star International Co., Ltd. [MSI] FCH SMBus Controller
	Kernel driver in use: piix4_smbus
	Kernel modules: i2c_piix4, sp5100_tco
00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge (rev 51)
	Subsystem: Micro-Star International Co., Ltd. [MSI] FCH LPC Bridge
00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Matisse/Vermeer Data Fabric: Device 18h; Function 0
00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Matisse/Vermeer Data Fabric: Device 18h; Function 1
00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Matisse/Vermeer Data Fabric: Device 18h; Function 2
00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Matisse/Vermeer Data Fabric: Device 18h; Function 3
	Kernel driver in use: k10temp
	Kernel modules: k10temp
00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Matisse/Vermeer Data Fabric: Device 18h; Function 4
00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Matisse/Vermeer Data Fabric: Device 18h; Function 5
00:18.6 Host bridge: Advanced Micro Devices, Inc. [AMD] Matisse/Vermeer Data Fabric: Device 18h; Function 6
00:18.7 Host bridge: Advanced Micro Devices, Inc. [AMD] Matisse/Vermeer Data Fabric: Device 18h; Function 7
01:00.0 Non-Volatile memory controller: Sandisk Corp WD Black 2018/SN750 / PC SN720 NVMe SSD
	Subsystem: Sandisk Corp WD Black 2018/SN750 / PC SN720 NVMe SSD
	Kernel driver in use: nvme
	Kernel modules: nvme
03:00.0 USB controller: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset USB 3.1 xHCI Compliant Host Controller (rev 01)
	Subsystem: ASMedia Technology Inc. 400 Series Chipset USB 3.1 xHCI Compliant Host Controller
	Kernel driver in use: xhci_hcd
	Kernel modules: xhci_pci
03:00.1 SATA controller: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset SATA Controller (rev 01)
	Subsystem: ASMedia Technology Inc. 400 Series Chipset SATA Controller
	Kernel driver in use: ahci
03:00.2 PCI bridge: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset PCIe Bridge (rev 01)
	Subsystem: ASMedia Technology Inc. 400 Series Chipset PCIe Bridge
	Kernel driver in use: pcieport
20:00.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset PCIe Port (rev 01)
	Subsystem: ASMedia Technology Inc. 400 Series Chipset PCIe Port
	Kernel driver in use: pcieport
20:01.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset PCIe Port (rev 01)
	Subsystem: ASMedia Technology Inc. 400 Series Chipset PCIe Port
	Kernel driver in use: pcieport
20:04.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] 400 Series Chipset PCIe Port (rev 01)
	Subsystem: ASMedia Technology Inc. 400 Series Chipset PCIe Port
	Kernel driver in use: pcieport
21:00.0 Serial controller: Oxford Semiconductor Ltd OXPCIe954 Quad Native 950 UART
	DeviceName: Broadcom 5762
	Subsystem: Oxford Semiconductor Ltd OXPCIe954 Quad Native 950 UART
	Kernel driver in use: serial
22:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
	Subsystem: Micro-Star International Co., Ltd. [MSI] RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
	Kernel driver in use: r8168
	Kernel modules: r8169, r8168
25:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 06)
	Subsystem: TP-LINK Technologies Co., Ltd. TG-3468 Gigabit PCI Express Network Adapter
	Kernel driver in use: r8168
	Kernel modules: r8169, r8168
26:00.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 XL Upstream Port of PCI Express Switch (rev c0)
	Kernel driver in use: pcieport
27:00.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 XL Downstream Port of PCI Express Switch
	Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 XL Downstream Port of PCI Express Switch
	Kernel driver in use: pcieport
28:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT] (rev c0)
	Subsystem: XFX Limited Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT]
	Kernel driver in use: amdgpu
	Kernel modules: amdgpu
28:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Navi 21/23 HDMI/DP Audio Controller
	Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Navi 21/23 HDMI/DP Audio Controller
	Kernel driver in use: snd_hda_intel
	Kernel modules: snd_hda_intel
29:00.0 Non-Essential Instrumentation [1300]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Function
	Subsystem: Micro-Star International Co., Ltd. [MSI] Starship/Matisse PCIe Dummy Function
2a:00.0 Non-Essential Instrumentation [1300]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse Reserved SPP
	Subsystem: Micro-Star International Co., Ltd. [MSI] Starship/Matisse Reserved SPP
2a:00.1 Encryption controller: Advanced Micro Devices, Inc. [AMD] Starship/Matisse Cryptographic Coprocessor PSPCPP
	Subsystem: Micro-Star International Co., Ltd. [MSI] Starship/Matisse Cryptographic Coprocessor PSPCPP
	Kernel driver in use: ccp
	Kernel modules: ccp
2a:00.3 USB controller: Advanced Micro Devices, Inc. [AMD] Matisse USB 3.0 Host Controller
	Subsystem: Micro-Star International Co., Ltd. [MSI] Matisse USB 3.0 Host Controller
	Kernel driver in use: xhci_hcd
	Kernel modules: xhci_pci
2a:00.4 Audio device: Advanced Micro Devices, Inc. [AMD] Starship/Matisse HD Audio Controller
	Subsystem: Micro-Star International Co., Ltd. [MSI] Starship/Matisse HD Audio Controller
	Kernel driver in use: snd_hda_intel
	Kernel modules: snd_hda_intel
30:00.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] (rev 51)
	Subsystem: Micro-Star International Co., Ltd. [MSI] FCH SATA Controller [AHCI mode]
	Kernel driver in use: ahci
31:00.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] (rev 51)
	Subsystem: Micro-Star International Co., Ltd. [MSI] FCH SATA Controller [AHCI mode]
	Kernel driver in use: ahci
% glxinfo -B
name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: AMD (0x1002)
    Device: AMD Radeon RX 6750 XT (navi22, LLVM 16.0.6, DRM 3.52, 6.4.12-arch1-1) (0x73df)
    Version: 23.1.6
    Accelerated: yes
    Video memory: 12288MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 4.6
    Max compat profile version: 4.6
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
Memory info (GL_ATI_meminfo):
    VBO free memory - total: 11279 MB, largest block: 11279 MB
    VBO free aux. memory - total: 32090 MB, largest block: 32090 MB
    Texture free memory - total: 11279 MB, largest block: 11279 MB
    Texture free aux. memory - total: 32090 MB, largest block: 32090 MB
    Renderbuffer free memory - total: 11279 MB, largest block: 11279 MB
    Renderbuffer free aux. memory - total: 32090 MB, largest block: 32090 MB
Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 12288 MB
    Total available memory: 44414 MB
    Currently available dedicated video memory: 11279 MB
OpenGL vendor string: AMD
OpenGL renderer string: AMD Radeon RX 6750 XT (navi22, LLVM 16.0.6, DRM 3.52, 6.4.12-arch1-1)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 23.1.6-arch1.4
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.6 (Compatibility Profile) Mesa 23.1.6-arch1.4
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.2 Mesa 23.1.6-arch1.4
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
% clinfo --list
Platform #0: AMD Accelerated Parallel Processing
 `-- Device #0: gfx1031

Last edited by takenji1989 (2023-08-30 14:09:27)

Offline

#3 2023-08-30 14:11:50

takenji1989
Member
Registered: 2016-06-29
Posts: 15

Re: [Solved: Workaround] Darktable crashes with rocm or rusticl

Looks like it's a known problem and is planned to be fixed in ROCm 5.7.

Offline

#4 2023-09-01 12:12:39

Luciddream
Member
From: Greece
Registered: 2014-12-08
Posts: 25

Re: [Solved: Workaround] Darktable crashes with rocm or rusticl

Did you try opencl-amd package from AUR? Some people have reported it works for them.

Offline

#5 2023-09-03 14:36:23

takenji1989
Member
Registered: 2016-06-29
Posts: 15

Re: [Solved: Workaround] Darktable crashes with rocm or rusticl

Thanks, that does work for me.

Wow, it sure makes some filters significantly faster!

Offline

Board footer

Powered by FluxBB