Here is a quick guide on how to install nvidia drivers + CUDA 5.5 on Ubuntu 14.04 with a machine using prime technology:
Only if you already have nvidia drivers; purge them:
sudo apt-get --purge remove nvidia-*
Install the proprietary driver with the Software & updates program :
Reboot, take a look at “X server settings” application and you should be able to see “PRIME Profiles”, keep NVIDIA (performance mode).
Download CUDA toolkit 5.5 (cuda_5.5.22_linux_64.run)
Switch to a virtual terminal (Ctrl + Alt + 1 for example) and login; then
sudo service lightdm stop
sudo ./cuda_5.5.22_linux_64.run -override
The -override option is mandatory because Ubuntu 14.04 ships with gcc 4.8.2 which is not recognized as supported by the CUDA .run installer.
When prompted if you want to install the nvidia driver embedded into the .run package; answer no (your version is newer and natively supports prime).
Set up everything else (install the examples) like you want.
Copying the log from the tmp folder to your home folder is a good practice (there are pieces of advice concerning PATH etc…)
The installer will warn you that the installation is incomplete; this is because you have chosen not to install the driver; no worries!
When everything is done reboot (not sure if needed) and test if CUDA works (easy if you have installed nvidia samples!)
Note that I personally didn’t have to modify the PATH nor anything else to get CUDA working; you might need to follow the steps in the installation log to get CUDA working fine.
Compile an example:
CUDA Device Query (Runtime API) version (CUDART static linking)
Detected 1 CUDA Capable device(s)
Device 0: "Quadro K3000M"
CUDA Driver Version / Runtime Version 6.0 / 5.5
CUDA Capability Major/Minor version number: 3.0
Total amount of global memory: 2048 MBytes (2147287040 bytes)
( 3) Multiprocessors, (192) CUDA Cores/MP: 576 CUDA Cores
GPU Clock rate: 654 MHz (0.65 GHz)
Memory Clock rate: 1400 Mhz
Memory Bus Width: 256-bit
L2 Cache Size: 524288 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 2 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 Bus ID / PCI location ID: 1 / 0
< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >
deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 6.0, CUDA Runtime Version = 5.5, NumDevs = 1, Device0 = Quadro K3000M
Result = PASS
If someone managed to install and get CUDA 6 working with Ubuntu 14.04 (+ prime) please post detailed instructions here!