Tags:
create new tag
view all tags
This article documents the process of installing the NVIDIA CUDA GPGPU framework on a self-administered Ubuntu 8.04 Linux computer. This guide is a collection of the various things we had to do to get CUDA up and running. For mor info on CUD look here: http://www.nvidia.com/object/cuda_what_is.html

  • CUDA installation
    • The CUDA getting started guide is excellent, and will get you most of the way. Hoever, there are a few thigs we had to figure out, which are listed here. Read these first before you begin!
      • NVIDIA driver install.
        • The driver installer may need to compile a kernel-something-or-other during installation, and for this it requires libc. Install libc now to head this problem off (if it's not already installed). To do this, issue the command "sudo apt-get install libc6-dev" to download and install the package (or use synaptic).
        • The driver installer requires that the X server is shut down before it can begin. To do this on Ubuntu, press CTRL-ALT-F1 (maybe other F-keys) to switch from the graphical interface to a simple terminal. Note that the graphical interface is still running, but is not displayed. The instructions say the command "/sbin/init 3" will disable the x-server, but this is incorrect. The command "sudo killall gdm" will disable the x-server.
        • You can invoke the installer script NVIDIA-Linux-x86-185.18.14-pkg1.run NOTE: you may need to make the script executable using the command "chmod +x NVIDIA-Linux-x86-185.18.14-pkg1.run".
        • Once the installer is done executing, issue the command "startx" to reboot the x-server and restart graphics. A keystroke like CTRL-ALT-F7 will return you to the graphical interface once X is running again. At this point it would be wise to reboot the machine.
    • The toolkit and sdk installation went smoothly in our case, so hopefully it will for you too.
    • When it is time to compile the sdk examples, you will need a laundry list of dependencies before it will compile properly. They are:
      • build-essential (for g++)
      • libglut3 and libglut3-dev (openGL graphics)
      • libxi-dev
      • libXmu-dev You can install them all at once with: "sudo apt-get install build-essential libglut3 libglut3-dev libxi-dev libXmu-dev" Note that the packages with the -dev suffix contain the headers and other files necessary for development.

  • Testing your install
    • Once you've compiled the examples you can test the system using: NVIDIA_CUDA_SDK/bin/linux/release/deviceQuery You're looking for the line "There are 'n' devices supporting CUDA" where n > 0.
    • Here are a list of the errors we had and how to fix them (some of the messages are not verbatim because I don't remember the exact wording:
      • "Your NVIDIA driver is not the same version as the NVIDIA kernel module. They should be the same version." - Marius fixed this.
      • "There is no device supporting CUDA" This is a configuration problem (assuming you do have a CUDA-capable card). This is addressed in the README that comes with the CUDA toolkit. I will reproduce it here:

         On some Linux releases, due to a GRUB bug in the handling of upper memory 
         and a default vmalloc too small on 32-bit systems, it may be necessary to
         pass this information to the bootloader:

         vmalloc=256MB, uppermem=524288

         Example of grub conf:

         title Red Hat Desktop (2.6.9-42.ELsmp)
         root (hd0,0)
         uppermem 524288
         kernel /vmlinuz-2.6.9-42.ELsmp ro root=LABEL=/1 rhgb quiet vmalloc=256MB
         pci=nommconf
         initrd /initrd-2.6.9-42.ELsmp.img

      • In Ubuntu 8.04, the file to edit is NOT /boot/grub/grub.conf , it's /boot/grub/menu.lst . Open it using the command sudo nano /boot/grub/menu.lst whic opens nano, a simple terminal text editor. Scroll down until you see lines that don't begin with '#'. They should look something like this:

         title           Ubuntu 8.04.3 LTS, kernel 2.6.24-24-generic
         root            (hd0,0)
         kernel          /boot/vmlinuz-2.6.24-24-generic root=UUID=dbb1a9e1-5e3d-45be-9a5e-18ec4260947d ro quiet splash
         initrd          /boot/initrd.img-2.6.24-24-generic
         quiet

      • There will probably be several of these blocks, representing the various boot modes (usually 4: the current kernal version, regular and safe mode boot, plus the previous kernel version, regular + safe mode boot, so that you can recover from a bad kernel upgrade). We wish to edit the one in which the machine boots when we're doing CUDA stuff. In our case that's the first one. If you have a dual-boot system or other more interesting setups, be sure you edit the correct set of configurations.
      • We add the line uppermem=524288 between the lines root and kernel
      • We append the phrase vmalloc=256MB to the end of the kernel line, separating it from the last entry on that line with a single space. Your file should now look something like this:

         title           Ubuntu 8.04.3 LTS, kernel 2.6.24-24-generic
         root            (hd0,0)
         uppermem        524288
         kernel          /boot/vmlinuz-2.6.24-24-generic root=UUID=dbb1a9e1-5e3d-45be-9a5e-18ec4260947d ro quiet splash vmalloc=256MB
         initrd          /boot/initrd.img-2.6.24-24-generic
         quiet

      • Save your handiwork using the command CTRL-O (won't work unless you did "sudo nano...")
      • Exit nano with CTRL-X
      • Restart the computer.

Thus endeth all the things I figured out for CUDA installation. If you have other problems,google the error messages, and ask a Linux person, particularly if you find yourself sudo-ing a lot.

-- MattBaumann - 09 Oct 2009

Topic revision: r1 - 2009-10-09 - MattBaumann
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback