Page 1 of 2

[SOLVED] NVIDIA CUDA/OpenCL

PostPosted: Nov 17th, '14, 12:20
by jmsarat
CUDA/OpenCL stopped working after the latest update 340.58-1.mga5.nonfree.

NeatImage detection log :
"Looking for NVIDIA CUDA-capable devices...
Failed to initialize CUDA driver.
If you use an NVIDIA card, please install the latest video driver with CUDA support."

Darktable :
Code: Select all
[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] found opencl runtime library 'libOpenCL'
[opencl_init] opencl library 'libOpenCL' found on your system and loaded
[opencl_init] could not get platforms: -1001
[opencl_init] FINALLY: opencl is NOT AVAILABLE on this system.

Re: NVIDIA CUDA/OpenCL

PostPosted: Nov 20th, '14, 15:02
by jmsarat
Finally I removed all the NVIDIA packages and re-installed everything using the NVIDIA installer : NVIDIA-Linux-x86_64-340.58.run .
Both Darktable and NeatImage are able to use OpenCl.

Re: NVIDIA CUDA/OpenCL

PostPosted: Nov 20th, '14, 17:32
by isadora
Please don't forget to mark the topic [SOLVED].
You can do so, by editing the subject/title in the first message in this topic.
Write [SOLVED] to the left of subject/title, thanks ahead. ;)

Re: NVIDIA CUDA/OpenCL

PostPosted: Nov 21st, '14, 13:21
by jmsarat
Not really solved as the Mageia packages don't work at least for the OpenCL part. I'll try the latest Mageia packages to check if it's solved.

Re: NVIDIA CUDA/OpenCL

PostPosted: Nov 22nd, '14, 16:56
by pete910
Did you install the nvidia-cuda-opencl package for the particular driver you was using?

There not installed by default same with AMD cards. They need to be selected !

Re: NVIDIA CUDA/OpenCL

PostPosted: Nov 25th, '14, 18:42
by jmsarat
I tried again with the latest NVIDIA driver for the last kernel (3.17.3-desktop-1.mga5) and nvidia-current-cuda-opencl 340.58. NeatImage and Darktable cannot use the GPU same messages as above. The only solution for now is to remove all the Mageia NVIDIA packages and reinstall using the NVIDIA installer.

Re: NVIDIA CUDA/OpenCL

PostPosted: Nov 25th, '14, 20:42
by doktor5000
Could you please show the output as root of
Code: Select all
journalctl -ab | grep -i -e cuda -e opencl

Re: NVIDIA CUDA/OpenCL

PostPosted: Nov 27th, '14, 15:52
by jmsarat
NeatImage and Darktable are perfectly running using OpenCl with the latest packages

nvidia-current-cuda-opencl VersionĀ : 340.58-1.mga5.nonfree
nvidia-current-kernel-3.17.4-desktop-1.mga5 VersionĀ : 340.58-3.mga5.nonfree

Thank you.

Re: [SOLVED] NVIDIA CUDA/OpenCL

PostPosted: Jan 11th, '15, 23:47
by morgano
Is OpenCL still working for you?
It (and CUDA) not work on my system; https://bugs.mageia.org/show_bug.cgi?id=14462
nvidia-current-kernel-3.18.1-desktop-4.mga5, x86_64, Version: 340.65-8.mga5

Re: [SOLVED] NVIDIA CUDA/OpenCL

PostPosted: Jan 12th, '15, 16:02
by jmsarat
I'm using nvidia-current-cuda-opencl 340.65-3.mga5 and nvidia-current-kernel-desktop 340.65-3.mga5 with kernel-3.18.1-desktop-4.mga5.
Darktable and Neatimage find OpenCL and run pefectly. I just have to create links for the cuda and opencl libs under /usr/lib64/ as Neatimage can't find the libs under /usr/lib64/nvidia-current/

Jean-Marc

Re: [SOLVED] NVIDIA CUDA/OpenCL

PostPosted: Jan 12th, '15, 17:47
by morgano
OK thanks.
That means the packages are not totally borked
Wonder whats up with my system?
I have never tried Neatimage
I tried making such links anyhow but it does not solve the problem for Blender, Darktable, or BOINC to find my GPU.

# cd /usr/lib64/
# ln -s nvidia-current/*cuda* .
# ln -s nvidia-current/*OpenCL* .
Sidenote: the files libOpenCL.so.1 and libOpenCL.so.1.0.0 already existed

Re: [SOLVED] NVIDIA CUDA/OpenCL

PostPosted: Jan 12th, '15, 18:26
by jmsarat
I had once this kind of problem and it was caused by multiple versions installed on my system, cleaning everything and reinstalling solved the problem.
You could try to remove all the cuda and nvidia packages (and the links you just created) and then install cuda and the kernel module using the original NVIDIA display driver. It worked for me months ago.
What do you get when starting darktable in a terminal with # darktable -d opencl ?

Jean-Marc

Re: NVIDIA CUDA/OpenCL

PostPosted: Jan 12th, '15, 20:10
by doktor5000
Apart from that, you never replied to
doktor5000 wrote:Could you please show the output as root of
Code: Select all
journalctl -ab | grep -i -e cuda -e opencl

Re: [SOLVED] NVIDIA CUDA/OpenCL

PostPosted: Jan 12th, '15, 21:26
by morgano
I already tried removing everything nvidia, cuda, opecl, while running noveau, then rebooted, reinstalled, rebooted.

Code: Select all
$ sudo journalctl -ab | grep -i -e cuda -e opencl
jan 11 22:08:33 svarten drakrpm[23048]: running: rpm -ql nvidia-current-cuda-opencl-340.65-3.mga5.nonfree.x86_64
jan 11 22:08:33 svarten drakrpm[23048]: running: rpm -q --qf '%{description}' nvidia-current-cuda-opencl-340.65-3.mga5.nonfree.x86_64
jan 11 22:08:33 svarten drakrpm[23048]: running: rpm -q --changelog nvidia-current-cuda-opencl-340.65-3.mga5.nonfree.x86_64


More info in my bug 14462 i linked above.

Now i also tried on another mga5 64bit system but which have AMD; HD 6850 Graphics, and i can not make that work either.
(it runs proprietary driver and I installed fglrx-opencl, rebooted.)

It feels like i am doing something wrong...
Maybe I should do something else than just installing respective opencl libs?
Do i have to enable GPU access somehow?
Is there some tests/diagnosis i can run?

Re: [SOLVED] NVIDIA CUDA/OpenCL

PostPosted: Jan 12th, '15, 21:28
by morgano
In the nvidia [GeForce GTX 760] mga5 system
Code: Select all
$ darktable -d opencl
[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] could not find opencl runtime library 'libOpenCL'
[opencl_init] could not find opencl runtime library 'libOpenCL.so'
[opencl_init] found opencl runtime library 'libOpenCL.so.1'
[opencl_init] opencl library 'libOpenCL.so.1' found on your system and loaded
[opencl_init] could not get platforms: -1001
[opencl_init] FINALLY: opencl is NOT AVAILABLE on this system.
[opencl_init] initial status of opencl enabled flag is OFF.


Last edited by isadora on Jan 12th, '15, 21:29, edited 1 time in total.
Reason: Command-output placed between [CODE]-tags, for better readability. ;)


OK thanks Isadora, I just feel that those clumsy blocks screem at me - but i should comply with local standards ;)

Re: [SOLVED] NVIDIA CUDA/OpenCL

PostPosted: Jan 12th, '15, 22:06
by morgano
Continuing using darktable to find problems
Searching the web on opencl and "could not get platforms: -1001", give http://askubuntu.com/questions/541114/h ... 89-drivers
where the answer tell about recent nvidia drivers need special modprobe rules, and go on making solution for debian/ubuntu (see links)
So maybe this is needed for some nvidia cards but not (or different need) for other cards...
I wonder how the status of this is on mageia
...
I found in one of the links:
This -1001 issue is usually because the vendor OpenCL library is not
found. But this is not the problem here as under strace I have seen
that the proper vendor library is searched and loaded. The relevant
lines are:

6633 open("/etc/OpenCL/vendors/nvidia.icd", O_RDONLY) = 5
...
6633 open("/usr/lib/x86_64-linux-gnu/libnvidia-opencl.so.331.67",
O_RDONLY|O_CLOEXEC) = 6
I get this:
Code: Select all
open("/etc/OpenCL/vendors/nvidia.icd", O_RDONLY) = 8
fstat(8, {st_mode=S_IFREG|0644, st_size=22, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fcf1301b000
fstat(8, {st_mode=S_IFREG|0644, st_size=22, ...}) = 0
lseek(8, 0, SEEK_SET)                   = 0
read(8, "libnvidia-opencl.so.1\n", 22)  = 22
lseek(8, 22, SEEK_SET)                  = 22
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 9
fstat(9, {st_mode=S_IFREG|0644, st_size=171529, ...}) = 0
mmap(NULL, 171529, PROT_READ, MAP_PRIVATE, 9, 0) = 0x7fcf12ff1000
close(9)                                = 0
open("/usr/lib64/nvidia-current/libnvidia-opencl.so.1", O_RDONLY|O_CLOEXEC) = 9
read(9, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360\"\21\0\0\0\0\0"..., 832) = 832
fstat(9, {st_mode=S_IFREG|0755, st_size=14127056, ...}) = 0
...(some mmap lines etc here)
close(9)                                = 0

I guess that mean it find the relevant libraries OK.

Maybe I should try this somehow...?
http://sourceforge.net/p/darktable/mail ... /32285148/

Re: [SOLVED] NVIDIA CUDA/OpenCL

PostPosted: Jan 12th, '15, 22:43
by isadora
morgano wrote:...
OK thanks Isadora, I just feel that those clumsy blocks screem at me - but i should comply with local standards ;)

No problem, i am very patient anyway. :D

Re: [SOLVED] NVIDIA CUDA/OpenCL

PostPosted: Jan 27th, '15, 20:54
by jmsarat
OpenCL stopped working with the latest NVIDIA update (346.35). I had the error : ERROR: could not insert 'nvidia_uvm': Invalid argument

I found this: https://bugs.debian.org/cgi-bin/bugrepo ... bug=746643.
I tried this :
# modprobe --force-modversion nvidia-uvm
now darktable and NeatImage work with OpenCL.

Re: [SOLVED] NVIDIA CUDA/OpenCL

PostPosted: Jan 28th, '15, 00:05
by doktor5000
Loading nvidia_uvm works fine here with latest updates, that is without --force-modversion

Re: [SOLVED] NVIDIA CUDA/OpenCL

PostPosted: Feb 19th, '15, 23:09
by bertaerts
I created a bugreport:
https://bugs.mageia.org/show_bug.cgi?id=15328

In short, when I create the nVIDIA rpm's myself, everything with CUDA and OpenCL works fine!
Details: see bugreport.

Re: [SOLVED] NVIDIA CUDA/OpenCL

PostPosted: Feb 24th, '15, 11:47
by morgano
Thanks for the investigation. Hope we will get working official packages.

UPDATE: I followed your instruction in the bug and now I too have CUDA and OpenCL, thank you :)

UPDATE2: it is a good idea to then put the line
Code: Select all
/nvidia-current/
in /etc/urpmi/skip.list so the locally built files do not get replaced by updates...

Re: [SOLVED] NVIDIA CUDA/OpenCL

PostPosted: Jun 6th, '15, 15:16
by morgano
This seems to be resolved for mageia 5 release; latest mageia packages works for me :)
https://bugs.mageia.org/show_bug.cgi?id=15328#c3

Re: [SOLVED] NVIDIA CUDA/OpenCL

PostPosted: Jan 15th, '16, 14:43
by morgano
Does it still work for you using latest mageia packages?
It seem to have broken for me (all BOINC GPUGRID workunits fails)
https://bugs.mageia.org/show_bug.cgi?id=15328#c4

Re: [SOLVED] NVIDIA CUDA/OpenCL

PostPosted: Jan 15th, '16, 15:53
by morgano
CUDA got solved for me by installing nvidia-cuda-toolkit that this system for some reason did not have anymore.
However i still do not have OpenCL anymore like i did before
More info see https://bugs.mageia.org/show_bug.cgi?id=15328#c7

Re: [SOLVED] NVIDIA CUDA/OpenCL

PostPosted: Jan 16th, '16, 13:56
by jmsarat
With the latest version : 346.96-1.mga5.nonfree NeatImage and darktable work perfectly. I had to create links from /usr/lib64/nvidia-current/ to /usr/lib64/ for libOpenCL.so.1.0.0, libOpenCL.so.1.0, libOpenCL.so.1, libOpenCL.so and libcuda.so.1, libcuda.so for NeatImage to find the GPU.