Notes: CUDA / OpenCL with Nvidia Optimus under Ubuntu 15.04

After struggling for two days to get OpenCL and Cuda working on my new shiny Kubuntu 15.04 and none of the usual tricks working, here are my notes:

  1. Do the bumblebee dance
  2. Check that /etc/OpenCL/vendors/nvidia.icd contains
  3. Maybe sudo ln -s /usr/lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu/ to enable standard OpenCL programs like darktable
  4. Check that /etc/bumblebee/bumblebee.conf and /etc/modprobe.d/nvidia-*-bumblebee.conf both contain the right driver version
  5. Run the following commands before executing any GPU code:
optirun fish # or bash, gives you an NVIDIA-enabled prompt
sudo clinfo # prime the device nodes
clinfo # should succeed now

All in all really easy, but pretty confusing, since under Kubuntu 14 optirun clinfo sufficed...