Project

General

Profile

Bug #11599

[opencl_init] could not create context for device 0: 999

Added by Roland Schuller almost 2 years ago. Updated over 1 year ago.

Status:
Closed: upstream
Priority:
Low
Assignee:
-
Category:
OpenCL
Target version:
Start date:
05/03/2017
Due date:
% Done:

0%

Affected Version:
git master branch
System:
Ubuntu
bitness:
64-bit
hardware architecture:
amd64/x86

Description

After update of Ubuntu 17.04 and Nvidia-381 i no longer have Open-CL

Log:
[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_mandatory_timeout: 200
[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_enable_markesteijn: 1
[opencl_init]
[opencl_init] found opencl runtime library 'libOpenCL'
[opencl_init] opencl library 'libOpenCL' found on your system and loaded
[opencl_init] found 2 platforms
[opencl_init] could not get device id size: -1
[opencl_init] found 1 device
[opencl_init] device 0 `GeForce GTX 970' has sm_20 support.
[opencl_init] device 0 `GeForce GTX 970' supports image sizes of 16384 x 16384
[opencl_init] device 0 `GeForce GTX 970' allows GPU memory allocations of up to 1008MB
[opencl_init] device 0: GeForce GTX 970
GLOBAL_MEM_SIZE: 4034MB
MAX_WORK_GROUP_SIZE: 1024
MAX_WORK_ITEM_DIMENSIONS: 3
MAX_WORK_ITEM_SIZES: [ 1024 1024 64 ]
DRIVER_VERSION: 381.09
DEVICE_VERSION: OpenCL 1.2 CUDA
[opencl_init] could not create context for device 0: 999
[opencl_init] FINALLY: opencl is NOT AVAILABLE on this system.
[opencl_init] initial status of opencl enabled flag is OFF.

History

#1 Updated by Ulrich Pegelow almost 2 years ago

  • Status changed from New to Closed: upstream

It's more than likely that this issue is not a darktable bug but a problem in the OpenCL implementation of your system. You won't have any chance to fix it by opening a ticket here. I suggest you contact other users at to share experience and get help.

#2 Updated by Roman Lebedev almost 2 years ago

  • Target version changed from Candidate for next patch release to 2.4.0

#3 Updated by MichaƂ Machowski almost 2 years ago

Roland Schuller wrote:

After update of Ubuntu 17.04 and Nvidia-381 i no longer have Open-CL

Similar issue here - Mint 18.1 and Nvidia-378

Darktable runs just fine with OpenCL when launched by root.
Non-root user causes errors though:

[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_enable_markesteijn: 1
[opencl_init]
[opencl_init] found opencl runtime library 'libOpenCL'
[opencl_init] opencl library 'libOpenCL' found on your system and loaded
[opencl_init] found 1 platform
[opencl_init] found 1 device
[opencl_init] device 0 `GeForce GTX 960M' has sm_20 support.
[opencl_init] device 0 `GeForce GTX 960M' supports image sizes of 16384 x 16384
[opencl_init] device 0 `GeForce GTX 960M' allows GPU memory allocations of up to 1011MB
[opencl_init] device 0: GeForce GTX 960M
GLOBAL_MEM_SIZE: 4044MB
MAX_WORK_GROUP_SIZE: 1024
MAX_WORK_ITEM_DIMENSIONS: 3
MAX_WORK_ITEM_SIZES: [ 1024 1024 64 ]
DRIVER_VERSION: 378.13
DEVICE_VERSION: OpenCL 1.2 CUDA
[opencl_init] could not create context for device 0: 999
[opencl_init] FINALLY: opencl is NOT AVAILABLE on this system.
[opencl_init] initial status of opencl enabled flag is OFF.

#4 Updated by Tomas Sobek over 1 year ago

I think I found a solution. I am running Mint 18 and my NVidia drivers recently updated from version 375 to 384. This broke OpenCL in Darktable and the error message was identical:

[opencl_init] could not create context for device 0: 999

I noticed that if I ran Darktable as root then OpenCL would work fine. So I experimented a bit more with following commands:

darktable-cltest
sudo darktable-cltest
strace darktable-cltest >output.txt 2>&1

The strace produces a lot of text, hence I piped it into the text file. In the text file I searched for the error line and then scrolled up until I found following:

open("/home/myusername/.nv/ComputeCache/index", O_RDWR) = -1 EACCES (Permission denied)
open("/home/myusername/.nv/ComputeCache/index", O_RDWR|O_CREAT|O_TRUNC, 0666) = -1 EACCES (Permission denied)

Since for root user this was working fine, I checked permissions on that file:

$ ll /home/myusername/.nv/ComputeCache/index
ls: cannot access '/home/myusername/.nv/ComputeCache/index': Permission denied

After some further checking I set permissions on the whole subtree to be owned by my username:

cd /home/myusername/.nv
sudo chown -R myusername:myusername ComputeCache

This seems to have fixed the issue for me.

#5 Updated by Tomas Kijas over 1 year ago

Hi (Zdarec), I realised, after fiddling with CUDA, that on my PC I have same error (https://redmine.darktable.org/issues/11840) on GTX 750, but the solution does not work. Probably we can reopen this bug report?

Also available in: Atom PDF