Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 910451 - media-gfx/darktable-4.4.1 segfaults with media-libs/mesa-23.1.3 and using opencl
Summary: media-gfx/darktable-4.4.1 segfaults with media-libs/mesa-23.1.3 and using opencl
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Marek Szuba (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-17 08:24 UTC by Johannes Niess
Modified: 2023-08-05 13:09 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Darktable-cltest with mesa-23.0.3 working as expected (darktable-cltest-mesa-23.0.3-txt,3.75 KB, text/plain)
2023-07-17 08:24 UTC, Johannes Niess
Details
Darktable-cltest segfaulting with mesa-23.0.3 (darktable-cltest-mesa-23.1.3-txt,1.81 KB, text/plain)
2023-07-17 08:25 UTC, Johannes Niess
Details
strace of segfaulting darktable-opencltest (darktabe-cltest-segfaulting-strace.zip,24.06 KB, application/zip)
2023-07-17 08:34 UTC, Johannes Niess
Details
Strace with mesa-23.0.3-r1 passing as comparison (strace_of_passing_darktable-cltest_with_mesa_23.03.3-r1.txt.gz,52.45 KB, application/gzip)
2023-07-28 07:51 UTC, Johannes Niess
Details
Darktable-clinfo passing with mesa-23.1.5 and disabled amd rocm (darktable-cltest-rusticl.txt,3.40 KB, text/plain)
2023-08-05 13:00 UTC, Johannes Niess
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Niess 2023-07-17 08:24:55 UTC
Created attachment 865641 [details]
Darktable-cltest with mesa-23.0.3 working as expected

emerge \=mesa-23.0.3-r1
emerge \=media-gfx/darktable-4.4.1

works as expected. 

Darktable-4.4.1 segfaults for me with the recently stabilized media-libs/mesa-23.1.3 . This also applies to darktable-cltest.

Two workarounds:
1) USE=-opencl emerge \=media-gfx/darktable-4.4.1
2) Downgrade to \=mesa-23.0.3-r1 and USE=+opencl on darktable is working again.

The error seems to be happening when detecting or initializing the mesa opencl device.
Comment 1 Johannes Niess 2023-07-17 08:25:53 UTC
Created attachment 865642 [details]
Darktable-cltest segfaulting with mesa-23.0.3
Comment 2 Johannes Niess 2023-07-17 08:30:17 UTC
niess@sawfish ~ $ emerge --info
Portage 3.0.49 (python 3.11.4-final-0, default/linux/amd64/17.1/desktop/plasma, gcc-12, glibc-2.37-r3, 6.4.3-gentoo-dist x86_64)
=================================================================
System uname: Linux-6.4.3-gentoo-dist-x86_64-AMD_Ryzen_9_5900X_12-Core_Processor-with-glibc2.37
KiB Mem:    16267656 total,   8989872 free
KiB Swap:   41943032 total,  41937400 free
Timestamp of repository gentoo: Sun, 16 Jul 2023 15:30:01 +0000
Head commit of repository gentoo: d412789799ad125025375af6e5c020197fb5d519
sh bash 5.1_p16-r6
ld GNU ld (Gentoo 2.40 p5) 2.40.0
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r6::gentoo
dev-java/java-config:      2.3.1-r1::gentoo
dev-lang/perl:             5.36.1-r3::gentoo
dev-lang/python:           3.11.4::gentoo
dev-lang/rust:             1.69.0-r1::gentoo
dev-util/cmake:            3.26.4-r1::gentoo
dev-util/meson:            1.1.1::gentoo
sys-apps/baselayout:       2.13-r1::gentoo
sys-apps/openrc:           0.47.1::gentoo
sys-apps/sandbox:          2.32::gentoo
sys-devel/autoconf:        2.13-r7::gentoo, 2.71-r6::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.40-r5::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           15.0.7-r3::gentoo, 16.0.6::gentoo
sys-devel/gcc:             12.3.1_p20230526::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/lld:             15.0.7::gentoo, 16.0.6::gentoo
sys-devel/llvm:            15.0.7-r3::gentoo, 16.0.6::gentoo
sys-devel/make:            4.4.1-r1::gentoo
sys-kernel/linux-headers:  6.1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.37-r3::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    volatile: True
    sync-rsync-extra-opts: 
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=znver3"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=znver3"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="-j 25 -l 25"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live buildsyspkg config-protect-if-modified distlocks fixlafiles ipc-sandbox multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://mirror.eu.oneandone.net/linux/distributions/gentoo/gentoo/ http://ftp.halifax.rwth-aachen.de/gentoo/ http://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/"
LANG="de_DE.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
LINGUAS="de"
MAKEOPTS="-j 25 -l 25"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="X a52 aac acl acpi activities alsa amd64 bluetooth branding bzip2 cairo cdda cdr cli crypt cups dbus declarative dri dts dvd dvdr elogind encode exif flac fortran gdbm gif gpm gtk gui heif iconv icu ipv6 jpeg kde kwallet lcms libnotify libtirpc lm-sensors lto lvm mad mng mp3 mp4 mpeg multilib ncurses networkmanager nls nptl ogg opencl opencv opengl openmp pam pango pcre pdf pipewire plasma png policykit ppds pulseaudio qml qt5 raw readline samba scanner screencast seccomp sftp sound spell split-usr ssh ssl startup-notification svg system-png test-rust tiff truetype udev udisks unicode upower usb v4l vaapi vdpau verify-sig vorbis vulkan wayland widgets wxwidgets x264 x265 xattr xcb xft xml xv xvid zeroconf zlib" ABI_X86="64" ADA_TARGET="gnat_2021" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" L10N="de en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="X86 AMDGPU BPF" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby31" VIDEO_CARDS="amdgpu radeonsi" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 3 Johannes Niess 2023-07-17 08:34:45 UTC
Created attachment 865643 [details]
strace of segfaulting darktable-opencltest
Comment 4 Johannes Niess 2023-07-28 07:51:53 UTC
Created attachment 866502 [details]
Strace with mesa-23.0.3-r1 passing as comparison
Comment 5 Marek Szuba (RETIRED) archtester gentoo-dev 2023-07-29 14:54:39 UTC
I cannot reproduce it on my end, in spite of me having a gfx1031 card too.
Comment 6 Johannes Niess 2023-07-30 11:47:10 UTC
Still happening with darktable-4.4.2 and/or mesa-23.1.4
Comment 7 Johannes Niess 2023-08-05 13:00:39 UTC
Created attachment 867147 [details]
Darktable-clinfo passing with mesa-23.1.5 and disabled amd rocm
Comment 8 Johannes Niess 2023-08-05 13:09:44 UTC
Much of your darktable-cltest code is probably based on dev-util/clinfo. It shows the same segfault behavior with media-libs/mesa-23.1.3. (tested up to media-libs/mesa-23.1.5). The clinfo man page suggests renaming/disabling all but one of the icds (amdocl64.icd and rusticl.icd). Darktable-cltest and clinfo then run to completion without segfault in both cases. 

In the rusticl case, darktable_clinfo detects a device with RUSTICL_ENABLE=radeonsi as documented on https://docs.mesa3d.org/envvars.html#rusticl-env-var and attached. Unfortunately this work in progress driver is too slow for darktable and opencl is automatically turned off.


Both icds fighting for control of the same hardware is nothing darktable can change, so I have marked this as resolved and invalid.