darktable icon indicating copy to clipboard operation
darktable copied to clipboard

Segmentation fault opencl and rusticl AMD Radeon Graphics

Open mir07 opened this issue 1 year ago • 12 comments

Describe the bug

Trying to benchmark using opencl makes darktable segfault

darktable-cltest darktable 4.6.1 Copyright (C) 2012-2024 Johannes Hanika and other contributors.

Compile options: Bit depth -> 64 bit Debug -> DISABLED SSE2 optimizations -> ENABLED OpenMP -> ENABLED OpenCL -> ENABLED Lua -> ENABLED - API version 9.2.0 Colord -> ENABLED gPhoto2 -> ENABLED GMIC -> DISABLED - Compressed LUTs are NOT supported GraphicsMagick -> ENABLED ImageMagick -> DISABLED libavif -> ENABLED libheif -> ENABLED libjxl -> ENABLED OpenJPEG -> ENABLED OpenEXR -> ENABLED WebP -> ENABLED

See https://www.darktable.org/resources/ for detailed documentation. See https://github.com/darktable-org/darktable/issues/new/choose to report bugs.

 0.0340 [dt_get_sysresource_level] switched to 1 as `default'
 0.0340   total mem:       7362MB
 0.0340   mipmap cache:    920MB
 0.0340   available mem:   3681MB
 0.0340   singlebuff:      57MB
 0.0401 [opencl_init] opencl library 'libOpenCL' found on your system and loaded, preference 'default path'
 0.1481 [opencl_init] found 2 platforms
 0.1481 [check platform] platform 'Clover' with key 'clplatform_clover' is NOT active

[opencl_init] found 1 device

[dt_opencl_device_init] DEVICE: 0: 'AMD Radeon Graphics (radeonsi, renoir, LLVM 17.0.6, DRM 3.54, 6.6.15-amd64)' PLATFORM, VENDOR & ID: rusticl, Mesa/X.org, ID=4098 CANONICAL NAME: rusticlamdradeongraphics DRIVER VERSION: 23.3.5-1 DEVICE VERSION: OpenCL 3.0 DEVICE_TYPE: GPU, dedicated mem GLOBAL MEM SIZE: 3681 MB MAX MEM ALLOC: 920 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 AVOID ATOMICS: NO MICRO NAP: 250 ROUNDUP WIDTH & HEIGHT 16x16 CHECK EVENT HANDLES: 128 TILING ADVANTAGE: 0.000 DEFAULT DEVICE: NO KERNEL BUILD DIRECTORY: /usr/share/darktable/kernels KERNEL DIRECTORY: /home/mir/.cache/darktable/cached_v3_kernels_for_rusticlAMDRadeonGraphics_23351 CL COMPILER OPTION:
CL COMPILER COMMAND: -w -DAMD=1 -I"/usr/share/darktable/kernels" KERNEL LOADING TIME: 0.6060 sec [opencl_init] OpenCL successfully initialized. internal numbers and names of available devices: [opencl_init] 0 'rusticl AMD Radeon Graphics' 0.7555 [opencl_init] FINALLY: opencl is AVAILABLE and ENABLED. [opencl_init] opencl_scheduling_profile: 'default' [opencl_init] opencl_device_priority: '/!0,///!0,*' [opencl_init] opencl_mandatory_timeout: 400 [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

Steps to reproduce

darktable-cli bench.SRW test.jpg --core -d perf -d opencl (The raw file is not uploaded since raw files is not permitted)

Expected behavior

No response

Logfile | Screenshot | Screencast

darktable_bt_SM0DJ2.txt

Commit

No response

Where did you obtain darktable from?

distro packaging

darktable version

4.6.1

What OS are you using?

Linux

What is the version of your OS?

Debian Trixie

Describe your system?

No response

Are you using OpenCL GPU in darktable?

Yes

If yes, what is the GPU card and driver?

AMD Ryzen 5 4500U with Radeon Graphics

Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip

No response

mir07 avatar Feb 25 '24 20:02 mir07

This is kinda expected since rusticl is still in development.

A log from -d common might be more useful to see if there is anything to learn.

gi-man avatar Feb 25 '24 21:02 gi-man

Is the following what is needed? darktable_bt_5YK9I2.txt

mir07 avatar Feb 25 '24 21:02 mir07

No. Start darktable (not cli) from terminal using- d common and export the image.

gi-man avatar Feb 25 '24 21:02 gi-man

Darktable crashes with a segmentation fault when I try to add the image to the library. BT log attached. darktable_bt_X07LJ2.txt

mir07 avatar Feb 25 '24 21:02 mir07

jpg image created when opencl is disabled. test

mir07 avatar Feb 25 '24 21:02 mir07

XMP file bench.SRW.xmp.zip

mir07 avatar Feb 25 '24 22:02 mir07

RAW file can be fetched here: https://math.dartmouth.edu/~sarunas/bench_raw/boat/

mir07 avatar Feb 25 '24 22:02 mir07

I think this is the hint not to use the rusticl drivers yet.

I'm able to process sarunas image/xmp on opencl without a problem.

gi-man avatar Feb 25 '24 22:02 gi-man

with rusticl? On my workstation with NVIDIA GeForce GTX 1660 Ti there is no problems either.

mir07 avatar Feb 25 '24 22:02 mir07

I processed it with nvidia 3060 using rpmfusion drivers.

gi-man avatar Feb 25 '24 22:02 gi-man

Works just fine using rusticl from mesa 24.0.1 here, which might be why it's working, on my amd 6700 xt

piratenpanda avatar Feb 29 '24 10:02 piratenpanda

@mir07 would you be able to check with current master? I think the issue should be gone right now, if not please prove a fresh log with -d opencl -d pipe to investigate further.

jenshannoschwalm avatar Mar 17 '24 14:03 jenshannoschwalm

This issue has been marked as stale due to inactivity for the last 60 days. It will be automatically closed in 300 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.

github-actions[bot] avatar May 17 '24 00:05 github-actions[bot]