Skip to content

opencl not working with nouveau/mesa/rusticl driver #16564

Open
@blitzgneisserin

Description

@blitzgneisserin

Describe the bug

I am trying to make darktable opencl work with the nouveau driver on Arch Linux. I have installed opencl-rusticl-mesa and set the environment variable RUSTICL_ENABLE=nouveau. I also activated rusticl in darktable opencl settings. Now I get this when I type darktable-cltest:

[anna@archlinux ~]$ 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                   -> ENABLED  - Compressed LUTs are 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.0113 [dt_get_sysresource_level] switched to 1 as `default'
     0.0113   total mem:       15915MB
     0.0113   mipmap cache:    1989MB
     0.0113   available mem:   7957MB
     0.0113   singlebuff:      124MB
     0.0151 [opencl_init] opencl disabled via darktable preferences
     0.0152 [opencl_init] opencl library 'libOpenCL' found on your system and loaded, preference 'default path'
     0.1253 [opencl_init] found 1 platform
[opencl_init] found 1 device

[dt_opencl_device_init]
   DEVICE:                   0: 'NV168'
   PLATFORM, VENDOR & ID:    rusticl, Mesa/X.org, ID=4318
   CANONICAL NAME:           rusticlnv168
   DRIVER VERSION:           24.0.4-arch1.2
   DEVICE VERSION:           OpenCL 3.0 , SM_20 SUPPORT
   DEVICE_TYPE:              GPU, dedicated mem
   GLOBAL MEM SIZE:          6134 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 64 ]
   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/anna/.cache/darktable/cached_v3_kernels_for_rusticlNV168_2404arch12
   CL COMPILER OPTION:       
   CL COMPILER COMMAND:      -w   -DNVIDIA_SM_20=1 -DNVIDIA=1 -I"/usr/share/darktable/kernels"
/usr/include/c++/13.2.1/bits/stl_deque.h:1385: std::deque<_Tp, _Alloc>::const_reference std::deque<_Tp, _Alloc>::operator[](size_type) const [with _Tp = nv50_ir::ValueDef; _Alloc = std::allocator<nv50_ir::ValueDef>; const_reference = const nv50_ir::ValueDef&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
Aborted (core dumped)

On Ubuntu 23.10, the output is this:


anna@anna-ms7c96:~$ darktable-cltest
     0,0143 [dt_get_sysresource_level] switched to 1 as `default'
     0,0143   total mem:       15903MB
     0,0143   mipmap cache:    1987MB
     0,0143   available mem:   7951MB
     0,0143   singlebuff:      124MB
     0,0143   OpenCL tune mem: OFF
     0,0143   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
     0.0168 [dt_dlopencl_init] could not find default opencl runtime library 'libOpenCL'
     0.0169 [dt_dlopencl_init] could not find default opencl runtime library 'libOpenCL.so'
[opencl_init] opencl library 'libOpenCL.so.1' found on your system and loaded
[opencl_init] found 2 platforms
[opencl_init] no devices found for Mesa (vendor) - Clover (name)
[opencl_init] found 1 device

[dt_opencl_device_init]
   DEVICE:                   0: 'NV168', NEW
   PLATFORM NAME & VENDOR:   rusticl, Mesa/X.org
   CANONICAL NAME:           rusticlnv168
   DRIVER VERSION:           23.2.1-1ubuntu3.1
   DEVICE VERSION:           OpenCL 3.0 , SM_20 SUPPORT
   DEVICE_TYPE:              GPU
   GLOBAL MEM SIZE:          6134 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 64 ]
   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/anna/.cache/darktable/cached_v1_kernels_for_rusticlNV168_23211ubuntu31
   CL COMPILER OPTION:       -cl-fast-relaxed-math
     1.5749 [opencl_build_program] could not build program: CL_BUILD_PROGRAM_FAILURE
     1.5749 [dt_opencl_device_init] failed to compile program `bilateral.cl'!
[opencl_init] no suitable devices found.
[opencl_init] FINALLY: opencl is NOT AVAILABLE and NOT ENABLED.

I guess the problem is the fact that -cl-fast-relaxed-math is missing on Arch. How can it be added?

GPU Hardware is Nvidia GTX 1660 Super

Steps to reproduce

see above

Expected behavior

opencl should work

Logfile | Screenshot | Screencast

No response

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?

rolling

Describe your system?

see description

Are you using OpenCL GPU in darktable?

I dont know

If yes, what is the GPU card and driver?

Nvidia GTX 1660 Super + nouveau/mesa/rusticl

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

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions