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?

  • 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 5, 2018 at 14:50
  • Sorry, but that is incorrect information about CUDA Toolkit being related to OpenCL. Please see the updates to my answer: askubuntu.com/a/1030901/231142
    – Terrance
    May 5, 2018 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 5, 2018 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: en.wikipedia.org/wiki/CUDA
    – Terrance
    May 5, 2018 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 5, 2018 at 21:50

1 Answer 1


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.

  • 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 7, 2018 at 21:05
  • 2
    Thanks, darktable detects and uses opencl after installing the package.
    – 0x0me
    Aug 4, 2018 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, 2019 at 9:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.