Caffe Installation (2): Cuda installation

Source: Internet
Author: User

Install some dependencies first

$sudo apt-get Install Freeglut3-dev build-essential libx11-dev libxmu-dev libgl1-mesa-dev Libglu1-mesa Libglu1-mesa-dev Libxi-dev

There are two options for offline Installation: Debian installation package; Run Installation method

Deb Installation Method

This is the case with Cuda 7.5 for 14.04, preferably MD5 validation of cuda installation files prior to this

$ md5sum Cuda-repo-ubuntu1404-7-5-local_7.5-18_amd64.deb

If the resulting checksum is consistent with the official website, you can continue the installation, or try a different version.

Next, install Cuda

$ sudo dpkg-i cuda-repo-ubuntu1404-7-5-local_7.5-18_amd64.deb

$ sudo apt-get update

$ sudo apt-get install Cuda

Run Installation Method

Here is the Cuda 7.0 example (if GPU support, try to install 7.5, some frameworks such as TensorFlow only support 7.5)

Press CTRL+ALT+F1 to enter the command prompt to create a new blacklist file

# sudo vi/etc/modprobe.d/blacklist-nouveau.conf

in which you enter

Blacklist nouveau

Options Nouveau modset=0

Save exit (: Wq)

And then execute

$ sudo update-initramfs-u

Executive Lspci | grep nouveau See if there is content

$ LSPCI | grep nouveau

If there is no content, the description is disabled successfully, if there is content, reboot and then view

$ sudo reboot

Close LIGHTDM

$ sudo service LIGHTDM stop

Next CD into your Cuda directory to install Cuda 7.0

First verify the MD5 code

$ md5sum Cuda_7.0.28_linux.run

This version of MD5 =312aede1c3d1d3425c8aa67bbb7a55e

$ CD where you store the Cuda run file

$ sudo sh cuda_7.0.28_linux.run--no-opengl-libs

When installing, let you first look at a bunch of text (EULA), press SPACEBAR to 100%, then enter a bunch of accept,yes,yes or carriage return to install. The installation directory is selected as the default directory.

After the installation is complete, reboot and use LS to see if there are four or so folders that start with Nvidia

# ls/dev/nvidia*

If there is, the installation is successful, if not, may not succeed, need to unload load. The uninstall command is as follows:

$ sudo/usr/local/cuda-7.5/bin/uninstall_cuda_7.5.pl

$ sudo/usr/bin/nvidia-uninstall

$ sudo apt-get--purge remove nvidia*

Clear Drive

To this, both of the above installation methods are completed, the following set environment variables, validation, compile test samples

Set Environment variables First

Open profile

$ sudo gedit/etc/profile

Add the following two lines at the end to save

Export Path=/usr/local/cuda-7.5/bin: $PATH

Export ld_library_path=/usr/local/cuda-7.5/lib64: $LD _library_path

Then make it effective

$ source/etc/profile

Next verify the driver version, in fact, the main thing is to ensure that the driver is installed properly

$ cat/proc/driver/nvidia/version

$ nvcc-v

Compile samples, enter/usr/local/cuda/samples, execute the following command to build samples

$ cd/usr/local/cuda/samples

$ sudo make all–j32

The number 32 behind the-j32 here is your number of threads, such as my machine has 32 threads.

To speed up make.

The whole process is about a few minutes, all compiled, then CD into Samples/bin/x86_64/linux/release, run Devicequery

$./devicequery

If the video card information appears, then the driver and the video card installation is successful, if there are multiple GPU, here will be all displayed, if it fails, it is best to uninstall Cuda reload. ( the information below is sticky on the web, so the GPU is not on it)

./devicequery starting ...

CUDA Device Query (Runtime API) version (Cudart static linking)

Detected 1 CUDA capable device (s)

Device 0: "GeForce GTX 670"

CUDA Driver version/runtime Version 6.5/6.5

CUDA Capability Major/minor Version number:3.0

Total amount of global memory:4095 MBytes (4294246400 bytes)

(7) Multiprocessors, (192) Cuda cores/mp:1344 cuda cores

GPU Clock rate:1098 MHz (1.10 GHz)

Memory Clock rate:3105 Mhz

Memory Bus Width:256-bit

L2 Cache size:524288 bytes

Maximum Texture Dimension Size (x, Y, z) 1d= (65536), 2d= (65536, 65536), 3d= (4096, 4096, 4096)

Maximum layered 1D Texture Size, (num) layers 1d= (16384), 2048 layers

Maximum layered 2D Texture Size, (num) layers 2d= (16384, 16384), 2048 layers

Total amount of constant memory:65536 bytes

Total amount of shared memory per block:49152 bytes

Total number of registers available per block:65536

Warp size:32

Maximum number of threads per multiprocessor:2048

Maximum number of threads per block:1024

Max dimension size of a thread block (x, Y, z): (1024, 1024, 64)

Max dimension size of a grid size (x, Y, z): (2147483647, 65535, 65535)

Maximum Memory pitch:2147483647 bytes

Texture alignment:512 bytes

Concurrent copy and kernel Execution:yes with 1 copy engine (s)

Run time limit on Kernels:yes

Integrated GPU sharing Host Memory:no

Support Host page-locked Memory Mapping:yes

Alignment requirement for Surfaces:yes

Device has ECC support:disabled

Device supports Unified Addressing (UVA): Yes

Device PCI Bus id/pci location id:1/0

Compute Mode:

< Default (multiple host threads can use:: Cudasetdevice () with device simultaneously) >

Devicequery, Cuda Driver = Cudart, cuda Driver Version = 6.5, cuda Runtime Version = 6.5, Numdevs = 1, Device0 = GeForce G TX 670

Result = PASS

Caffe Installation (2): Cuda installation

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.