Darktable thumbnail display issue Linux Mint 20 Cinnamon - GeForce 210 (340.108)

As you can see in the attached screenshot, some Darktable thumbnails get a corrupt display (black squares).

I raised the issue with the Darktable development team, but couldn’t yet get a fix or usable workaround. (github.com/darktable-org issues 6440)

To summarize the issue :

  • The issue started when reimporting my pictures library (>60K pictures) in DT 3.2.1 on my newly rebuilt Linux Mint 20 Cinnamon. (I used to run on LM 19.3 before on exactly the same hardware; with no issue.)
  • Deleting again the Darktable pictures database and re-importing the pics from scratch doesn’t help.
  • “Dummy” editing the affected pictures or compressing the history stack doesn’t fix the thumbnails.
  • Upgrading to recent DT 3.4.0 didn’t fix the issue.
  • Issue is likely to occur more frequently on pictures processed with specific modules (basic adjustments and/or local contrast module). The issue doesn’t occur on pictures not processed (manually).
  • The issue does not occur when importing the same affected pictures (with their xmp files) on my Windows 10 PC with DT 3.4.0 (HP Elitebook (with no openCL feature))

Workarounds :
After a lot of investigation, disabling OpenCL in DT seems to fix the issue (but slow downs the image processing)

I suspect a GeForce driver issue on LM 20 is causing this issue.

Do you have any hint to fix this issue ? Thanks for your help.

This is my GeForce config :
±-----------------------------------------------------+
| NVIDIA-SMI 340.108 Driver Version: 340.108 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce 210 Off | 0000:01:00.0 N/A | N/A |
| N/A 56C P0 N/A / N/A | 327MiB / 1023MiB | N/A Default |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Compute processes: GPU Memory |
| GPU PID Process name Usage |
|=============================================================================|
| 0 Not Supported |
±----------------------------------------------------------------------------+

This is my config :
System: Kernel: 5.4.0-59-generic x86_64 bits: 64 compiler: gcc v: 9.3.0 Desktop: Cinnamon 4.6.7
wm: muffin dm: GDM3, LightDM Distro: Linux Mint 20 Ulyana base: Ubuntu 20.04 focal
Machine: Type: Desktop System: Dell product: OptiPlex 780 v: N/A serial: Chassis:
type: 15 serial:
Mobo: Dell model: 03NVJ6 v: A01 serial: BIOS: Dell v: A03 date: 02/13/2010
CPU: Topology: Dual Core model: Intel Core2 Duo E7500 bits: 64 type: MCP arch: Penryn rev: A
L2 cache: 3072 KiB
flags: lm nx pae sse sse2 sse3 sse4_1 ssse3 vmx bogomips: 11703
Speed: 2281 MHz min/max: N/A Core speeds (MHz): 1: 2281 2: 2504
Graphics: Device-1: NVIDIA GT218 [GeForce 210] vendor: ASUSTeK driver: nvidia v: 340.108
bus ID: 01:00.0 chip ID: 10de:0a65
Display: x11 server: X.Org 1.20.8 driver: nvidia
unloaded: fbdev,modesetting,nouveau,vesa resolution: 1920x1080~60Hz
OpenGL: renderer: GeForce 210/PCIe/SSE2 v: 3.3.0 NVIDIA 340.108 direct render: Yes
Audio: Device-1: Intel 82801JD/DO HD Audio vendor: Dell driver: snd_hda_intel v: kernel
bus ID: 00:1b.0 chip ID: 8086:3a6e
Device-2: NVIDIA High Definition Audio vendor: ASUSTeK driver: snd_hda_intel v: kernel
bus ID: 01:00.1 chip ID: 10de:0be3
Device-3: Plantronics Plantronics .Audio 478 USB type: USB
driver: plantronics,snd-usb-audio,usbhid bus ID: 6-2:2 chip ID: 047f:c011
Device-4: Logitech Webcam C300 type: USB driver: snd-usb-audio,uvcvideo bus ID: 1-3:4
chip ID: 046d:0805
Sound Server: ALSA v: k5.4.0-59-generic
Network: Device-1: Intel 82567LM-3 Gigabit Network vendor: Dell driver: e1000e v: 3.2.6-k
port: ece0 bus ID: 00:19.0 chip ID: 8086:10de
IF: enp0s25 state: up speed: 1000 Mbps duplex: full mac:
Drives: Local Storage: total: 298.09 GiB used: 181.44 GiB (60.9%)
ID-1: /dev/sda vendor: Western Digital model: WD3200AAKS-75L9A0 size: 298.09 GiB
speed: 3.0 Gb/s serial:
RAID: Hardware-1: Intel SATA Controller [RAID mode] driver: ahci v: 3.0 bus ID: 00:1f.2
chip ID: 8086.2822
Partition: ID-1: / size: 287.12 GiB used: 181.44 GiB (63.2%) fs: ext4 dev: /dev/sda6
Sensors: System Temperatures: cpu: 37.0 C mobo: N/A gpu: nvidia temp: 56 C
Fan Speeds (RPM): N/A

Please post the output of clinfo

Blockquote
Number of platforms 1
Platform Name NVIDIA CUDA
Platform Vendor NVIDIA Corporation
Platform Version OpenCL 1.1 CUDA 6.5.51
Platform Profile FULL_PROFILE
Platform Extensions cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_copy_opts
Platform Extensions function suffix NV

Platform Name NVIDIA CUDA
Number of devices 1
Device Name GeForce 210
Device Vendor NVIDIA Corporation
Device Vendor ID 0x10de
Device Version OpenCL 1.0 CUDA
Driver Version 340.108
Device OpenCL C Version OpenCL C 1.1
Device Type GPU
Device Topology (NV) PCI-E, 01:00.0
Device Profile FULL_PROFILE
Device Available Yes
Compiler Available Yes
Max compute units 2
Max clock frequency 1402MHz
Compute Capability (NV) 1.2
Max work item dimensions 3
Max work item sizes 512x512x64
Max work group size 512
Preferred work group size multiple 32
Warp size (NV) 32
Preferred / native vector sizes
char 1 / 1
short 1 / 1
int 1 / 1
long 1 / 1
half 0 / 0 (n/a)
float 1 / 1
double 0 / 0 (n/a)
Half-precision Floating-point support (n/a)
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 No
Double-precision Floating-point support (n/a)
Address bits 32, Little-Endian
Global memory size 1073414144 (1024MiB)
Error Correction support No
Max memory allocation 268353536 (255.9MiB)
Unified memory for Host and Device No
Integrated memory (NV) No
Minimum alignment for any data type 128 bytes
Alignment of base address 2048 bits (256 bytes)
Global Memory cache type None
Image support Yes
Max number of samplers per kernel 16
Max 2D image size 4096x16383 pixels
Max 3D image size 2048x2048x2048 pixels
Max number of read image args 128
Max number of write image args 8
Local memory type Local
Local memory size 16384 (16KiB)
Registers per block (NV) 16384
Max number of constant args 9
Max constant buffer size 65536 (64KiB)
Max size of kernel argument 4352 (4.25KiB)
Queue properties
Out-of-order execution Yes
Profiling Yes
Profiling timer resolution 1000ns
Execution capabilities
Run OpenCL kernels Yes
Run native kernels No
Kernel execution timeout (NV) Yes
Concurrent copy and kernel execution (NV) Yes
Number of async copy engines 1
Device Extensions cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_copy_opts cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics

NULL platform behavior
clGetPlatformInfo(NULL, CL_PLATFORM_NAME, …) NVIDIA CUDA
clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, …) Success [NV]
clCreateContext(NULL, …) [default] Success [NV]
clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT) No platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU) No platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM) Invalid device type for platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL) No platform

ICD loader properties
ICD loader Name OpenCL ICD Loader
ICD loader Vendor OCL Icd free software
ICD loader Version 2.2.11
ICD loader Profile OpenCL 2.1

Looks fine. The only issue i see is that you’re using a very old geforce 210 with the legacy 340 driver which has been out of support for a year now. So it’s exactly the same driver you used in your previous install.
Only issues I can think of are

Thanks a lot for your analysis.

I’ll share your input with the DT development team, maybe this rings a bell with them.

Your hint fixed the issue !
DT team has increased opencl_memory_headroom`from 300MB to 400MB on Wed Dec 18 2019. Setting it back to 300 fixed (the issue (on my config.)

In my case it means, as my issues didn’t start with DT upgrade, but started when upgrading from LM 19.3 to LM 20, the memory demand of my GPU increased with LM 20.

Do you have any info or confirmation on this LM 20 ?

No, but it’s very common that newer window managers increase vmem usage (very slightly) due to added features. Your gt210 only has 1GB vmem so it’s really on the edge when driving the desktop and running opencl for DT at the same time.

Could you explain what proposed Linux Mint update (“transitional package for nvidia-opencl-icd-340”) covers ?
Is it safe to install it ? (I guess it is.)

It’s needed for the 5.8 kernel which is currently rolled out for Ubuntu 20.04.

Great, thanks !