Welcome to visit our Blog
I. Description
- This tutorial is installed on the desktop with only one NVIDIA video card.
- The operating system is Ubuntu 14.04 (64bit).
- Dual graphics Notebook please go to ubuntu-install-cuda7.0-dual Graphics-Super Detailed tutorial
Second, prepare
Description: This article assumes that the downloaded files are under ~/dowloads/
1. Updating the operating system
sudo apt-get update
2. Download cuda7.0
Click here to download
If this version is not, you can search, as shown;
Click on "Linux x86" to select the Last "RUN" download of the "Ubuntu 14.04" line;
3. Download NVIDIA graphics driver
Click here to download
Third, verify whether the system meets the requirements 1. Verify that the video card supports CUDA
Terminal Input command,. If you only return two messages, that is, there are two video cards, you can continue the following tutorial, otherwise please move to "ubuntu-installation-cuda7.0-dual Graphics-Ultra-detailed tutorial"
| grep VGA
If the operating system is Ubuntu Server, even with an Nvidia video card, executing the above command may not return the relevant information. The command to execute at this point is to return to the lspci |grep nvidia -i
normal result.
- The terminal will display the graphics card model, look in the Https://developer.nvidia.com/cuda-gpus, whether there is your graphics card model, as long as there is, the video card support Cuda, but also can see the graphics card computing power, the larger the better.
2. View the system type
Command line enter the following command;
uname -m && cat /etc/*release
The first line shows a x86_64, indicating that the system is a x86 frame 64-bit system;
Iv. Installing NVIDIA Graphics drivers
Description: The previously downloaded Cuda7.0*.run contains NVIDIA graphics drivers and is prompted to install drivers when installed. However, since the driver Nouveau has been installed for Nvidia graphics cards in Ubuntu and the driver is running, it is a little cumbersome to install the driver, it is recommended to install the video driver separately, then install Cuda
1. Switch to Tty1
Description, Windows will use the video card, if the original driver nouveau in the window will not stop, it will not be installed successfully
Press the combination key "CTRL+ALT+F1", switch to tty1;
2. Turn off the monitor manager
- Enter
sudo stop lightdm
the command to close the monitor manager. Otherwise the old graphics card driver cannot be disabled and the new graphics driver cannot be installed.
3. Disable the old graphics driver
Note: 禁用旧的显卡驱动
This step can be done without action, the problem will be prompted when the new Nvidia graphics driver is installed later, and the appropriate option is selected to create the file.
Disable the old graphics card driver, switch to/etc/modprobe.d/, create a new file nvidia-installer-disable-nouveau.conf, enter the following to save the exit;
blacklist nouveauoptions nouveau modeset=0
At the end of the file/etc/default/grub, add a line, as shown below;
rdblacklist nouveaunouveau.modeset=0
4. Install the new driver
- Tip: If you are finished with the 3rd step and you are still unable to install the new Nvidia graphics driver after the reboot, you can install Nvidia's low version of the graphics driver via software manger (it will automatically turn off nouveau), reboot and uninstall the low version of the graphics driver, Then install the current version of the graphics driver. This will generally be successful. (Curve Salvation)
Execute the following command to install
# 切换到驱动所在的路径cd ~/Downloads# 查看驱动的名称(ls)ls# 开始安装,注意将驱动名换成你下载的驱动的名称sudo sh ./NVIDIA-Linux-x86_64-352.30.run
- During installation, depending on the prompt, select
accept
, ' Yes ' or the default option
- Option: Accept→continue→installation→ok→ok→ok
Reboot continues when the prompt restarts. (If Nouveau is not previously disabled, you are prompted to add a file to the/etc/modprobe.d/path, which is actually trying to disable nouveau.) If you get this prompt, restart your computer, run the video card installer again and start the installation again. )
After restarting, switch to TTY (CTRL+ALT+F1), turn off monitor management ( sudo stop lightdm
), rerun the Install driver command ( sudo sh ./NVIDIA-Linux-x86_64-352.30.run
)
When prompted *would you run Nvidia-xconfig utility ... , select Yes.
5. Verify that the driver is installed successfully
Open terminal and enter the following command:
cat /proc/driver/nvidia/version
If the driver version is displayed, the installation is successful. As shown in.
V. Installation of CUDA
Note that you should continue to install Cuda if the video driver is successfully installed, otherwise the installation will fail.
1. Installing dependent libraries
Please install the following dependent libraries in terminal first:
sudo apt-get install freeglut3-devsudo apt-get install build-essentialsudo apt-get install libx11-devsudosudosudosudo apt-get install libglu1-mesa-dev
2. Run Cuda installation commands
Start the installation of Cuda by running the following command in Terminal:
# 注意,将cuda名称换成自己下载的名称# 添加执行权限chmod a+x cuda_7.0.28_linux.runsudo ./cuda_7.0.28_linux.run
During installation, you will be prompted to install the nvidia driver , Opengl,cuda installation package and sample package. Only the following three are installed here. Since the latest version of Nvidia driver is already installed in the front, no installation is necessary here.
During the installation process, according to the prompts, select Accept, ' Yes ' or the default option;
... symbolic link ... Option Select Yes, otherwise no /usr/local/cuda/
, only/usr/local/cuda7.0/
After the installation is complete, start monitor management ( sudo start lightdm
) and switch back to the Windows interface.
3. Configure Environment variables
Open the terminal and add the following at the end of the file/etc/profile:
PATH=/usr/local/cuda/bin:$PATHPATH
Once saved, execute the following command to make the environment variable effective immediately
source /etc/profile
Create a new file cuda.conf in/etc/ld.so.conf.d/and add the following:
/usr/local/cuda/lib64
Execute the following command to make it effective immediately:
sudo ldconfig
4. Verify that the environment is set up
- Open terminal, enter
cuda
, press 2 times "tab", if there is a popup command prompt, it indicates the environment configuration is successful.
5. Install some other auxiliary libraries
sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev
Vi. installation of Cuda SAMPLES
1. Verify NVCC
- Enter a
nvcc --version
command that displays the version number if it is already installed, and if it is not installed, follow the prompts to complete the installation.
2. Make Cuda samples
To switch to the cuda-samples path make
, use the command:
#切换到cuda-samples所在目录#注意,换成自己的路径cd /home/xuezhisd/NVIDIA_CUDA-7.0_Samples#编译 make (安装命令 sudo apt-get install cmake)make#编译完毕,切换release目录cd ./bin/x86_64/linux/release#检验是否成功#运行实例 ./deviceQuery./deviceQuery
Displays the following results, indicating success.
Vii. installation of cuDNN1. Download CUDNN
- Official download requires registration and verification, trouble.
- I will download the file uploaded to Baidu Network, there is a need to click here to download Cudnn & Cudnn-samples
2. Installing Cudnne
#解压文件tar -zxvf cudnn-6.5-linux-x64-v2.tgz#切换路径cd cudnn-6.5-linux-x64-v2#复制lib文件到cuda安装路径下的lib64/sudo cp lib* /usr/local/cuda/lib64/#复制头文件sudo cp cudnn.h /usr/local/cuda/include/
cd /usr/local/cuda/lib64/sudo rm -rf libcudnn.so libcudnn.so.6.5sudo-s libcudnn.so.6.5.48 libcudnn.so.6.5sudo-s libcudnn.so.6.5 libcudnn.so
At this point, CUDNN completes the installation.
Viii. Articles of Reference
Ubuntu 13.04 Dual Graphics installation nvidia GT 630M Drive
Caffe + Ubuntu 14.04 64bit + CUDA 6.5 configuration instructions
Ubuntu14.04+cuda6.5+opencv2.4.9+matlab2013a+caffe configuration record (ii)
Error:module Nouveau is in use
How-to:unload nouveau and Install Nvidia Driver
Caffe installation in Ubuntu 14.04 64bit
Ubutu14.04lts+opencv2.4.9+matlab 2014A+CAFFE+CUDNN
Optimus Dual graphics with Bumblebee3.0 under ubuntu12.04 configuration CUDA4.2
Ubuntu 14.04 nvidia graphics driver installation and setup
Ubuntu 11.10 Drive GTX 460 graphics card disabled Nouveau
Error: During startup, there are two errors that can be resolved by executing the following command.
sudo apt-get purge nvidia-304sudo apt-get install nvidia-331
ubuntu-installing-cuda7.0-supports-ultra-detailed tutorial