Ubuntu Gnome 14.04 - NVidia 331 - OpenCL broken (using Darktable)

Bug #1311362 reported by The Bright Side
72
This bug affects 15 people
Affects Status Importance Assigned to Milestone
xorg (Ubuntu)
Confirmed
High
Unassigned

Bug Description

** Steps to Reproduce: **
1. Perform a fresh installation of Ubuntu Gnome 14.04 64-bit on a clean PC
2. Using the "Additional Drivers" application, install latest NVidia driver (331)
3. Reboot
4. Install latest Darktable (1.4) from Ubuntu's repositories
5. In Terminal, run "darktable -d opencl"

** Actual Result: **
In Ubuntu Gnome 14.04, using the NVidia 331 driver, Darktable won't run with OpenCL support. The following debug output is observed in the terminal:

[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] could not find opencl runtime library 'libOpenCL'
[opencl_init] no working opencl library found. Continue with opencl disabled
[opencl_init] FINALLY: opencl is NOT AVAILABLE on this system.
[opencl_init] initial status of opencl enabled flag is OFF.
[pixelpipe_process] [thumbnail] using device -1
[pixelpipe_process] [thumbnail] using device -1

** Expected Result: **
Software using OpenCL should continue to work as it did in Ubuntu 13.10.

** Notes: **
Graphics card: GeForce GTX 680 (Gigabyte GV-N680OC-2GD)
Encuontered on Ubuntu Gnome 14.04, 64 bit.
Likely occurs on regular Ubuntu (not Ubuntu Gnome) as well.
This issue also occurs when running NVidia 331 Update, NVidia Legacy 304 as well as Nouveau.
This issue did not occur on Ubuntu Gnome 13.10.
Bug filed in Darktable: http://www.darktable.org/redmine/issues/9913#change-24936

** Troubleshooting: **
The following files and directories relating to OpenCL were found on the test system:

locate -i libopencl
/usr/lib/i386-linux-gnu/libOpenCL.so.1
/usr/lib/i386-linux-gnu/libOpenCL.so.1.0
/usr/lib/i386-linux-gnu/libOpenCL.so.1.0.0
/usr/lib/x86_64-linux-gnu/libOpenCL.so.1
/usr/lib/x86_64-linux-gnu/libOpenCL.so.1.0
/usr/lib/x86_64-linux-gnu/libOpenCL.so.1.0.0
/usr/share/doc/nvidia-libopencl1-331
/usr/share/doc/nvidia-libopencl1-331/changelog.Debian.gz
/usr/share/doc/nvidia-libopencl1-331/copyright
/var/cache/apt/archives/nvidia-libopencl1-331_331.38-0ubuntu7_amd64.deb
/var/lib/dpkg/info/nvidia-libopencl1-331.list
/var/lib/dpkg/info/nvidia-libopencl1-331.md5sums
/var/lib/dpkg/info/nvidia-libopencl1-331.postinst
/var/lib/dpkg/info/nvidia-libopencl1-331.postrm
/var/lib/dpkg/info/nvidia-libopencl1-331.shlibs

installed the packages "opencl-headers" and "nvidia-profiler", but that made no difference.
Manually edited /etc/ld.so.conf to include the directories found containing the OpenCL libraries (from the list above). Ran ldconfig. No difference.

Output of clinfo:

clinfo: /usr/lib/x86_64-linux-gnu/libOpenCL.so.1: no version information available (required by clinfo)
E: -30

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: xorg 1:7.7+1ubuntu8
ProcVersionSignature: Ubuntu 3.13.0-24.46-generic 3.13.9
Uname: Linux 3.13.0-24-generic x86_64
NonfreeKernelModules: nvidia
.proc.driver.nvidia.gpus.0: Error: [Errno 21] Is a directory: '/proc/driver/nvidia/gpus/0'
.proc.driver.nvidia.registry: Binary: ""
.proc.driver.nvidia.version:
 NVRM version: NVIDIA UNIX x86_64 Kernel Module 331.38 Wed Jan 8 19:32:30 PST 2014
 GCC version: gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
ApportVersion: 2.14.1-0ubuntu3
Architecture: amd64
CompizPlugins: No value set for `/apps/compiz-1/general/screen0/options/active_plugins'
CompositorRunning: None
CurrentDesktop: GNOME
Date: Tue Apr 22 17:59:29 2014
DistUpgraded: Fresh install
DistroCodename: trusty
DistroVariant: ubuntu
DkmsStatus:
 bbswitch, 0.7, 3.13.0-24-generic, x86_64: installed
 nvidia-331-updates, 331.38, 3.13.0-24-generic, x86_64: installed
ExtraDebuggingInterest: Yes, if not too technical
GraphicsCard:
 NVIDIA Corporation GK104 [GeForce GTX 680] [10de:1180] (rev a1) (prog-if 00 [VGA controller])
   Subsystem: Gigabyte Technology Co., Ltd Device [1458:353c]
InstallationDate: Installed on 2014-04-20 (2 days ago)
InstallationMedia: Ubuntu-GNOME 14.04 LTS "Trusty Tahr" - Release amd64 (20140416.2)
MachineType: To Be Filled By O.E.M. To Be Filled By O.E.M.
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.13.0-24-generic root=UUID=c651e8be-8145-4f89-9f68-919286e646bb ro quiet splash
SourcePackage: xorg
Symptom: display
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 05/20/2010
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 080015
dmi.board.name: JW-A870T-UC3
dmi.board.vendor: JW Technology
dmi.board.version: V1.0
dmi.chassis.asset.tag: To Be Filled By O.E.M.
dmi.chassis.type: 3
dmi.chassis.vendor: To Be Filled By O.E.M.
dmi.chassis.version: To Be Filled By O.E.M.
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr080015:bd05/20/2010:svnToBeFilledByO.E.M.:pnToBeFilledByO.E.M.:pvrToBeFilledByO.E.M.:rvnJWTechnology:rnJW-A870T-UC3:rvrV1.0:cvnToBeFilledByO.E.M.:ct3:cvrToBeFilledByO.E.M.:
dmi.product.name: To Be Filled By O.E.M.
dmi.product.version: To Be Filled By O.E.M.
dmi.sys.vendor: To Be Filled By O.E.M.
version.compiz: compiz N/A
version.ia32-libs: ia32-libs N/A
version.libdrm2: libdrm2 2.4.52-1
version.libgl1-mesa-dri: libgl1-mesa-dri 10.1.0-4ubuntu5
version.libgl1-mesa-dri-experimental: libgl1-mesa-dri-experimental N/A
version.libgl1-mesa-glx: libgl1-mesa-glx 10.1.0-4ubuntu5
version.nvidia-graphics-drivers: nvidia-graphics-drivers N/A
version.xserver-xorg-core: xserver-xorg-core 2:1.15.1-0ubuntu2
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev 1:2.8.2-1ubuntu2
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:7.3.0-1ubuntu3
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.99.910-0ubuntu1
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:1.0.10-1ubuntu2
xserver.bootTime: Tue Apr 22 17:30:17 2014
xserver.configfile: default
xserver.errors: open /dev/fb0: No such file or directory
xserver.logfile: /var/log/Xorg.0.log
xserver.outputs:

xserver.version: 2:1.15.1-0ubuntu2

Revision history for this message
The Bright Side (me-knowingme) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xorg (Ubuntu):
status: New → Confirmed
Revision history for this message
Porcelain Mouse (pmouse) wrote :

Thanks for reporting this The Bright Side, but this issue is much bigger than darktable.

The fact that clinfo gives a weird error is a good indicator that this is a very general problem, not related to any user-land programs. The reason I found it (again, thanks) was that I have a problem with boinc-client. As soon as I upgraded to 14.04, boinc-client stopped being able to detect any OpenCL resources.

This is an OpenCL driver problem with the nVidia drivers.

I think this is link is relevent, which says to install nVidia drivers manually:

https://devtalk.nvidia.com/default/topic/734098/linux/-boinc-ubuntu-nvidia-no-usable-gpus-found-/

I'm just trying to figure out if that is worth doing or if Ubuntu folks are going to fix it soon.

Revision history for this message
Hannu E K N (hannu-n) wrote :

I think this is something that is unrelated to nvidia and/or darktable - I had updates of "lib-mesa" on 2014-07-10 (Thursday) and believe I didn't run darktable much yesterday (Friday).

It seems as darktable at least gets a bit further, with "opencl_library=libnvidia-opencl.so.1" in "~/.config/darktable/darktablerc"

$ darktable -d opencl
[opencl_init] opencl related configuration options:
[opencl_init]
[opencl_init] opencl: 1
[opencl_init] opencl_library: 'libnvidia-opencl.so.1'
[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: 'libnvidia-opencl.so.1'
[opencl_init] could not load all required symbols from library
[opencl_init] no working opencl library found. Continue with opencl disabled
[opencl_init] FINALLY: opencl is NOT AVAILABLE on this system.
[opencl_init] initial status of opencl enabled flag is OFF.

...

Revision history for this message
Hannu E K N (hannu-n) wrote :

For what it is worth: I have pulled out nvidia-340 (xorg-edgers) and am now down to 331.89 and settings from -340 - makes no difference.

"opencl_library=libnvidia-opencl.so.331.89"
in "~/.config/darktable/darktablerc"

$ darktable -d opencl
[opencl_init] opencl related configuration options:
[opencl_init]
[opencl_init] opencl: 1
[opencl_init] opencl_library: 'libnvidia-opencl.so.331.89'
[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: 'libnvidia-opencl.so.331.89'
[opencl_init] could not load all required symbols from library
[opencl_init] no working opencl library found. Continue with opencl disabled
[opencl_init] FINALLY: opencl is NOT AVAILABLE on this system.
[opencl_init] initial status of opencl enabled flag is OFF.

Revision history for this message
Hannu E K N (hannu-n) wrote :

For what it is worth - I have been through **almost** all of v304 (nvidia-current from USC) to latest xorg-edgers - in the end, here is the only currently working option for me, pseudo-code;

purge-ppa ppa:xorg-edgers # purged the mesa libraries mentioned above among other things.
apt-get purge nvidia* nvidia-opencl* nvidia-libopencl* libcuda1*
sh NVIDIA-Linux-x86_64-340.17.run

dkms registration of modules -> "not necessary"
gcc 4.6 used for driver, gcc 4.8 on system -> CC check ignored.

Now:
$ dpkg --list | grep -E '^ii.*(nvidia|cuda)'
displays 'ii nvidia-settings 331.20-0ubuntu8'

Driver from http://www.geforce.co.uk/search/search-results?search=linux%20x64%20340.17%20-freebsd%20-solaris

Revision history for this message
Tom Richart (tom-richart-spam) wrote :

I am running ubuntu 14.04 64 bit and nvidia drivers 331.38 and had the same problem of OpenCL not being available in Darktable.

This got fixed for me by a solution proposed to fix another OpenCL issue here:
http://askubuntu.com/questions/449507/nvidia-libopencl1-331-has-to-be-removed-before-installing-wine?rq=1

What I did was:

sudo apt-get install nvidia-cuda-toolkit

and then

sudo apt-get install ocl-icd-opencl-dev

After a reboot, Darktable's "activate OpenCL support" is not greyed out anymore and seems to work like it should.

Revision history for this message
The Bright Side (me-knowingme) wrote :

Thanks for all your comments! I will definitely take note of yours, Richard, for the next time I reinstall Ubuntu (14.10), provided the issue still occurs.

For 14.04, I fixed the problem with a symlink as described here:
http://www.dzhang.com/blog/2014/03/20/darktable-and-nvidia-opencl-on-fedora

Revision history for this message
The Bright Side (me-knowingme) wrote :

*Correction: "yours, Tom"!

Revision history for this message
Stephen Waters (debian-luy) wrote :

boinc-client works now when I do:

apt-get remove ocl-icd-libopencl1

apt-get install nvidia-libopencl1-343

apt-get install ocl-icd-libopencl1 (this will remove nvidia-libopencl1-343, but it works)

I think some configuration or detritus from "nvidia-libopencl1-343" gets left behind such that ocl-icd-libopencl1 can use it.

Changed in xorg (Ubuntu):
importance: Undecided → High
Revision history for this message
ML (0cs935kb517wwmwa7m9428daadkye-m9u2-wz6bkyhu4uqpfausw0ege9b0y33eg) wrote :

Something new here?

Revision history for this message
The Bright Side (me-knowingme) wrote :

For Darktable, I'm pretty sure all you'll need to do is install the nvidia-modprobe package after you activate the Nvidia drivers. It'll then work without any further ado. Let me know if that does the trick for you - it's been working for me over the past 3 Ubuntu releases, across 3 PCs.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.