Project

General

Profile

Bug #10101

OpenCL and dual cards Intel & AMD -> crash

Added by Sławomir Mikuła almost 5 years ago. Updated almost 5 years ago.

Status:
Triaged
Priority:
Low
Assignee:
-
Category:
General
Start date:
09/06/2014
Due date:
% Done:

20%

Affected Version:
git development version
System:
Ubuntu
bitness:
64-bit
hardware architecture:
amd64/x86

Description

Using Darktable 1.5+1767~g51a51b3 but it affects also current stable version. I have dell e6440 with dual cards: integrated intel 4600 and AMD 8790. When I am switched to AMD discrete graphics card darktable works OK, but when I switch to intel card darktable cannot be started unless I set --disable-opencl. It would be great if darktable could automatically detect if system is currently running on intel card and disables opencl on start (even when opencl flag is set to ON).

Debug output:

[opencl_init] opencl related configuration options:
[opencl_init]
[opencl_init] opencl: 1
[opencl_init] opencl_library: ''
[opencl_init] opencl_memory_requirement: 768
[opencl_init] opencl_memory_headroom: 300
[opencl_init] opencl_device_priority: '*/!0,*/*/*'
[opencl_init] opencl_size_roundup: 16
[opencl_init] opencl_async_pixelpipe: 0
[opencl_init] opencl_synch_cache: 0
[opencl_init] opencl_number_event_handles: 25
[opencl_init] opencl_micro_nap: 1000
[opencl_init] opencl_use_pinned_memory: 0
[opencl_init] opencl_use_cpu_devices: 0
[opencl_init] opencl_avoid_atomics: 0
[opencl_init] opencl_omit_whitebalance: 0
[opencl_init]
[opencl_init] trying to load opencl library: '<system default>'
[opencl_init] opencl library 'libOpenCL' found on your system and loaded
Setting of real/effective user Id to 0/0 failed
modprobe: ERROR: could not insert 'fglrx': Operation not permitted
Error! Fail to load fglrx kernel module! Maybe you can switch to root user to load kernel module directly
Setting of real/effective user Id to 0/0 failed
modprobe: ERROR: could not insert 'fglrx': Operation not permitted
Error! Fail to load fglrx kernel module! Maybe you can switch to root user to load kernel module directly
Could not attach to process. If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user. For more details, see /etc/sysctl.d/10-ptrace.conf
ptrace: Operacja niedozwolona.

dt-bg-cl.txt Magnifier (6.8 KB) Pascal de Bruijn, 09/10/2014 08:11 PM

History

#1 Updated by Pascal de Bruijn almost 5 years ago

  • Status changed from New to Closed: invalid

The error messages you see, are not from darktable. Darktable does not try to insert the fglrx module. This is likely just AMD's OpenCL driver being broken. Please report this to AMD.

#2 Updated by Pascal de Bruijn almost 5 years ago

  • % Done changed from 0 to 20
  • Status changed from Closed: invalid to Triaged
  • Target version set to Candidate for next major release

Actually, I might have jumped the gun on this one.

I just briefly tested Beignet (Intel Open Source OpenCL) on a non-OpenCL-capable system (also no weird dual card setup), where darktable fails to start as well.

Keeping in mind that Beignet is still experimental, it might just be a bug in Beignet as well. That said, I did have the following patch applied to beignet-0.9.2:

http://cgit.freedesktop.org/beignet/commit/?id=2cbeeba1994c2d196770115b7033a6e66d904d00

So taking a further look at our OpenCL initialization code might be warranted.

#3 Updated by Ulrich Pegelow almost 5 years ago

I'm not sure if checking specific conditions of all kinds of dual graphics card setup within darktable makes a lot of sense. In fact most likely this is not even possible within an application as the error message seems to occur already early when activating the opencl system library.

The behavior of that library is determined by the files it finds in /etc/OpenCL/vendors. OpenCL tries to activate all devices it finds there and in the case of your AMD device this involves loading the fglrx kernel module (which fails as a non-root user).

I see two possibilities for you. You either make sure that the fglrx module gets loaded at system boot regardless if you are using the AMD as your graphics card or not. Or you generate some kind of mechanism that deactivates/renames the amdocl64.icd file in /etc/OpenCL/vendors as long as you are running on the integradted graphics card.

#4 Updated by Pascal de Bruijn almost 5 years ago

That Beignet commit shows that there presumably may be a graceful way to handle non-operational OpenCL drivers, which may become commonplace in Linux, as Beignet doesn't have licensing issues which prevent it from being preinstalled by default on distros of the future.

When I installed Beignet 0.9.2 with that above patch applied on non-OpenCL-capable Intel hardware, I get a crash in Darktable, I have attached a backtrace.

#5 Updated by Sławomir Mikuła almost 5 years ago

Additional to my report:
- on intel card running darktable via sudo is possible. When i run it via sudo darktable starts normally.
- when i look at loaded modules i have:

xxxx@dell-6440:~$ lsmod | grep fgl
fglrx                8085343  0 
amd_iommu_v2           19054  1 fglrx

- next i can run darktable with normal user privileges and everything works correctly (opencl support in darktable config is disabled)

Also available in: Atom PDF