6

On 16.04, OpenCL worked with my Nvidia 840M running the latest Nvidia drivers in the Ubuntu repos.

I've done a fresh install for 18.04, however using the 390 Nvidia drivers from the Ubuntu repos (not from any PPA). Now none of my OpenCL compatible applications are able to use it.

Am I wrong that OpenCL should just work once the Nvidia drivers are installed?

Lorenz Keel
  • 8,905
Hadog
  • 696
  • Thank you for the suggestion, but the CUDA Toolkit is not related to OpenCL and the driver in the PPA doesn't help. – Hadog May 05 '18 at 14:50
  • Sorry, but that is incorrect information about CUDA Toolkit being related to OpenCL. Please see the updates to my answer: https://askubuntu.com/a/1030901/231142 – Terrance May 05 '18 at 20:31
  • An interesting read, thank you. What does the CUDA Toolkit provide over the ocl-icd-libopencl1 package combined with the Nvidia-390 driver for applications just using the OpenCL interface? – Hadog May 05 '18 at 21:31
  • 1
    As far as the driver goes, you can use the nvidia-390 without problems. I have used it and it worked fine. The only thing that my answer is actually pointing out is that the driver name has changed from Ubuntu 16.04 and the graphics-drivers ppa to Ubuntu 18.04 where it is now nvidia-driver-39x where 396.24 is the newest driver. Seems fairly stable. As far as CUDA goes I would suggest reading through the Wiki page on it for what it can give you: https://en.wikipedia.org/wiki/CUDA – Terrance May 05 '18 at 21:39
  • I fear we might be going round in circles a bit here, but I cannot see any reason why anyone would install the CUDA Toolkit to get OpenCL support working. Thank you for you help.. – Hadog May 05 '18 at 21:50
  • I can see it for compatibility reasons with NVIDIA GPUs. One that I can think of is Blender will use the CUDA, which is what that question in the link was about. But, each to their own. If you have no need for CUDA then that is fine. The CUDA answer was there to install all the support without the need to know what all the names are and to give you the application written by NVIDIA themselves for their own chips. – Terrance May 05 '18 at 21:57

1 Answers1

15

Typical, after I resort to Askubuntu I manage to find the solution.

In 18.04 you need to manually install the ocl-icd-libopencl1 package. So a quick sudo apt install ocl-icd-libopencl1 fixed it.

Hadog
  • 696
  • 2
    Thanks! I use GPU processing for SETI in BOINC and spent a couple hours trying to figure this out after a clean install of Mint 19. I like that this solution is simpler than any of the non-working answers I found. – Pilot_51 Jul 07 '18 at 21:05
  • 2
    Thanks, darktable detects and uses opencl after installing the package. – 0x0me Aug 04 '18 at 22:19
  • @0x0me : LOL, exactly the reason why I cheked in to this thread :) I just installed a new nvidia card and wanted to activate OpenCL for Darktable. – runlevel0 Apr 15 '19 at 09:19