Ubuntu 11.04 Installation cuda5.0

Source: Internet
Author: User
Tags cuda toolkit

Because of the experimental needs, on October 15, 2016 Ubuntu11.04 install cuda5.0, but from the Internet to find Ubuntu11.04 only the corresponding supported CUDA4 version, CUDA 5.0 Previous version does not support IDE nisght, For debugging to bring a lot of trouble, and so after the loading, only to understand why Nvidia does not support Ubuntu11.04 Cuda 5.0, because the GCC compiler version does not correspond, Ubuntu11.04 The default compiler is gcc4.5, but cuda5.0 corresponding compiler must be gcc4.6, this need to adjust, first download cuda5.0 installation files on the official Nvidia website and preferably in English directory, download the following page: HTTPS ://developer.nvidia.com/cuda-downloads here to download the Ubuntu 11.10 Package, download the attention to the operating system bit wide selection, my 32-bit system, so choose Ubuntu 11.10 32bit version. Download the package here for the complete installation package, including graphics drivers, toolchain and samples. To use Cuda best to install the latest version of the driver, the specific hardware and software environment can meet the CUDA installation requirements may refer to NVIDIA Cuda Getting Started Guide for Linux, here focus on the driver version, in Nvidia Cuda Toolkit v5.0 Release notes, you can see:
the CUDA 5.0 Toolkit and samples require the associated CUDA driver version to is at least 304.54 on Linux and at least 306.94 on Windows.
If the previously installed Linux driver is less than 304.54, then install it again, at least cuda5.0 's full installation package will ensure that Cuda is working properly. I installed the system directly after the installation of the video card driver, so do not remove the original driver, if you have installed the Nvidia additional driver Ubuntu provided, it is best to first remove the driver, I was the last time without removing the driver installed cuda5.0 package Results a lot of problems.
        Execute the following command in the terminal:

$ sudo apt-get –purge remove Nvidia-GLX Nvidia-glx-new
$ sudo apt-get –purge Remove Nvidia-settings nvidia-kernel< Span class= "pun" >-common

The original drive after the removal of the best reboot, if there is a screen when the start of the display when the original driver has been uninstalled, online some netizens also said that the need to add Ubuntu integrated nvidia driver blacklist to prevent conflict, if not previously installed Ubuntu additional driver, is possible , otherwise the Ubuntu integrated driver must be blacklisted, specifically to modify the/etc/modprobe.d/blacklist.conf file (this is not enough here to see the previous Installation cuda4.3 tutorial):

sudo gedit /etc/modprobe. D/blacklist. conf

At the end, add the following two lines and restart:

blacklist nouveauoptions nouveau modeset=0 After the reboot we also need to complete other things, in the installation of CUDA samples need a contribution library file libglut.so, the default is not installed, under the terminal input (for Ubuntu here needs to update the source can be installed, but also need to ubuntu12.04 source):

$ sudo apt-get install freeglut3

This shared library for 32-bit Ubuntu is installed in/usr/lib/i386-linux-gnu/libglut.so.3, while for 64-bit Ubuntu is installed in/usr/lib/x86_64-linux-gnu/ Libglut.so.3, but Cuda will go looking for/usr/lib/libglut.so by default, so we need to add a soft link.
For 32-bit systems, enter under Terminal:

$ sudo ln -s /usr/lib/i386-Linux-GNU/libglut. So. 3 /usr/lib/libglut. so

For 64-bit systems, enter under Terminal:

sudo ln -s /usr/lib/x86_64-linux-GNU/libglut. So. 3 /usr/lib/libglut. so

Next Press CTRL + ALT + F1 into the TTY command line terminal, after login to first will Ubuntu X server off, for red Hat/centos directly execute sudo stopx, and Ubuntu12.04 needs to use LIGHTDM as its x Server ( Note: Earlier versions of Ubuntu use GDM as its X server, which is one of the differences between 12.04 off X server and earlier versions. In addition, the window manager under KUbuntu12.04 is KDM and not LIGHTDM), so we need to do it under the terminal:

sudo service LIGHTDM stop

After successful switching to the Cuda installation directory, the default cuda is not executable, so Cuda is first given the ability to execute:

$ chmod +x cuda_5. 0.35_linux_32_ubuntu11. Ten-1.run

Then we install it with root privileges:

$ sudo ./cuda_5. 0.35_linux_32_ubuntu11. 1.run (do not update gcc before installation, here gcc4.5 to install successfully )

The first installation may prompt for a restart, reboot, and then install according to the above steps. First, you will be prompted to install the Nvidia graphics driver, then install Toolkit, and finally install samples, all the way up and follow the default path (carriage return) to install. Install the log file in the/tmp directory, if the installation process encountered any problems, according to the problem can be found on the internet corresponding solutions, but I have not encountered the first time in the absence of libglut.so files, no other problems encountered. When the installation is complete, you will be prompted to set environment variables and shared library paths:
* Please make sure your PATH includes/usr/local/cuda-5.0/bin
* Please make sure your ld_library_path
* for 32-bit Linux distributions Includes/usr/local/cuda-5.0/lib
* for 64-bit Linux distributions Includes/usr/local/cuda-5.0/lib64:/lib
* OR
* for 32-bit Linux distributions Add/usr/local/cuda-5.0/lib
* for 64-bit Linux distributions add/usr/local/cuda-5.0/lib64 and/lib
* to/etc/ld.so.conf and run ldconfig as root

* To uninstall Cuda, remove the CUDA files in/usr/local/cuda-5.0
* Installation complete

cuda_getting_started_guide_for_linux.pdf In/usr/local/cuda-5.0/doc/pdf For detailed information on Setting up CUDA.

Logfile Is/tmp/cuda_install_1939.log
After the installation is complete, we need to switch back to the graphical interface to verify that the video card is successfully installed, enter:

$ sudo service lightdm start

If the driver installation is successful, you can cut back to the login screen, and there will be Nvidia Big logo (this is a bit disgusting), if you want to remove the login screen before the NVIDIA logo, you need to do some manual changes in the xorg configuration file.

sudo gedit /etc/X11/xorg. conf

In the device section, find the driver "nvidia" line, after this line, plus: Option "Nologo" is available after saving. But I installed the driver actually can't find xorg.conf, later looked up the new version of it seems to be the default without xorg, but we can use the command to generate xorg.conf:

$ sudo nvidia-xconfig

Next, verify that the installation is successful and enter it under Terminal:

$ nvidia-settings

The following interface appears:

You can see the Nvidia Driver version:304.54 to see if the video card is ready to run, enter:

$ glxinfo | grep rendering

If direct Rendering:yes appears, the video card is running.
In addition, if you have not previously installed the Glxinfo command, you need to install the development package Mesa-utils:

$ sudo apt-get Install Mesa-utils

The next task is to configure CUDA Toolkit environment variables, terminal input (environment variables also refer to the cuda4.3 installation tutorial):

$ sudo gedit /etc/ profile

In the last join: Export path=/usr/local/cuda-5.0/bin: $PATH
After saving the exit, and then source, so that the modified environment variable immediately, in the terminal input:

$ source /etc/ profile

However, this method is limited to the terminal, there is no global effect, after a reboot can enable the global effect. Next, add the path to the shared library:
1. For red Hat/centos, you can add a path directly to the/etc/profile:
For 32-bit systems: Export ld_library_path=/usr/local/cuda-5.0/lib: $LD _library_path
For 64-bit systems: Export ld_library_path=/usr/local/cuda-5.0/lib64:/lib: $LD _library_path
2. For Ubuntu 8.10 later version, export Ld_library_path is no longer applicable in/etc/profile, you need to modify the path to add shared libraries in/etc/ld.so.conf, one line, for reference:/HTTP blog.163.com/thinki_cao/blog/static/83944875201302713822395/
For 32-bit system additions:/usr/local/cuda-5.0/lib
For 64-bit system additions: (one line)
/usr/local/cuda-5.0/lib64
/lib
You will need to make the modified path effective after adding it, this method does not need to be restarted:

$ sudo ldconfig

Execute the command again to verify that the path was added successfully

$ ldconfig -v| grep cuda

The associated path will appear:
/usr/local/cuda-5.0/lib:
libcudart.so.5.0-libcudart.so.5.0.35
libicudata.so.48-libicudata.so.48.1.1
Libcuda.so.1-libcuda.so.304.54 here need to install gcc4.6,g++4.6, because cuda5.0 only support 4.6 version, upgrade the source above Ubuntu12.04, you can upgrade, specific upgrade method, as long as Apt-get install installation, change the link gcc in usr/bin (g++) link is available. Now that the CUDA Toolkit environment is configured, the next step for compiling the cuda5.0 samples (that is, the previous GPU Computing SDK) is to install some development packages and enter them under the terminal:

sudo apt-get install g++ openmpi-bin openmpi-doc libopenmpi-dev freeglut3-dev libxi-dev Libxmu-dev

The default samples is installed in the user's home directory, and the following begins to compile:

$ cd ~/nvidia_cuda-5.0_samples/

$ make -J4

Here multithreaded compilation, for the dual-core and more cores of the CPU can significantly reduce the compile time, compile samples or time-consuming. After the compilation is complete, execute:

$ cd Nvidia_cuda-5.0_samples/bin/Linux/release/

$ ./devicequery

If all goes well, this information will appear similar to the following:

Ubuntu 11.04 Installation cuda5.0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.