From Fedora Project Wiki

Installing CUDA Toolkit 3.1 on Fedora 12&13

The following explains how to install CUDA Toolkit 3.1 on 64-bit Fedora 12 Linux. I have tested it on a used laptop with Intel Core 2 Duo CPU, 2GB RAM, 80GB 7200RPM hard drive, and NVIDIA Quadro NVS 140M graphics card. The instruction assumes you have the necessary hardware support, and is familiar with using sudo in Linux. Depending on your hardware configuration, your mileage may vary.

Basic Video Driver

Boot the Fedora 12 Live CD for a fresh Linux install. During the initial boot screen, you should interrupt the automatic boot sequence by pressing a key on the keyboard, then press the TAB key at the first boot menu, and add the extra kernel parameters, "xdriver=vesa nomodeset". Now resume the boot process by pressing the Enter key. This enables the installed system to be configured with only the bare basic video driver, and avoids conflict with the CUDA developer video driver that you will install later.

Linux Development Tools

After you have successfully installed Fedora Linux with the basic video driver, you can install the Linux development tools. Login your freshly installed system and enter the following commands in a terminal. You may reboot the system after the kernel update. $ sudo yum update $ 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. Enter the following in a terminal. $ sudo yum install freeglut−devel libXi−devel libXmu−devel

CUDA Developer Driver

Download the CUDA developer driver from the CUDA download site. The graphical display manager must not be running during the CUDA video driver install. Hence you should either boot into runlevel 3 by editing the kernel boot option and reboot, or logout your Linux desktop and switch to console mode with the Alt+Ctrl+F2 keystroke. For the latter option, you can login the text console, and stop the graphical display manager with the following command. $ sudo stop prefdm

You will have to enter the same Alt+Ctrl+F2 keystroke again to resume the text console. Now install the CUDA developer video driver: $ sudo sh devdriver_3.1_linux_64_256.35.run

And reboot afterward: $ sudo reboot now

CUDA Toolkit

Download the CUDA Toolkit from the CUDA download site and run the following: $ sudo sh cudatoolkit_3.1_linux_64_fedora12.run

Assuming you have accepted the default install location /usr/local/cuda, you should add the following in the .bashrc file of your home folder. The CUDA_ROOT environment variable is my local setup, and you can rename it to anything you like. export CUDA_ROOT="/usr/local/cuda" export LD_LIBRARY_PATH="${CUDA_ROOT}/lib64:${CUDA_ROOT}/lib:/usr/lib64" export PATH=${CUDA_ROOT}/bin:${PATH}

CUDA SDK Samples

Download the CUDA SDK from the CUDA download site and run the following: $ sh gpucomputingsdk_3.1_linux.run

Assuming the default install location NVIDIA_GPU_Computing_SDK in your home folder, enter the following in a terminal and build the SDK samples. $ cd ~/NVIDIA_GPU_Computing_SDK/C/ $ make

If everything goes well, you should be able to verify your CUDA installation by running the deviceQuery sample in the NVIDIA_GPU_Computing_SDK/C/bin/linux/release folder of your home directory. You should find a similar output as below: ./bin/linux/release/deviceQuery Starting...

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

There is 1 device supporting CUDA

Device 0: "Quadro NVS 140M"

 CUDA Driver Version:                           3.10 
 CUDA Runtime Version:                          3.10 
 CUDA Capability Major revision number:         1 
 CUDA Capability Minor revision number:         1 
 Total amount of global memory:                 133890048 bytes 
 Number of multiprocessors:                     2 
 Number of cores:                               16 
 Total amount of constant memory:               65536 bytes 
 Total amount of shared memory per block:       16384 bytes 
 Total number of registers available per block: 8192 
 Warp size:                                     32 
 Maximum number of threads per block:           512 
 Maximum sizes of each dimension of a block:    512 x 512 x 64 
 Maximum sizes of each dimension of a grid:     65535 x 65535 x 1 
 Maximum memory pitch:                          2147483647 bytes 
 Texture alignment:                             256 bytes 
 Clock rate:                                    0.80 GHz 
 Concurrent copy and execution:                 Yes 
 Run time limit on kernels:                     Yes 
 Integrated:                                    No 
 Support host page−locked memory mapping:       No 
 Compute mode:                                  Default (multiple 

host threads can use this device simultaneously)

 Concurrent kernel execution:                   No 
 Device has ECC support enabled:                No 

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 3.10, CUDA Runtime Version = 3.10, NumDevs = 1, Device = Quadro NVS 140M


PASSED

Press <Enter> to Quit... −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

R Developer Environment

Since you will be compiling R packages, you should install the R developer environment. Enter the following in a terminal. $ sudo yum install R−devel

Installing gnutools

Define the following environment variable in .bashrc that points to an existing directory in your home folder for installing R packages. In the example below, I have chosen a folder lib/R created in my home directory beforehand. export R_LIBS_USER="${HOME}/lib/R"

Now start R in a terminal and enter the following R command. Your should replace the placeholder <your user id> with your own user login ID. > install.packages("gputools", lib="/home/<your user id>/lib/R")

You may verify your gputools installation by browsing its help page. > library(help=gputools)

Installing rpud

Besides gputools, you may also install the rpud package. Although it lacks the full functionality, it includes performance enhancement of a few selected functions. To install rpud, you can download the rpud package, and expand it in a temporary folder of your home directory as below. This will create a rpud sub-folder. $ tar xf rpud_<version id>.tar.gz

Now change your directory to the rpud sub-folder and run configure before returning to its parent. $ cd rpud $ ./configure $ cd ..

Then install rpud as follows: $ R CMD INSTALL rpud

Note

Some systems experience excessive hard drive load cycle issues. You can fix the error by appending the following line at the end of the file /etc/rc.d/rc.local and reboot afterward.

  1. fix excessive hard drive load cycle issue

/sbin/hdparm −B 254 /dev/sda