Open main menu

CDOT Wiki β

Changes

GPU610/DPS915 Ubuntu and CUDA Installation

4,671 bytes added, 21:56, 14 January 2013
no edit summary
== Part 2 - Install Ubuntu 12.04 LTS ==
Boot using your installation media of choice. It will take up to several minutes for the Ubuntu installer to load and display on your screen, so be patient. During this time you should see a little man and a keyboard appear at the bottom of your screen briefly. Once the installer appears on your screen, follow the step-by-step instructions UP TO STEP 4 (stop at Step 4, then read the important note about Step 4 below first) at the [http://www.ubuntu.com/download/help/install-desktop-long-term-support official Ubuntu installation guide]. Then proceed with the rest of the steps in the link provided.
During this process, I selected Download Updates while Installing. You can also safely download the third-party software if you want some extra convenience on Ubuntu.
In Step 4 you may have differing options depending on where you are installing Ubuntu (primary hard drive, second/external hard drive, whether or not there are existing OSes on your target hard drive, etc.) It is VERY important that you choose the correct device and/or partition for installation. As such, when the option presents itself in the drive/partition selection stage of the installation, I '''very strongly recommend''' you use the advanced partitioning tool instead of the graphical partitioning tool. Usage of the visual tool has resulted in <u>disastrous consequences</u> in a dual-boot environment (the author and others have had their Windows 7 MBR overwritten by Ubuntu when using the visual tool - this is a known problem with Ubuntu).
See [http://news.softpedia.com/news/Installing-Ubuntu-12-04-LTS-266201.shtml this guide] on how to properly set up your partitions using the advanced tool (skip to/search for 4. Something else (advanced) in that page). The guide suggests a size of 2048MB for the swap partition - I went up to 8000MB with no problem, so you don't have to follow the numbers exactly. The guide also creates a /home partition for easier reinstalling - you can skip the /home partition and just have a / partition. Your choice. In the "Device for boot loader installation" drop down menu, MAKE SURE you've selected the correct hard drive. Once you've configured your partitions correctly, proceed with the installation. Reboot your computer when prompted to. == Part 3: Getting Ubuntu ready for CUDA Development == 1. The Ubuntu Update Manager will prompt you shortly after first boot about installing many updates. I recommend you proceed with the updates; they will take quite some time to download and install though. 2. Install all the vital development tools for Ubuntu. Open a Terminal and execute the following command:'''sudo apt-get install libxi-dev libxmu-dev freeglut3-dev build-essential binutils-gold''' If you want to run the Toolkit samples, then you'll need some other things:OpenGL driver: '''sudo apt-get install freeglut3-dev libxi-dev libxmu-dev '''OpenMPI: '''sudo apt-get install mpi-default-dev ''' Depending on which sample you run, you'll probably need other packages. Good luck. 3. The last two things we need to do now are install an appropriate proprietary NVIDIA display driver for Ubuntu and the CUDA 5 Toolkit. Depending on which driver you want to install; the driver version needs to be at least 304.54 for Linux. You can install the driver that comes with the CUDA 5 Toolkit package (which at the time of writing is 304.54), or install a newer driver from Ubuntu (namely 310.) Both methods require differing additional work and will slightly change the way you install the CUDA Toolkit.  <u>Installing a driver from Ubuntu</u>Go to System Settings (click on the Cog icon on the top right corner of Ubuntu and go to System Settings), then Additional Drivers. You will see a list of nvidia display drivers; install the experimental-310 display driver as the other two are not recent enough. Reboot your computer. Next, download CUDA 5 Toolkit with the following commands at a Terminal: '''cd ~/Desktop''' '''wget http://developer.download.nvidia.com/compute/cuda/5_0/rel-update-1/installers/cuda_5.0.35_linux_32_ubuntu11.10-1.run''' Now we install the CUDA 5 toolkit.  '''chmod +x cuda_5.0.35_linux_32_ubuntu11.10-1.run'''' '''sudo ./cuda_5.0.35_linux_32_ubuntu11.10-1.run''' I suggest sticking with the default installation paths for simplicity's sake. Also, type 'n' when asked if you want to install NVIDIA drivers from the Toolkit. <u>Installing a driver from the CUDA Toolkit</u> '''cd ~/Desktop''' '''wget http://developer.download.nvidia.com/compute/cuda/5_0/rel-update-1/installers/cuda_5.0.35_linux_32_ubuntu11.10-1.run''' Logout your Linux desktop and switch to console mode with the Alt+Ctrl+F2 keystroke. You then login the text console, and stop the graphical display manager: '''sudo service lightdm stop ''' You may have to enter the same Alt+Ctrl+F2 keystroke again to resume the text console. Now install the CUDA Toolkit: '''sudo sh ./cuda_5.0.35_linux_64_ubuntu11.10.run ''' I suggest sticking with the default installation paths for simplicity's sake. Also, type 'y' when asked if you want to install NVIDIA drivers from the Toolkit.And reboot afterward: '''sudo reboot''' 4. Setting Environment Variables We'll need to set environment variables so that the compiler can find all the necessary CUDA libraries when compiling. In a terminal, type '''gedit ~/.bash_profile''' And put the following in the bash profile: export CUDA_HOME=/usr/local/cuda-5.0 export LD_LIBRARY_PATH=${CUDA_HOME}/lib PATH=${CUDA_HOME}/bin:${PATH} export PATH '''Note''': If you installed an experimental driver from Ubuntu, you'll need to add it's path to LD_LIBRARY_PATH for libcuda.so. Look for the driver folder under /usr/lib/nvidia-experimental-XXX, where XXX is the driver number (e.g. 310). Thats the path you want. Then the export LD_LIBRARY_PATH line in the bash_profile file becomes export LD_LIBRARY_PATH=${CUDA_HOME}/lib:/usr/lib/nvidia-experimental-310 You should now be ready to test your CUDA installation.  == Part 4: Test CUDA Toolkit Installation == In a terminal, go to ~/NVIDIA_CUDA-5.0_Samples. Then enter the make command, and let all the samples compile (this will take some time). If you get no compilation errors right away, that's good! It is entirely possible that not all the samples will successfully compile as each sample has its own set of dependencies. There is definitely one sample you'll want to run, though. From the ~/NVIDIA_CUDA-5.0_Samples folder, go to /bin/linux/release subfolder, and run the deviceQuery sample (./deviceQuery). If it runs and you see information about your CUDA device, you've made it! :)
1
edit