0

I've finally installed the latest nvidia drivers running with Bumblebee. It works just fine now with optirun.

The driver is called nvidia_352.

Now I'm trying to get CUDA working. I can modprobe manually nvidia_352 and nvidia_352_uvm and it works as expected. However, if I haven't yet run modprobe manually, it tries to load the nvidia and the nvidia_uvm drivers and so it fails (as those drivers don't exist).

This is similarly the case if I try to use nvidia-modprobe.

I suspect there is some underlying setting which is telling nvidia-modprobe to try to load the nvidia driver, but I don't know what that is. Does anybody have a suggestion?

I guess a workaround is to explicitly load those drivers at boot, but they are currently blacklisted by bumblebee, so that wants to take control, and also I'm not sure of the power implications of loading the driver.

Henry Gomersall
  • 230
  • 1
  • 9

2 Answers2

1

I am working through a similar issue and I was able to fix it by editing my bumblebee conf.

sudo vim /etc/bumblebee/bumblebee.conf

Set driver to nvidia

# (See also the driver-specific sections below)
Driver=nvidia

Inside the nvidia specific driver section I added the name of the module which in my case nvidia-352

## Section with nvidia driver specific options, only parsed if Driver=nvidia
[driver-nvidia]
# Module name to load, defaults to Driver if empty or unset
KernelDriver=nvidia-352

I needed to include the driver path which wasn't correct by default. Look through /usr/lib/ and /usr/lib32/. In my case I don't seem to have 32bit drivers... but if I did they would be on the LibraryPath separated by a comma.

I also needed to add the XorgModulePath.

# colon-separated path to the nvidia libraries
LibraryPath=/usr/lib/nvidia-352
# comma-separated path of the directory containing nvidia_drv.so and the
# default Xorg modules path
XorgModulePath=/usr/lib/nvidia-352,/usr/lib/xorg/modules

After doing a little more research I found an excellent guide that helped me complete my project.

how-to-install-nvidia-drivers-with-bumblebee-on-ubuntu-14-04

0

To fix this problem (in addition to @McKayMatt's answer), I wrote pair of scripts to do the loading explicitly:

The first is a preload script, preload_nvidia_module.sh:

#!/bin/sh
sudo modprobe nvidia-352-uvm
eval "$@"

which is called from another script cuda_run:

#!/bin/sh
optirun --no-xorg preload_nvidia_module.sh $@

So now the cuda program can be run as:

cuda_run my_cuda_program

and all the module loading and unloading happens automagically.

I dare say these scripts can be combined if you possess more bash fu than I do.

Henry Gomersall
  • 230
  • 1
  • 9