1

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?

user3728501
  • 1,142

1 Answers1

0

I restarted my computer again, and hurrah it is working.

optirun ./deviceQuery

returns

./deviceQuery Starting...

 CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)

Device 0: "GeForce GTX 670MX"
  CUDA Driver Version / Runtime Version          7.5 / 7.5
  CUDA Capability Major/Minor version number:    3.0
  Total amount of global memory:                 3072 MBytes (3221028864 bytes)
  ( 5) Multiprocessors, (192) CUDA Cores/MP:     960 CUDA Cores
  GPU Max Clock rate:                            601 MHz (0.60 GHz)
  Memory Clock rate:                             1400 Mhz
  Memory Bus Width:                              192-bit
  L2 Cache Size:                                 393216 bytes
  Maximum Texture Dimension Size (x,y,z)         1D=(65536), 2D=(65536, 65536), 3D=(4096, 4096, 4096)
  Maximum Layered 1D Texture Size, (num) layers  1D=(16384), 2048 layers
  Maximum Layered 2D Texture Size, (num) layers  2D=(16384, 16384), 2048 layers
  Total amount of constant memory:               65536 bytes
  Total amount of shared memory per block:       49152 bytes
  Total number of registers available per block: 65536
  Warp size:                                     32
  Maximum number of threads per multiprocessor:  2048
  Maximum number of threads per block:           1024
  Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
  Max dimension size of a grid size    (x,y,z): (2147483647, 65535, 65535)
  Maximum memory pitch:                          2147483647 bytes
  Texture alignment:                             512 bytes
  Concurrent copy and kernel execution:          Yes with 1 copy engine(s)
  Run time limit on kernels:                     Yes
  Integrated GPU sharing Host Memory:            No
  Support host page-locked memory mapping:       Yes
  Alignment requirement for Surfaces:            Yes
  Device has ECC support:                        Disabled
  Device supports Unified Addressing (UVA):      Yes
  Device PCI Domain ID / Bus ID / location ID:   0 / 1 / 0
  Compute Mode:
     < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 7.5, CUDA Runtime Version = 7.5, NumDevs = 1, Device0 = GeForce GTX 670MX
Result = PASS

By the way, I suspect the last steps I tried are not actually required, if following the info in the question above, try not doing the last steps:

  • Re-installation of the driver. I don't think this should be necessary. It's also annoying because it reverts you to a much older version of the driver. I would be interested to know if anyone following the info in the question was able to get CUDA working without doing this step.

I think the info in the question could be very useful for anyone (and myself) trying to install:

  • CUDA 7.5 (or CUDA 7)

on a Linux, specifically a ubuntu related distribution;

  • ubuntu, xubuntu, lubuntu, ubuntu mate, kubuntu,
  • and perhaps also linux mint 17, linux mint 17.1 and linux mint 17.2 [however I have previously had problems with linux mint 17 and linux mint 17.2 trying to install CUDA]
  • perhaps one of the debian distributions (I think we are on debian 8 right now, but possibly also debian 7 or debain 6)

It is my intention to test this answer with all of these distributions, as a lot of the guides out there on the web for setting up CUDA for Linux are either for outdated versions of Linux, or for outdated versions of CUDA.

It will take me some time to do this, but I will try to do it soon.

Also, I might change this answer to a community wiki if anyone wishes to contribute to it.

Keep checking for updates. Any comments let me know by commenting below.

user3728501
  • 1,142