Intro
I am trying to get CUDA working on my hybrid graphics laptop. I am using (l)ubuntu 15.04.
Currently I have followed some steps in an online guide, which I shall explain below, and I am able to run optirun glxspheres64 without problems. However when I run optirun ./deviceQuery I get the following error:
/usr/bin/vglrun: 246: exec: ./deviceQuery: Permission denied
There doesn't appear to be any info about this online.
Detail
The guide I followed is here. I didn't follow all the steps exactly as this is now quite old and Nvidia have changed the format in which they ship their .run files.
I did the following: (This is straight out of my history command.)
15 sudo apt-add-repository ppa:bumblebee/stable
16 sudo apt-add-repository ppa:ubuntu-x-swat/x-updates
17 sudo apt-get update
18 sudo apt-get install bumblebee
19 sudo apt-get install bumblebee bumblebee-nvidia
20 sudo reboot
Then log into tty1, stop the x server and init 3.
21 cd Downloads/
22 chmod +x cuda_7.5.18_linux.run
23 sudo ./cuda_7.5.18_linux.run
Install the run package with all default options, also install the graphics driver version 352.
Then set up the PATH variable.
25 export PATH=/usr/local/bin:$PATH
26 export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
27 sudo ldconfig
I skipped the next static linking steps. I didn't get any linker errors (or at least I don't think I did) when compiling the sample codes, so I presume this wasn't required. I also haven't seen this step in any other guides online. Perhaps this is where I went wrong?
Then some stuff obviously requires OpenGL, so:
28 sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev
Compile the samples:
30 cd NVIDIA_CUDA-7.5_Samples/
31 make
Then I attempted to run ./deviceQuery, which is inside the Utilities directory. I got an error which I have previously seen before about bumblebeed not running.
So:
34 sudo vim /etc/bumblebee/bumblebee.conf
Change the line with Driver= (which was blank) to Driver=nvidia, and also the line KernelDriver=nvidia-current to KernelDriver=nvidia.
This info is available here, see the (currently) second answer to the question.
It still wasn't working, so I tried following the info given in the first answer to be above linked question and installed the kernel headers:
48 sudo apt-get install linux-headers-generic
49 sudo reboot
If I do:
54 sudo service bumblebeed status
I now get:
● bumblebeed.service - Bumblebee C Daemon
Loaded: loaded (/lib/systemd/system/bumblebeed.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2015-10-11 13:15:07 BST; 20min ago
Main PID: 1502 (bumblebeed)
CGroup: /system.slice/bumblebeed.service
└─1502 /usr/sbin/bumblebeed
Oct 11 13:16:20 P151EMx bumblebeed[1502]: [ 163.019954] [WARN][XORG]....
Oct 11 13:16:20 P151EMx bumblebeed[1502]: [ 163.019987] [WARN][XORG]....
Oct 11 13:16:20 P151EMx bumblebeed[1502]: [ 163.020055] [WARN][XORG]....
Oct 11 13:17:11 P151EMx bumblebeed[1502]: rmmod: ERROR: Module nvidia...d
Oct 11 13:17:11 P151EMx bumblebeed[1502]: modprobe: FATAL: Error runn...a
Oct 11 13:17:22 P151EMx bumblebeed[1502]: [ 225.439546] [WARN][XORG]....
Oct 11 13:17:22 P151EMx bumblebeed[1502]: [ 225.439578] [WARN][XORG]....
Oct 11 13:17:22 P151EMx bumblebeed[1502]: [ 225.439606] [WARN][XORG]....
Oct 11 13:17:23 P151EMx bumblebeed[1502]: rmmod: ERROR: Module nvidia...d
Oct 11 13:17:23 P151EMx bumblebeed[1502]: modprobe: FATAL: Error runn...a
Hint: Some lines were ellipsized, use -l to show in full.
But it looks like I still have some problems here... Its "active" now, whereas it would not start before, but still not everything is working correctly. For some reason I can't get the -l option to work to give any more info here.
When I run optirun ./deviceQuery I get the error:
/usr/bin/vglrun: 246: exec: ./deviceQuery: Permission denied
What should I do now?
Updates:
Edit: For anyone following this, it might be an idea not to do this step. Perhaps try installing the driver after CUDA to avoid this step? It seems a bit unnecessary to install driver version 352 and then revert to 304 by doing the following:
I noticed that on the linked question, the command sudo apt-get install -reinstall nvidia-current was appended after installing the kernel headers.
I ran this command, I think my driver has gone back to version 304. Rebooted, now
sudo service bumblebeed status
gives the following output:
● bumblebeed.service - Bumblebee C Daemon
Loaded: loaded (/lib/systemd/system/bumblebeed.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2015-10-11 13:46:53 BST; 38s ago
Main PID: 659 (bumblebeed)
CGroup: /system.slice/bumblebeed.service
└─659 /usr/sbin/bumblebeed
Oct 11 13:46:53 edward-P151EMx systemd[1]: Started Bumblebee C Daemon.
Oct 11 13:46:53 edward-P151EMx systemd[1]: Starting Bumblebee C Daemon...
Oct 11 13:46:53 edward-P151EMx bumblebeed[659]: [ 17.073332] [INFO]/usr/sb...d
Hint: Some lines were ellipsized, use -l to show in full.
So that seems to be fixed. Still can't run ./deviceQuery however, same error:
sudo optirun ./deviceQuery
/usr/bin/vglrun: 246: exec: ./deviceQuery: Permission denied
Plz help. L@l
glxspheres still works by the way:
optirun glxspheres64
Getting ~270 FPS?