LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   LinuxQuestions.org Member Success Stories (https://www.linuxquestions.org/questions/linuxquestions-org-member-success-stories-23/)
-   -   Installing CUDA SDK on Fedora (https://www.linuxquestions.org/questions/linuxquestions-org-member-success-stories-23/installing-cuda-sdk-on-fedora-864012/)

stuart_m 02-21-2011 05:43 AM

Installing CUDA SDK on Fedora
 
I'm a relative newbie in Linux and also on this forum. I'm working in a University research department and was recently asked to get the CUDA SDK installed on a shared machine for some of us to use. This wasn't a straightforward operation and took a lot longer than I expected. I wouldn't have been able to complete it at all without the help I got from this forum as well as other places on the web, and so I wanted to share my installation notes in the hope that if in the future anyone else runs into the same problems I had, these may be of some assistance.

As I say I'm relatively new to Linux and am nowhere near being an expert. If some of the solutions I implemented or the explanations I provide seem a bit amateurish to more experienced people reading this, I'd be very interested to hear what you would have done differently. What I can say is that at the end of this process I now have a working CUDA implementation.

To begin - the environment I was working with was as follows:

GPU: G80 GeForce 8800 GTX
OS: Fedora 13 (64 bit)
GCC Version: 4.4.4

The stuff I was installing was:

CUDA toolkit
CUDA SDK
Nvidia driver for GPU listed above

Step 1

chmod u+x on all above downloads to make them executable under my login

Step 2

Nvidia driver set up. This needs to be done with X server stopped, attempted to do so using sudo /sbin/init 3 but this apparently had no effect.
Made change to /etc/inittab and set initdefault level from 5 to 3 – this effectively means that box will only boot to level 3 (shell prompt) rather than 5 (full GUI)
Rebooted box & confirmed X server not running

Step 3

Start Nvidia driver install using sudo ./NVIDIA....
Error message received:
“The Nouvea kernel driver is currently in use by your system. This is incompatible with Nvidia driver and must be disabled before proceeding”
Resolved as follows:
1) In /etc/modprobe.d/blacklist.conf add the following line:
blacklist nouveau
2) Rebuild the initramfs image file using dracut:
* Backup the initramfs file
$ sudo mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak
* Rebuild the initramfs file
$ sudo dracut -v /boot/initramfs-$(uname -r).img $(uname -r)
3) Reboot
4) Check that nouveau driver is not loaded
$ lsmod | grep nouveau

(From http://www.linuxquestions.org/questi...driver-825432/)

Step 4

Confirmed Nouveau driver now not running, run install again & take all default options. Install completes successfully

Step 5

Start CUDA toolkit install and take all defaults. On completion make following additions to .bashrc:

$PATH = “/usr/local/cuda/bin:$PATH”
$LD_LIBRARY_PATH=”/usr/local/cuda/lib64:/usr/local/cuda/lib”

These settings as advised by toolkit install programme

Step 6

Start SDK install and take all defaults. This installed to ~/NVIDIA_GPU_Computing_SDK

Step 7

Running make in ~/NVIDIA_GPU_Computing_SDK

Error – unable to find libglut.
This appears to be because no version of Freeglut installed on machine.
Resolve this using sudo yum install freeglut
then create symbolic link from /usr/lib64/libglut.so.3 to /usr/lib/libglut.so

Step 8

Run make again – completes successfully.

Step 9

Run ~/NVIDIA_GPU_Computing_SDK/C/bin/linux/release/deviceQuery & get following error:

cudaGetDeviceCount Failed – CUDA driver and runtime version may be mismatched.

Step 10

Initially thought that error in step 9 was because of not using development driver for GPU however on installing this, error remained the same. Reverted back to original driver install.
Advice available on web seems to indicate that GPU is not initialised after driver is installed and that box needs to be booted to run level 5 and the GUI based Nvidia config utility used to initialise X server.
Resolved by editing /etc/inittab & setting initdefault level back to 5.
Then rebooted the machine to ensure X server started, this effectively initialised the GPU
Re-run of deviceQuery resulted in output shown below.

Step 11

device Query now runs sucessfully confirming SKD install complete

....


Further work identified one additional problem which was that when attempting to include <cutil.h> in cuda code, an error was received indicating that this file was not found.

The problem was because the nvcc compiler uses an includes file located at /usr/local/cuda/bin This file needs to hold the path to the location where the cutil.h file is kept before it can be used as a header. Edited that file to include the relevant path (determined using "locate cutil.h") and this appeared to resolve the problem.

As I go on using CUDA if I run into further problems I will update this thread with any solutions found. I hope this will be of help to others attempting to do similar work.

If I've posted this in the wrong place, my apologies.


All times are GMT -5. The time now is 03:02 AM.