Ubuntu Gnome 15.04/ubuntu 12.04 Cuda 7.0 Experience Sticker

Source: Internet
Author: User
Tags lua cuda toolkit

Ubuntu Gnome 15.04/ubuntu 12.04 Cuda 7.0 Experience Sticker

Because recently to run Caffe, there are to run some Cuda program, on the side to learn the configuration, all the way to install it is not easy, dual system (Window 7+ubuntu), make a note to stay with:

    • Premise work: Already installed dual system, if not installed well, refer to the following:
Hard drive installation and USB drive installation

[Win7 system HDD installation Ubuntu 12.04 Dual System]

Hint: After installing the Ubuntu system, if found, after the installation completed reboot default to Ubuntu system, then in the program-attachment-terminal (shortcut key Ctrl+alt+t) modified as follows: sudo mv /etc/grub.d/30_os-prober /etc/grub.d/06_os-prober ; then you will be prompted to enter the password, after the input is completed, execute the following command: At the sudo update-grub end of the system, the window launcher will appear in the boot screen.

[Win7 USB flash Drive Installation Ubuntu14.04 Two-system steps detailed]

Tips: Commonly used tools EASYBCD, Win32diskimager, UltraISO, Chinese cabbage and so on.

Download installation packages and drivers
    • To download the image file:

(1) Download the corresponding Cuda version on the official website, I choose the 7.0 version here, choose Run on it, official address: [Cuda official DOWNLOAD]
Http://developer.nvidia.com/cuda-downloads

(2) Download the corresponding graphics driver version on the official website: [NVIDIA graphics drivers]
Http://www.nvidia.cn/Download/index.aspx?lang=cn

Verifying system and installation-related packages
    • Verification System:

    • First verify the NVIDIA video card and enter the command in the terminal :

  | grep -i nvidia
    • Then verify the Ubuntu system, get the system version information, enter the command in the terminal:
uname -m && cat /etc/*release
    • Verify the GCC version again, and if there is no information, you will need to install it. Enter the following command:
gcc--version
    • To install the relevant package:

To compile and run the examples in the SDK, support for Freeglut, Mesa, and OpenGL related libraries and header files is also required, and thegetting_started_linux.pdf documentation is recommended for installation in the following command line:

sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev
Installing the NVIDIA Driver
    • To uninstall the original version driver:

If it is a newly installed Ubuntu system, where the open source Nvidia graphics driver is not activated, you can directly install the official NVIDIA download driver, if it is already activated, you need to uninstall it, and then install the official NVIDIA download driver.

    • To remove a previously activated graphics driver or an older version of the NVIDIA official driver, enter the following command in the terminal :
 sudo apt-get--purge remove nvidia-*
 sudo apt-get--purge remove xserver-xorg-video-nouveau
    • To add a command in blacklist.conf, follow the steps below and enter the command in the terminal:
 sudo nano /etc/modprobe.d/blacklist.conf  

Friendship hint: How to think that nano open inconvenient modification, here can use gedit instead of open. Command modified to: sudo gedit/etc/modprobe.d/blacklist.conf

    • After opening, at the end of the blacklist.conf file, add:
blacklist amd76x_edac  blacklist vga16fb  blacklist nouveau  blacklist rivafb  blacklist nvidiafb  blacklist rivatv  
    • After completing the above steps, save exit, then restart the computer , enter Ubuntu in the character interface input root username and password, if not directly into the character interface, press CTRL+ALT+F1 key combination to enter the Ubuntu character interface.

    • Follow the different versions of the installation, enter a different GDM command, and the command is as follows:

The following command does not absolutely apply to a version, the following command can be tried to see that it can be forbidden to enter the graphical interface.

version Command
Ubuntu 12.04 sudo stop gdm
Ubuntu Gnome sudo service gdm stop
Others version sudo stop lightgdm / sudo stop lightdm

After you complete the above steps, install the driver next:

    • Switch to the directory of the previously downloaded graphics driver via the CD command, and install the Nvidia official download driver (the one you downloaded earlier).

To get the highest privileges first:

chmod +x  驱动程序全名

Driver Full Name: I'm using nvidia-linux-x86_64-352.21.run , which is related to your graphics card.

Then install the driver by command:

sudo sh  驱动程序全名
    • Switch to the directory of the downloaded Cuda program, the default cuda is not executable, so you first give the Cuda permissions to execute (that is, you download a good Cuda program).
chmod +x  cuda程序全名

by command:

sudo sh  cuda程序全名

Enter the installation interface after entering the carriage. The first interface selects "Accept" accepts the installation protocol, the second interface, the second interface select "Yes", the back is also selected "OK" or "yes" can be installed all the way.

After installation, the character interface will be returned again, the GUI service needs to be re-opened to return to the graphical interface, sudo start LIGHTGDM or sudo service GDM start or sudo start GDM, specifically what to try on is OK.

    • Finally press the shortcut key Ctrl + Alt+f7 to return to the graphical interface, so the official driver for NVIDIA graphics card installation is complete.

Some motherboards, such as discrete graphics, may also need to set up grub to support Nvidia's graphics card, or it may not be able to enter the graphical interface properly after a reboot:
To open the Grub configuration file in the system:

sudo gedit /etc/default/grub

Add the "Nomodeset" parameter to the Grub_cmdline_linux line:
grub_cmdline_linux= "Nomodeset"
and updated:

grub:sudo update-grub
Verify that the driver is installed successfully
    • Verify that the installation is successful:

Under Terminal input:

nvidia-settings

See Nvidia Driver Version:xxx.xx, it means the installation is successful!

    • In addition, if you have not previously installed the Glxinfo command, you need to install the development package mesa-utils, enter the command in the terminal:
sudo apt-get install mesa-utils

If you are not prompted to find Mesa-utils, first update, the command is as follows:

sudo apt-get update
    • To see if the video card is ready to run, enter:
| grep rendering

If direct Rendering:yes appears, the video card is running.

Configuring Environment variables
    • Configure the CUDA Toolkit environment variable and enter it under Terminal:
sudo gedit /etc/profile

Add two lines at the end of the file (cuda-7.0 for your Cuda counterpart, remember to modify):

export PATH=/usr/local/cuda-7.0/bin:$PATHexport PATH
    • After saving the exit, and then source, so that the modified environment variable immediately, in the terminal input:
source /etc/profile

Note: This method is limited to the terminal, there is no global effect, after the restart can have a global effect.

    • Next, add the path to the shared library:

To modify the path to add a shared library in/etc/ld.so.conf, open the file:

sudo gedit /etc/ld.so.conf

For 32-bit system additions:

/usr/local/cuda-7.0/lib

For 64-bit system additions: (one line)

/usr/local/cuda-7.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

If the relevant path appears, congratulations, the installation is complete (Cuda 5.0 effect):

/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
    • Next, in order to compile cuda7.0 samples (that is, the previous GPU Computing SDK), you need to install some development packages and enter them under terminal:
sudo apt-get install g++ openmpi-bin openmpi-doc libopenmpi-dev freeglut3-dev libxi-dev libxmu-dev
Compiling work
    • The default samples is installed in the user's home directory, and the following begins to compile:
cd ~/NVIDIA_CUDA-7.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-7.0_Samples/bin/x86_64/linux/release/ ./deviceQuery

One of the cuda6.5 versions:

cd NVIDIA_CUDA-6.5_Samples/bin/linux/release/./deviceQuery
Modify screen resolution
    • The default samples is installed in the user's home directory, and the following begins to compile:

[1] Modify the/etc/x11/xorg.conf file, find section "Monitor" item, modify the VendorName and modelname items as "LCD", the line header with "#" to the Horizsync, Vertrefresh two lines.
[2] Set section "Screen" item, in which to add
Subsection "Display"
Depth 1
Modes "1024x768" "800x600" "640x480"
Endsubsection
[3] After restarting the computer, select the appropriate resolution in the graphical interface.

Congratulations, congratulations, this is the completion of all the steps, so tired! Oh

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Ubuntu Gnome 15.04/ubuntu 12.04 Cuda 7.0 experience sticker

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.