darktable's OpenCL using Nvidia's while on Intel GPU

prime
opencl

(Eduardo Battaglia) #1

Hi!
I recently bought an Acer Swift3 with 8 gen Intel CPU + Nvidia MX150 GPU. I went for the Nvidia card specially for darktable OpenCL.
I’m on Ubuntu 18.10 using darktable 2.6

I found out that when I was on the Intel card, darktable was using OpenCL too.
So I test the capabilities of both Intel and Nvidia OpenCL using

time darktable input output

and saw both times where nearly identical -around 2 seconds-. I said to myself that I have paid for an Nvidia card when clearly I don’t need it.

Then i checked

darktable-cltest

and the result was

So clearly I’m using the Nvidia’s OpenCL when using Intel’s card.
I’ve checked with prime-select, nvidia-settings and Ubuntu “About” inside settings. I’ve also rebooted several times, with and without AC power.

So, does this means that I don’t have to prime-select switch anymore when I’m about to edit my photos? That would be fantastic.

PS: Hope I did myself clear, english is not my first language.


(Mica) #2

FYI: Intel’s opencl driver is horrible and I think it is blacklisted.


(Eduardo Battaglia) #3

Yep, that’s what I’ve read.
One more thing that makes me think that it’s using Nvidia’s CUDA cores while on Intel GPU.


(Mica) #4

Your log seems to indicate that you are indeed using the nvidia card!


(Eduardo Battaglia) #5

When using Intel:

Captura%20de%20pantalla%20de%202019-02-11%2010-24-33

And when using Nvidia:

Captura%20de%20pantalla%20de%202019-02-11%2010-36-10

Something’s fishy, I just realized when coming back from suspend mode, OpenCL is not available when I’m using Intel GPU


(Chris E) #6

The arch linux wiki mentions possible issues after suspend - resolved by registering the kernel module with ACPI. See the following https://wiki.archlinux.org/index.php/NVIDIA/Troubleshooting#Poor_performance_after_resuming_from_suspend


(Alessandro Amato Del Monte (Aadm)) #7

What’s happening on your system is really strange. I have a similar situation, i.e. laptop with both integrated intel graphics and external nvidia card (it’s a Dell XPS 15 9560 i7-7700HQ@2.8Ghz Kabylake, the internal gpu is an Intel HD630 and then there’s the Geforce GTX1050).

But there’s no way I can use OpenCL if I’m using the prime profile Intel!

This is now, Intel GPU active, look at the result of darktable-cltest:

$ darktable-cltest 
0.086798 [opencl_init] opencl related configuration options:
0.086834 [opencl_init] 
0.086845 [opencl_init] opencl: 1
0.086859 [opencl_init] opencl_library: ''
0.086875 [opencl_init] opencl_memory_requirement: 768
0.086905 [opencl_init] opencl_memory_headroom: 300
0.086919 [opencl_init] opencl_device_priority: '*/!0,*/*/*'
0.086934 [opencl_init] opencl_mandatory_timeout: 200
0.086947 [opencl_init] opencl_size_roundup: 16
0.086960 [opencl_init] opencl_async_pixelpipe: 0
0.086973 [opencl_init] opencl_synch_cache: 0
0.086989 [opencl_init] opencl_number_event_handles: 25
0.087003 [opencl_init] opencl_micro_nap: 1000
0.087015 [opencl_init] opencl_use_pinned_memory: 0
0.087027 [opencl_init] opencl_use_cpu_devices: 0
0.087039 [opencl_init] opencl_avoid_atomics: 0
0.087050 [opencl_init] 
0.087477 [opencl_init] could not find opencl runtime library 'libOpenCL'
0.087643 [opencl_init] could not find opencl runtime library 'libOpenCL.so'
0.088052 [opencl_init] found opencl runtime library 'libOpenCL.so.1'
0.088120 [opencl_init] opencl library 'libOpenCL.so.1' found on your system and loaded
0.094027 [opencl_init] could not get platforms: -1001
0.094052 [opencl_init] FINALLY: opencl is NOT AVAILABLE on this system.
0.094060 [opencl_init] initial status of opencl enabled flag is OFF.

Now, it would be really great if I could be running Intel GPU all the time (laptop is less hungry, less noisy, etc) and then still launch Darktable with openCL support whenever I’m working on photos.

About the gpu not being recognized after waking up from sleep, try this:

$ sudo rmmod nvidia_uvm; sudo modprobe nvidia_uvm'

I have the above command set as an alias: alias startgpu='sudo rmmod nvidia_uvm; sudo modprobe nvidia_uvm'

For another discussion on darktable and opencl (and the settings to use), check this discussion: https://discuss.pixls.us/t/darktable-core-options-for-i7-16gb-ram-etc/10354


(Eduardo Battaglia) #8

Thanks for the commands @aadm

Indeed, after more tests, everything seems to indicate that that’s the case.