Page 1 of 3 123 LastLast
Results 1 to 10 of 29

Thread: Howto: Install Nvidia CUDA in Ubuntu 10.04

  1. #1
    Join Date
    Nov 2005
    Location
    Denmark
    Beans
    19
    Distro
    Ubuntu 10.04 Lucid Lynx

    Howto: Install Nvidia CUDA in Ubuntu 10.04

    The following tutorial describes how to install Nvidia CUDA under Ubuntu 10.04. The described steps assume a freshly installed and security updated Ubuntu 10.04 - 64 bit. The setup has not been tested under the 32 bit version, but it should work. Please let us know if you experience any problems with Ubuntu 10.04 - 32 bit.

    There are some problems installing and using CUDA 3.1 under Ubuntu 10.04, since that CUDA release only supports Ubuntu 9.10. Therefore, this tutorial describes installation of CUDA 3.2 RC2. The tutorial has not been updated for the final CUDA 3.2 release - please let me know if something does not work with the final CUDA 3.2 release. CUDA 3.2 can be found at http://developer.nvidia.com/object/c...downloads.html in stead of the link below. The driver version for the final CUDA 3.2 will be different than the one stated in this tutorial.

    1. Download Nvidia driver and CUDA:
      1. Goto Nvidia's homepage http://developer.nvidia.com/object/c..._rc.html#Linux, the Linux section.
      2. Download and store the following files in a location on your computer that you can find again:
        1. "Developer Drivers for Linux (260.40)" (64 bit).
        2. "CUDA Toolkit for Ubuntu Linux 10.04" (64 bit).
        3. "GPU Computing SDK code samples".
          Optional - this will only be used for verification of the CUDA installation at the end.
    2. First get rid of any existing drivers that will interfere with the Nvidia development driver (as suggested, e.g., here http://ubuntuforums.org/showthread.php?p=9233555):
      1. Blacklist kernel modules:
        Code:
        gsudo gedit /etc/modprobe.d/blacklist.conf
        Add the following lines to the file:
        Code:
        blacklist vga16fb
        blacklist nouveau
        blacklist rivafb
        blacklist nvidiafb
        blacklist rivatv
        Save and quit the editor.
      2. Get rid of any installed Nvidia drivers:
        Code:
        sudo apt-get --purge remove nvidia-*
    3. Reboot your PC.
    4. Go to a virtual terminal (we will need to shut down the X server):
      Code:
      CTRL+ALT+F5
      Some users have reported problems changing between virtual terminals in Ubuntu 10.04. If you have this problem, see the following solution http://ubuntuforums.org/showthread.php?t=1473045.
    5. Login at the terminal and run:
      Code:
      sudo service gdm stop
    6. Install Nvidia development drivers:
      1. Go to the location where you stored the downloaded Nvidia files and run:
        Code:
        sudo devdriver_3.2_linux_64_260.24.run
        1. Accept the license agreement.
        2. Install NVIDIA's 32-bit compatibility OpenGL libraries?
          Answer 'Yes' - we don't know if this is actually necessary, but it does not seem to hurt...
        3. Would you like to run the nvidia-xconfig utility to automatically update your X configuration file so that the NVIDIA X driver will be used when you restart X?
          Answer 'Yes'.
    7. The driver should now be installed successfully. Now we install CUDA:
      1. Go to the location where you stored the downloaded Nvidia files and run:
        Code:
        sudo cudatoolkit_3.2.9_linux_64_ubuntu10.04.run
        1. Enter install path (default /usr/local/cuda, '/cuda' will be appended):
          Press enter to select default path or choose another location - this tutorial assumes you choose the default path.
    8. Set up environment variables:
      1. Set PATH:
        Code:
        gksudo gedit /etc/environment
        Append the path to the CUDA binaries. Change
        Code:
        PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
        to
        Code:
        PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/cuda/bin"
        Save and quit the editor.
      2. Reload PATH:
        Code:
        source /etc/environment
      3. Set LD_LIBRARY_PATH:
        Code:
        gksudo gedit /etc/ld.so.conf.d/cuda.conf (creates a new file).
        Paste into the file:
        Code:
        /usr/local/cuda/lib64
           /usr/local/cuda/lib
        Save and quit the editor.
      4. Reload LD_LIBRARY_PATH:
        Code:
        sudo ldconfig
    9. CUDA should now be installed and ready to run. If you wish, you can install the "GPU Computing SDK" and compile of the examples to verify that your installation works:
      1. Go to the location where you stored the downloaded Nvidia files and run:
        Code:
        gpucomputingsdk_3.2_linux.run
        1. Enter install path (default ~/NVIDIA_GPU_Computing_SDK):
          Press enter to select default path or choose another location - this tutorial assumes you choose the default path.
        2. Located CUDA at /usr/local/cuda
          If this is correct, choose the default below.
          If it is not correct, enter the correct path to CUDA

          Press enter to confirm.
      2. Install compiler:
        Code:
        sudo apt-get install g++
        1. Do you want to continue [Y/n]?
          Press enter to install dependencies.
      3. Repair broken link to libGL.so (http://ubuntuforums.org/showthread.php?t=409438):
        Code:
        sudo rm /usr/lib/libGL.so
        sudo ln -s /usr/lib/libGL.so.260.24 /usr/lib/libGL.so
      4. Create link to libXmu.so:
        Code:
        sudo ln -s /usr/lib/libXmu.so.6 /usr/lib/libXmu.so
      5. Install libraries necessary to compile CUDA code examples:
        Code:
        sudo apt-get install freeglut3-dev libxi-dev
        1. Do you want to continue [Y/n]?
          Press enter to install dependencies.
      6. Go to the GPU Computing SDK directory:
        Code:
        cd ~/NVIDIA_GPU_Computing_SDK/C
      7. Build code examples:
        Code:
        make
    10. The compiled examples can now be found under ~/NVIDIA_GPU_Computing_SDK/C/bin/linux/release/

  2. #2
    Join Date
    Oct 2010
    Beans
    1

    Re: Howto: Install Nvidia CUDA in Ubuntu 10.04

    Thank you for the instructions, it was very helpful. However, a few questions remain:

    I installed NVIDIA-Linux-x86_64-260.19.21.run (instead of 260.40) Is that OK? It was the most recent that I could find through the NVIDIA website

    So at instruction (9.3) I typed in:
    sudo ln -s /usr/lib/libGL.so.260.19.21 /usr/lib/libGL.so (libGL.so.260.19.21 was an actual file in that folder)

    instead of
    sudo ln -s /usr/lib/libGL.so.260.24 /usr/lib/libGL.so (to stay consistent with the notation)


    at (9.4), I typed the command in and received a message:

    /usr/lib$ sudo ln -s /usr/lib/libXmu.so.6 /usr/lib/libXmu.so
    ln: creating symbolic link `/usr/lib/libXmu.so': File exists

    Is that an error?


    The reason I have these questions is because when I go to "make" these files in ~/NVIDIA_GPU_Computing_SDK/C I receive the following errors:

    :~/NVIDIA_GPU_Computing_SDK/C$ make
    make[1]: Entering directory `/home/cruiser/NVIDIA_GPU_Computing_SDK/C/common'
    mkdir: cannot create directory `obj': Permission denied
    make[1]: *** [makedirectories] Error 1
    make[1]: Leaving directory `/home/cruiser/NVIDIA_GPU_Computing_SDK/C/common'
    make: *** [lib/libcutil.so] Error 2
    Last edited by cruis3r; November 23rd, 2010 at 12:25 AM. Reason: did not finish

  3. #3
    Join Date
    Nov 2005
    Location
    Denmark
    Beans
    19
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Howto: Install Nvidia CUDA in Ubuntu 10.04

    Quote Originally Posted by cruis3r View Post
    I installed NVIDIA-Linux-x86_64-260.19.21.run (instead of 260.40) Is that OK? It was the most recent that I could find through the NVIDIA website

    So at instruction (9.3) I typed in:
    sudo ln -s /usr/lib/libGL.so.260.19.21 /usr/lib/libGL.so (libGL.so.260.19.21 was an actual file in that folder)

    instead of
    sudo ln -s /usr/lib/libGL.so.260.24 /usr/lib/libGL.so (to stay consistent with the notation)
    That should be OK. As I mentioned at the beginning of my original post, my description is based on CUDA 3.2 RC2 - not the final version. It seems the driver that comes with the final CUDA 3.2 is version 260.19.21 in stead of 260.24.

    Quote Originally Posted by cruis3r View Post
    at (9.4), I typed the command in and received a message:

    /usr/lib$ sudo ln -s /usr/lib/libXmu.so.6 /usr/lib/libXmu.so
    ln: creating symbolic link `/usr/lib/libXmu.so': File exists

    Is that an error?
    I think this is OK. The purpose of the above is to create a link to /usr/lib/libXmu.so.6 so it can be found as /usr/lib/libXmu.so as well. This could indicate that this has been fixed by an Ubuntu security update since I tested the setup. Are you using the 32 bit or 64 bit version of Ubuntu? I guess that could make a difference.

    Quote Originally Posted by cruis3r View Post
    The reason I have these questions is because when I go to "make" these files in ~/NVIDIA_GPU_Computing_SDK/C I receive the following errors:

    :~/NVIDIA_GPU_Computing_SDK/C$ make
    make[1]: Entering directory `/home/cruiser/NVIDIA_GPU_Computing_SDK/C/common'
    mkdir: cannot create directory `obj': Permission denied
    make[1]: *** [makedirectories] Error 1
    make[1]: Leaving directory `/home/cruiser/NVIDIA_GPU_Computing_SDK/C/common'
    make: *** [lib/libcutil.so] Error 2
    Can you please check the file permissions of ~/NVIDIA_GPU_Computing_SDK/C and subdirectories? The above error could appear if you accidentally ran the installer with superuser privileges, i.e.:
    Code:
    sudo gpucomputingsdk_3.2_linux.run
    If this is the case, you will generally not have write permissions to the directory afterwards because it is owned by root. Please make sure you run it without 'sudo'.

  4. #4
    Join Date
    Nov 2010
    Beans
    8

    Re: Howto: Install Nvidia CUDA in Ubuntu 10.04

    Many thanks for this great tutorial, I'm going to have a bash at installing 10.04 LTS tommorow.

    Can I ask if this tutorial assumes that 10.04 is fully updated and compilers such as g++, libxi-dev,libxmu-dev etc etc are already installed... Any pointers you have referenace this would be appreciated.

    Cheers.
    ManC

  5. #5
    Join Date
    Nov 2005
    Location
    Denmark
    Beans
    19
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Howto: Install Nvidia CUDA in Ubuntu 10.04

    It is based on a default install of Ubuntu 10.04 LTS updated approximately September 23rd. I have not installed any additional packages prior to the steps of this tutorial.

  6. #6
    Join Date
    Nov 2010
    Beans
    8

    Re: Howto: Install Nvidia CUDA in Ubuntu 10.04

    Excellent stuff, will go through this tutorial today and let you know how I get on.

    Thanks.

  7. #7
    Join Date
    Nov 2005
    Location
    Denmark
    Beans
    19
    Distro
    Ubuntu 10.04 Lucid Lynx

    Question Re: Howto: Install Nvidia CUDA in Ubuntu 10.04

    Thanks, I'll appreciate any feedback. I'm interested in seeing whether installing the final 3.2 (which I haven't had time to yet) will be any different than the release candidate I based the tutorial on.

  8. #8
    Join Date
    Nov 2010
    Beans
    8

    Re: Howto: Install Nvidia CUDA in Ubuntu 10.04

    Hi,

    I made it a little further than cruis3r I think, I get the following error message when compiling the SDK examples, I've highlighted what I think to be the problem, going to go and read the thread you kindly highlighted in your tutorial (http://ubuntuforums.org/showthread.php?t=409438) as I suspect the problem lies here.

    Code:
    make -C src/SobelFilter/ 
    make[1]: Entering directory `/home/user/NVIDIA_GPU_Computing_SDK/C/src/SobelFilter'
    In file included from SobelFilter.cpp:22:
    /usr/local/cuda/include/cuda_runtime.h:145: warning: unused parameter ‘flags’
    In file included from SobelFilter.cpp:28:
    SobelFilter_kernels.h:29: warning: deprecated conversion from string constant to ‘char*’
    SobelFilter_kernels.h:29: warning: deprecated conversion from string constant to ‘char*’
    SobelFilter_kernels.h:29: warning: deprecated conversion from string constant to ‘char*’
    SobelFilter.cpp:46: warning: deprecated conversion from string constant to ‘char*’
    /usr/bin/ld: cannot find -lGL
    collect2: ld returned 1 exit status
    make[1]: *** [../../bin/linux/release/SobelFilter] Error 1
    make[1]: Leaving directory `/home/user/NVIDIA_GPU_Computing_SDK/C/src/SobelFilter'
    make: *** [src/SobelFilter/Makefile.ph_build] Error 2
    I'm using: -

    Ubuntu 10.04 LTS 64bit (updated 26/11/10)
    devdriver_3.2_linux_64_260.19.14.run
    cudatoolkit_3.2.12_linux_64_ubuntu10.04.run
    gpucomputingsdk_3.2.12_linux.run

    Thanks for the assistance thus far

    ManC

    -update-

    Doing the below seem to do the trick, as already said the number notation of libGL.so keeps changing with dev driver which requires manual intervention and putting right as is in my case.

    Code:
    cd /usr/lib/
    sudo rm libGL.so (file browser stated broken link prior to deletion)
    sudo ln -s libGL.so.260.19.14 libGL.so
    So for the most part this nice tutorial seem to work well

    Many thanks once again & I hope my v.small input has helped.

    Onto the below which are current versions (26/11/10)

    devdriver_3.2_linux_64_260.19.21.run
    cudatoolkit_3.2.16_linux_64_ubuntu10.04.run
    gpucomputingsdk_3.2.16_linux.run

    Wish me luck, will keep you posted on my progress...

    -update-

    All worked a treated again

    Had to do the below thou: -

    Code:
    cd /usr/lib/
    sudo rm libGL.so
    sudo ln -s libGL.so.260.19.21 libGL.so
    Happy days
    Last edited by mancubas; November 26th, 2010 at 04:49 PM.

  9. #9
    Join Date
    Nov 2009
    Beans
    1

    Re: Howto: Install Nvidia CUDA in Ubuntu 10.04

    I followed the instructions but was still having issues compiling the samples. It was solved by compiling them using sudo for some reason (sudo make).

  10. #10
    Join Date
    Jun 2009
    Beans
    78

    Re: Howto: Install Nvidia CUDA in Ubuntu 10.04

    Hi guys,

    I just freshly installed Ubuntu 10.10 and have two GPU's being

    2 x Nvidia Gigabyte N98TSL-1GI 9800GT 1G GDDR3 HDMI

    When I first installed Ubuntu I installed the Nvidia Driver to run two monitors in twinview. I was wondering if I am able to install the Cuda drivers for the spare GPU? and if so could I ask for some starting pointers?

    Thanks in Advance,

    David

    ps - I should add (and I'm sure this is reflected in the above description) that I'm a complete Ubuntu noob so simple instructions please

Page 1 of 3 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •