An R Introduction to Statistics

Installing CUDA Toolkit 5.0 on Fedora 16 Linux

The following explains how to install CUDA Toolkit 5.0 on 64-bit Fedora 16 Linux. I have tested it on a self-assembled desktop with AMD Phenom II X4 CPU, 4GB RAM, 500GB hard drive, 650W power supply, and NVIDIA GeForce GTX 460 graphics card. The instruction assumes you have the necessary CUDA compatible hardware support and know how to use sudo. Depending on your system configuration, your mileage may vary.

Proprietary Video Driver

The built-in video driver in Fedora 16 is incompatible with the CUDA Toolkit, and you need to replace it with the proprietary NVIDIA driver. If you have not already done so, you should first configure your system with the RPM Fusion repository. Then install the proprietary driver in a terminal as follows.

$ sudo yum install kmod-nvidia xorg-x11-drv-nvidia-libs

Next, you should rebuild the kernel image.

$ sudo dracut /boot/initramfs-$(uname -r).img $(uname -r)

And you can reboot the system at this point for the change to take effect.

Linux Development Tools

After you have successfully configured Fedora Linux with the proprietary NVIDIA driver, you can install the Linux development tools.

$ sudo yum install gcc-c++ kernel-devel

OpenGL Developer Driver

To prepare for compiling the OpenGL code samples in the CUDA SDK, you will have to install the OpenGL developer environment.

$ sudo yum install freeglut-devel libXi-devel libXmu-devel

OpenMPI Developer Driver

Since there is a new MPI sample in the CUDA SDK, you will have to install the OpenMPI environment as well.

$ sudo yum install openmpi-devel

CUDA Toolkit

Download the CUDA Toolkit from the CUDA download site. The graphical display manager must not be running during the CUDA video driver install. Hence you should logout the desktop, and switch into console mode with the Alt+Ctrl+F2 keystroke. Then login the text console, and stop the graphical display manager with the following:

$ sudo systemctl stop prefdm.service

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_fedora16.run

And reboot afterward:

$ sudo reboot

Environment Variables

Assuming you have accepted the default install locations, you should add the following in the .bashrc file of your home folder.

export OPENMPI_HOME=/usr/lib64/openmpi 
 
export CUDA_HOME=/usr/local/cuda-5.0 
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64 
 
PATH=${CUDA_HOME}/bin:${OPENMPI_HOME}/bin:${PATH} 
export PATH

CUDA SDK Samples

Now you can copy the SDK samples into your home directory, and proceed with the build process.

$ cp -r /usr/local/cuda-5.0/samples ~/NVIDIA_CUDA-5.0_Samples 
$ cd ~/NVIDIA_CUDA-5.0_Samples 
$ make

If everything goes well, you should be able to verify your CUDA installation by running the deviceQuery sample in bin/linux/release.