The following tutorial describes how to install Nvidia CUDA under Ubuntu 10.04. The described steps assume a freshly installed and security updated Ubuntu 10.04 - 64 bit. The setup has not been tested under the 32 bit version, but it should work. Please let us know if you experience any problems with Ubuntu 10.04 - 32 bit.
There are some problems installing and using CUDA 3.1 under Ubuntu 10.04, since that CUDA release only supports Ubuntu 9.10. Therefore, this tutorial describes installation of CUDA 3.2 RC2. The tutorial has not been updated for the final CUDA 3.2 release - please let me know if something does not work with the final CUDA 3.2 release. CUDA 3.2 can be found at http://developer.nvidia.com/object/c...downloads.html in stead of the link below. The driver version for the final CUDA 3.2 will be different than the one stated in this tutorial.
- Download Nvidia driver and CUDA:
- Goto Nvidia's homepage http://developer.nvidia.com/object/c..._rc.html#Linux, the Linux section.
- Download and store the following files in a location on your computer that you can find again:
- "Developer Drivers for Linux (260.40)" (64 bit).
- "CUDA Toolkit for Ubuntu Linux 10.04" (64 bit).
- "GPU Computing SDK code samples".
Optional - this will only be used for verification of the CUDA installation at the end.- First get rid of any existing drivers that will interfere with the Nvidia development driver (as suggested, e.g., here http://ubuntuforums.org/showthread.php?p=9233555):
- Blacklist kernel modules:
Add the following lines to the file:Code:gsudo gedit /etc/modprobe.d/blacklist.conf
Save and quit the editor.Code:blacklist vga16fb blacklist nouveau blacklist rivafb blacklist nvidiafb blacklist rivatv- Get rid of any installed Nvidia drivers:
Code:sudo apt-get --purge remove nvidia-*- Reboot your PC.
- Go to a virtual terminal (we will need to shut down the X server):
Some users have reported problems changing between virtual terminals in Ubuntu 10.04. If you have this problem, see the following solution http://ubuntuforums.org/showthread.php?t=1473045.Code:CTRL+ALT+F5- Login at the terminal and run:
Code:sudo service gdm stop- Install Nvidia development drivers:
- Go to the location where you stored the downloaded Nvidia files and run:
Code:sudo devdriver_3.2_linux_64_260.24.run
- Accept the license agreement.
- Install NVIDIA's 32-bit compatibility OpenGL libraries?
Answer 'Yes' - we don't know if this is actually necessary, but it does not seem to hurt...- Would you like to run the nvidia-xconfig utility to automatically update your X configuration file so that the NVIDIA X driver will be used when you restart X?
Answer 'Yes'.- The driver should now be installed successfully. Now we install CUDA:
- Go to the location where you stored the downloaded Nvidia files and run:
Code:sudo cudatoolkit_3.2.9_linux_64_ubuntu10.04.run
- Enter install path (default /usr/local/cuda, '/cuda' will be appended):
Press enter to select default path or choose another location - this tutorial assumes you choose the default path.- Set up environment variables:
- Set PATH:
Append the path to the CUDA binaries. ChangeCode:gksudo gedit /etc/environment
toCode:PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
Save and quit the editor.Code:PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/cuda/bin"- Reload PATH:
Code:source /etc/environment- Set LD_LIBRARY_PATH:
Paste into the file:Code:gksudo gedit /etc/ld.so.conf.d/cuda.conf (creates a new file).
Save and quit the editor.Code:/usr/local/cuda/lib64 /usr/local/cuda/lib- Reload LD_LIBRARY_PATH:
Code:sudo ldconfig- CUDA should now be installed and ready to run. If you wish, you can install the "GPU Computing SDK" and compile of the examples to verify that your installation works:
- Go to the location where you stored the downloaded Nvidia files and run:
Code:gpucomputingsdk_3.2_linux.run
- Enter install path (default ~/NVIDIA_GPU_Computing_SDK):
Press enter to select default path or choose another location - this tutorial assumes you choose the default path.- Located CUDA at /usr/local/cuda
If this is correct, choose the default below.
If it is not correct, enter the correct path to CUDA
Press enter to confirm.- Install compiler:
Code:sudo apt-get install g++
- Do you want to continue [Y/n]?
Press enter to install dependencies.- Repair broken link to libGL.so (http://ubuntuforums.org/showthread.php?t=409438):
Code:sudo rm /usr/lib/libGL.so sudo ln -s /usr/lib/libGL.so.260.24 /usr/lib/libGL.so- Create link to libXmu.so:
Code:sudo ln -s /usr/lib/libXmu.so.6 /usr/lib/libXmu.so- Install libraries necessary to compile CUDA code examples:
Code:sudo apt-get install freeglut3-dev libxi-dev
- Do you want to continue [Y/n]?
Press enter to install dependencies.- Go to the GPU Computing SDK directory:
Code:cd ~/NVIDIA_GPU_Computing_SDK/C- Build code examples:
Code:make- The compiled examples can now be found under ~/NVIDIA_GPU_Computing_SDK/C/bin/linux/release/
Bookmarks