Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 759508 - media-gfx/imagemagick- compiled with opencl does not support opencl
Summary: media-gfx/imagemagick- compiled with opencl does not support opencl
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Codec Project
Depends on:
Reported: 2020-12-11 20:04 UTC by Daniel Heule
Modified: 2023-04-15 08:09 UTC (History)
3 users (show)

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

Log of the configure and build (ImageMagick-,794.51 KB, text/plain)
2020-12-11 20:05 UTC, Daniel Heule

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Heule 2020-12-11 20:04:10 UTC
Hi Gentoo Developers,

i have a working opencl setup (verified by clinfo).

Now i like to have opencl supported operations with imagemagick.

I have emerged imagemagick with the following use settings:
media-gfx/imagemagick-  USE="bzip2 corefonts cxx hdri jpeg jpeg2k lzma opencl png svg tiff truetype xml zlib -X -djvu -fftw -fontconfig -fpx -graphviz -heif -jbig -lcms -lqr -openexr -openmp -pango -perl -postscript -q32 -q8 -raw -static-libs -test -webp -wmf"

When I check with the following command:

convert -list configure

Path: /usr/lib64/ImageMagick-7.0.10//config-Q16HDRI/configure.xml

Name                  Value
CC                    x86_64-pc-linux-gnu-gcc
CFLAGS                -I/usr/include/libxml2  -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/lib64/libffi/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/uuid -I/usr/include/libpng16  -I/usr/include/librsvg-2.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/lib64/libffi/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gdk-pixbuf-2.0 -pthread -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/uuid -I/usr/include/libpng16  -I/usr/include/libpng16   -I/usr/include/openjpeg-2.3  -I/usr/include/freetype2      -Wall -march=native -O2 -pipe -fexceptions -pthread -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16
CODER_PATH            /usr/lib64/ImageMagick-7.0.10/modules-Q16HDRI/coders
CONFIGURE             ./configure  '--prefix=/usr' '--build=x86_64-pc-linux-gnu' '--host=x86_64-pc-linux-gnu' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib' '--disable-dependency-tracking' '--disable-silent-rules' '--docdir=/usr/share/doc/imagemagick-' '--htmldir=/usr/share/doc/imagemagick-' '--with-sysroot=/' '--libdir=/usr/lib64' '--disable-static' '--enable-hdri' '--enable-opencl' '--with-threads' '--with-modules' '--with-quantum-depth=16' '--with-magick-plus-plus' '--without-perl' '--with-perl-options=INSTALLDIRS=vendor' '--with-gs-font-dir=/usr/share/fonts/urw-fonts' '--with-bzlib' '--without-x' '--with-zlib' '--without-autotrace' '--without-dps' '--without-djvu' '--with-dejavu-font-dir=/usr/share/fonts/dejavu' '--without-fftw' '--without-fpx' '--without-fontconfig' '--with-freetype' '--without-gslib' '--without-gvc' '--without-heic' '--without-jbig' '--with-jpeg' '--with-openjp2' '--without-jxl' '--without-lcms' '--without-lqr' '--with-lzma' '--without-openexr' '--without-pango' '--with-png' '--without-raw' '--with-rsvg' '--with-tiff' '--without-webp' '--with-windows-font-dir=/usr/share/fonts/corefonts' '--without-wmf' '--with-xml' '--disable-openmp' '--with-gcc-arch=no-automagic' 'build_alias=x86_64-pc-linux-gnu' 'host_alias=x86_64-pc-linux-gnu' 'CFLAGS=-march=native -O2 -pipe' 'LDFLAGS=-Wl,-O1 -Wl,--as-needed' 'CXXFLAGS=-march=native -O2 -pipe'
CONFIGURE_PATH        /etc/ImageMagick-7/
COPYRIGHT             Copyright (C) 1999-2020 ImageMagick Studio LLC
CPPFLAGS              -I/usr/include/ImageMagick-7
CXX                   x86_64-pc-linux-gnu-g++
CXXFLAGS              -march=native -O2 -pipe -pthread
DEFS                  -DHAVE_CONFIG_H
DELEGATES             bzlib freetype jng jpeg lzma openjp2 png ps rsvg tiff video xml ziplib zlib zstd
DISTCHECK_CONFIG_FLAGS 'CFLAGS=-march=native -O2 -pipe' 'LDFLAGS=-Wl,-O1 -Wl,--as-needed'  --disable-deprecated  --with-quantum-depth=16  --with-jemalloc=no  --with-umem=no  --with-autotrace=no  --with-dps=no  --with-dejavu-font-dir=/usr/share/fonts/dejavu  --with-fftw=no  --with-fpx=no  --with-djvu=no  --with-fontconfig=no  --with-gslib=no  --with-fontpath=  --with-gs-font-dir=/usr/share/fonts/urw-fonts  --with-gvc=no  --with-heic=no  --with-jxl=no  --with-lcms=no  --with-lqr=no  --with-openexr=no  --with-pango=no  --with-libraw=no  --with-webp=no  --with-windows-font-dir=/usr/share/fonts/corefonts  --with-wmf=no  --with-perl=no
DOCUMENTATION_PATH    /usr/share/doc/ImageMagick-7
EXEC-PREFIX           /usr
EXECUTABLE_PATH       /usr/bin
FEATURES              DPC HDRI Cipher OpenCL Modules
FILTER_PATH           /usr/lib64/ImageMagick-7.0.10/modules-Q16HDRI/filters
GIT_REVISION          18002
HOST                  x86_64-pc-linux-gnu
INCLUDE_PATH          /usr/include/ImageMagick-7
LDFLAGS               -L/usr/lib64 -Wl,-O1 -Wl,--as-needed
LIB_VERSION           0x70A
LIBRARY_PATH          /usr/lib64/ImageMagick-7.0.10
LIBS                    -lfreetype     -lxml2        -llzma  -lbz2 -lz  -lzip   -lltdl   -lm    -lpthread
NAME                  ImageMagick
PREFIX                /usr
QuantumDepth          16
RELEASE_DATE          2020-12-11
SHARE_PATH            /usr/share/ImageMagick-7
SHAREARCH_PATH        /usr/lib64/ImageMagick-7.0.10/config-Q16HDRI
TARGET_CPU            x86_64
TARGET_OS             linux-gnu
TARGET_VENDOR         pc
VERSION               7.0.10

Path: [built-in]

Name                  Value
DELEGATES             bzlib cairo freetype jng jp2 jpeg ltdl lzma png rsvg tiff xml zlib
FEATURES              Cipher DPC HDRI Modules
NAME                  ImageMagick
QuantumDepth          Q16

You can see that at compile time 
FEATURES              DPC HDRI Cipher OpenCL Modules

opencl is listed in features,

but in the runtime section, 
FEATURES              DPC HDRI Cipher OpenCL Modules

opencl is gone.

I will attach the build log as file to this bug.

Please help to find where the opencl support is lost ...

Best regards
Comment 1 Daniel Heule 2020-12-11 20:05:02 UTC
Created attachment 677983 [details]
Log of the configure and build
Comment 2 Daniel Heule 2020-12-11 20:40:59 UTC
clinfo output:

Number of platforms                               1
  Platform Name                                   AMD Accelerated Parallel Processing
  Platform Vendor                                 Advanced Micro Devices, Inc.
  Platform Version                                OpenCL 2.0 AMD-APP.dbg (3212.0)
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd cl_amd_event_callback
  Platform Extensions function suffix             AMD

  Platform Name                                   AMD Accelerated Parallel Processing
Number of devices                                 1
  Device Name                                     gfx803
  Device Vendor                                   Advanced Micro Devices, Inc.
  Device Vendor ID                                0x1002
  Device Version                                  OpenCL 1.2
  Driver Version                                  3212.0 (HSA1.1,LC)
  Device OpenCL C Version                         OpenCL C 2.0
  Device Type                                     GPU
  Device Board Name (AMD)                         Lexa PRO [Radeon 540/540X/550/550X / RX 540X/550/550X]
  Device PCI-e ID (AMD)                           0x699f
  Device Topology (AMD)                           PCI-E, 08:00.0
  Device Profile                                  FULL_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Linker Available                                Yes
  Max compute units                               8
  SIMD per compute unit (AMD)                     4
  SIMD width (AMD)                                16
  SIMD instruction width (AMD)                    1
  Max clock frequency                             1206MHz
  Graphics IP (AMD)                               8.0
  Device Partition                                (core)
    Max number of sub-devices                     8
    Supported partition types                     None
    Supported affinity domains                    (n/a)
  Max work item dimensions                        3
  Max work item sizes                             1024x1024x1024
  Max work group size                             256
  Preferred work group size (AMD)                 256
  Max work group size (AMD)                       1024
  Preferred work group size multiple (kernel)     64
  Wavefront width (AMD)                           64
  Preferred / native vector sizes
    char                                                 4 / 4
    short                                                2 / 2
    int                                                  1 / 1
    long                                                 1 / 1
    half                                                 1 / 1        (cl_khr_fp16)
    float                                                1 / 1
    double                                               1 / 1        (cl_khr_fp64)
  Half-precision Floating-point support           (cl_khr_fp16)
    Denormals                                     No
    Infinity and NANs                             No
    Round to nearest                              No
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
  Single-precision Floating-point support         (core)
    Denormals                                     No
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  Yes
  Double-precision Floating-point support         (cl_khr_fp64)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
  Address bits                                    64, Little-Endian
  Global memory size                              2147483648 (2GiB)
  Global free memory (AMD)                        2097152 (2GiB) 2097152 (2GiB)
  Global memory channels (AMD)                    2
  Global memory banks per channel (AMD)           4
  Global memory bank width (AMD)                  256 bytes
  Error Correction support                        No
  Max memory allocation                           1825361096 (1.7GiB)
  Unified memory for Host and Device              No
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       1024 bits (128 bytes)
  Global Memory cache type                        Read/Write
  Global Memory cache size                        16384 (16KiB)
  Global Memory cache line size                   64 bytes
  Image support                                   Yes
    Max number of samplers per kernel             27039
    Max size for 1D images from buffer            4294967295 pixels
    Max 1D or 2D image array size                 8192 images
    Base address alignment for 2D image buffers   256 bytes
    Pitch alignment for 2D image buffers          256 pixels
    Max 2D image size                             16384x16384 pixels
    Max 3D image size                             16384x16384x8192 pixels
    Max number of read image args                 128
    Max number of write image args                8
  Local memory type                               Local
  Local memory size                               65536 (64KiB)
  Local memory size per CU (AMD)                  65536 (64KiB)
  Local memory banks (AMD)                        32
  Max number of constant args                     8
  Max constant buffer size                        1825361096 (1.7GiB)
  Preferred constant buffer size (AMD)            16384 (16KiB)
  Max size of kernel argument                     1024
  Queue properties
    Out-of-order execution                        No
    Profiling                                     Yes
  Prefer user sync for interop                    Yes
  Number of P2P devices (AMD)                     0
  Profiling timer resolution                      1ns
  Profiling timer offset since Epoch (AMD)        0ns (Thu Jan  1 01:00:00 1970)
  Execution capabilities
    Run OpenCL kernels                            Yes
    Run native kernels                            No
    Thread trace supported (AMD)                  No
    Number of async queues (AMD)                  8
    Max real-time compute queues (AMD)            8
    Max real-time compute units (AMD)             8
  printf() buffer size                            4194304 (4MiB)
  Built-in kernels                                (n/a)
  Device Extensions                               cl_khr_fp64 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_fp16 cl_khr_gl_sharing cl_amd_device_attribute_query cl_amd_media_ops cl_amd_media_ops2 cl_khr_image2d_from_buffer cl_khr_subgroups cl_khr_depth_images cl_amd_copy_buffer_p2p cl_amd_assembly_program

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  AMD Accelerated Parallel Processing
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   Success [AMD]
  clCreateContext(NULL, ...) [default]            Success [AMD]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  Success (1)
    Platform Name                                 AMD Accelerated Parallel Processing
    Device Name                                   gfx803
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  Success (1)
    Platform Name                                 AMD Accelerated Parallel Processing
    Device Name                                   gfx803
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  Success (1)
    Platform Name                                 AMD Accelerated Parallel Processing
    Device Name                                   gfx803

ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.2.12
  ICD loader Profile                              OpenCL 2.2
Comment 3 Daniel Heule 2020-12-11 20:41:47 UTC
emerge --info
Portage 3.0.9 (python 3.8.6-final-0, default/linux/amd64/17.1, gcc-9.3.0, glibc-2.32-r2, 5.9.12-gentoo x86_64)
System uname: Linux-5.9.12-gentoo-x86_64-AMD_Ryzen_9_3900XT_12-Core_Processor-with-glibc2.2.5
KiB Mem:    65841000 total,  62750684 free
KiB Swap:    8388600 total,   8388600 free
Timestamp of repository gentoo: Fri, 11 Dec 2020 18:15:01 +0000
Head commit of repository gentoo: e546d03f1de94fd0710c58855e2bc920fb4c0a56
sh bash 5.0_p18
ld GNU ld (Gentoo 2.34 p6) 2.34.0
app-shells/bash:          5.0_p18::gentoo
dev-lang/perl:            5.30.3::gentoo
dev-lang/python:          3.8.6::gentoo, 3.9.0::gentoo
dev-util/cmake:           3.17.4-r1::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.20::gentoo
sys-devel/autoconf:       2.69-r5::gentoo
sys-devel/automake:       1.16.2-r1::gentoo
sys-devel/binutils:       2.34-r2::gentoo
sys-devel/gcc:            9.3.0-r1::gentoo
sys-devel/gcc-config:     2.3.2-r1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.4-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.32-r2::gentoo

    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-max-age: 24

CFLAGS="-march=native -O2 -pipe"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.4/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cli-php7.4/ext-active/ /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="-march=native -O2 -pipe"
EMERGE_DEFAULT_OPTS="--autounmask y --autounmask-write -j3 --keep-going y"
FCFLAGS="-march=native -O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -O2 -pipe"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
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"
USE="acl amd64 berkdb bzip2 cli crypt dri fortran gdbm iconv ipv6 libglvnd libtirpc multilib ncurses nls nptl openmp pam pcre readline seccomp split-usr ssl tcpd unicode xattr zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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 auth_digest proxy proxy_http proxy_connect proxy_fcgi proxy_scgi http2 proxy_http2 proxy_wstunnel" APACHE2_MPMS="event" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" 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" GRUB_PLATFORMS="efi-64 pc" 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" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python2_7 python3_8" RUBY_TARGETS="ruby25 ruby26" USERLAND="GNU" VIDEO_CARDS="vesa vga amdgpu" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Comment 4 Andreas K. Hüttel archtester gentoo-dev 2023-04-08 17:24:00 UTC
Can't do much here due to lack of opencl
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-04-15 07:57:15 UTC
The FEATURES in configure vs runtime isn't necessarily the same list.

Can you give me a command at runtime which fails without OpenCL support please?