Note: This article is original, Noah Zhang (http://www.cnblogs.com/noahzn/)
decided to join the army of deep learning, thanks to the mentor to a new equipment! The first contact with the server and configuration of the development environment, the whole process encountered a lot of pits, but fortunately in the end have been successfully resolved. But a little worry, Tesla k40c By default also need an auxiliary power supply, I currently only plug in 8pin power supply interface, 6pin power supply interface is not plugged in, do not know whether the subsequent calculation will be affected ... Afraid of the heart ...
first, report the hardware configuration:
Server: Lenovo TD350:
Cpu:intel®xeon (R) CPU e5-2620 v4 @ 2.10ghzx32
Memory: 16GX2 Strips
HDD: 2TB
Graphics: Tesla k40c
First, install Ubuntu16.04 LTS 64bit
Download the installer ISO file by yourself and make it into a USB boot disk using UltraISO. Installation.
Second, installation CUDA8.0
Tesla k40c is a pure computing card, after switching to this video card, can not display GUI interface, according to the classmate's saying "another display as a single show", although feasible, but wasted a single display. The following methods can be used to display the Intel self-brought set, the operation and then switch to the Tesla k40c.
1. Check that the video card is correctly identified:
In the terminal, enter:
grep -I. nvidia
Show:
Bayi:00.0 3D controller:nvidia Corporation Gk110bgl [Tesla k40c] (rev A1)
2. View the GCC installation version:
gcc --version
Show:
GCC 5.4. 0-6ubuntu1~16.04. 4 5.4. 0 20160609 for copying conditions. for merchantability or FITNESS for A particular PURPOSE.
3. Check to see if an installed Nvidia driver is available:
If so, please uninstall. My server is new, so the wood has been installed.
Lsmod grep nvidia
4. View the set drive:
Lsmod grep Nouveau
5. Download CUDA8.0:
To download the corresponding version of the driver, please download the. Run format installation file, do not download the Deb format! Place the installation files in any directory.
6. Disable the graphics driver:
Ctrl + Alt + F1 into the Tty1 interface.
To turn off desktop services:
sudo service LIGHTDM stop
Add your own video driver to the blacklist:
cd/etc/modprobed/sudotouch blacklist-nouveau.confsudosu Root Echo " blacklist nouveau ">>blacklist-echo"options nouveau modeset=0" >>blacklist-nouveau.conf
Immediate effect:
sudo update-initramfs-u
Reboot the system.
7. Cuda Installation:
Enter Tty1 again, and turn off the desktop service again to find the path that was just stored. Run Setup, install it, follow the parameters!!
sudo ./cuda_8. 0 --no-opengl-libs
Follow the prompts, enter Yes or carriage return, and turn on desktop Services after loading:
sudo service lightdm start
Reboot.
8. Subsequent configuration:
Create a/etc/x11/xorg.conf file with the following content:
Section"Device"Identifier"Intel"Driver"Intel"Busid"Pci:[email protected]:2:0"Option"Accelmethod" "SNA"endsection
Open File/etc/default/grub, add a parameter after Grub_cmdline_linux_default: "Nogpumanager".
Immediate effect:
sudo update-grub
9. Configure Environment variables:
/etc/profile file Last added two lines:
Export path= $PATH:/usr/local/cuda-8.0/bin export ld_library_path=/usr/local/cuda-8.0 /lib64:/lib
My cuda is installed in the default location, if you are not, please modify the above path.
Immediate effect:
Source/etc/profile
10. Verify the installation:
Terminal input:
Lsmod grep nvidia
Show:
NVIDIA_DRM 45056 0nvidia_modeset 765952 1 Nvidia_drmnvidia 11485184 1 nvidia_modesetdrm_kms_helper 147456 2 ast,nvidia_drmdrm 360448 6 ast,ttm,drm_kms_helper,nvidia_drm
Terminal input:
Nvcc-v
Show:
2005- NVIDIA corporationbuilt on sun_sep__4_22:8.0, V8. 0.44
Third, installation Anaconda3
Download python3.5 version of the official website, CD to the installer directory to execute:
sudo SH anaconda3-4.2. 0-linux-x86_64. SH
When you are prompted to add an environment variable during installation, choose Yes.
Iv. installation of MATLAB2016A
Download the cracked version of the MATLAB ISO image, the CD to the image file directory to execute:
sudo Mount -t iso9660-o loop r2016a_glnxa64.iso//mnt. /Install
First enter the crack folder within the serial number, after loading, the cracked folder in the beginning of the two lib files copied to the/usr/local/matlab/r2016a/bin/glnxa64/directory, pay attention to the operation of the permissions.
Open matlab:
cd/usr/local/matlab/r2016a/bin. /matlab
Locate the Lic file in the cracked folder.
To install a plugin:
sudo Install Matlab-support
Follow the requirements to enter the upper directory of the Bin folder where Matlab executes the program.
In the future, you can enter MATLAB directly in the terminal to start!
V. Installation of OPENCV3.1
Let's install a variety of libraries that may be used:
sudo apt-get update
sudo apt-get install build-essential
sudo install libopenblas-devsudoinstall liblapack-sudo Install Libatlas-base-dev
sudo apt-get install libgtk2. 0-dev pkg-config libavcodec-dev libavformat-dev Libswscale-dev
Install CMake, git, here also installs the next CMake GUI program, the subsequent compilation OpenCV us to operate in the GUI interface!
sudo install cmake git Cmake-qt-gui
Download opencv3.1 source code and extension package source code:
cd/home/noah/mkdir OpenCV
mkdir BUILDCD opencvgit clone https://github.com/itseez/opencv.gitgit clone https: // Github.com/itseez/opencv_contrib.git
Compile to the build folder you just created using Cmake-gui
Terminal input:
Cmake-gui
The configuration method can refer to I compile OpenCV in Windows blog post, mainly to see Anaconda these have not been detected, but also in the extension package path to select/opencv_contrib/modules folder.
After compiling, the terminal enters the build folder:
make-j16
Everyone changes the number according to their CPU, oh, make process will be very long, especially to Opencv_perf_stitch and Python3 These two steps, estimated to wait 40 minutes .... When finished, install:
sudo Make Install
After the installation, detect, terminal input python, and then import Cv2 try, if there is said what libstdc++.so.6 have a problem, soft connection:
sudo Ln -sf/usr/lib/x86_64-linux-gnu/libstdc++.so. 6.0. /home/noah/anaconda3/lib/libstdc++.so. 6
Similarly, if there is a problem with the Libgomp.so.1 file, also soft connection:
sudo Ln -sf/usr/lib/x86_64-linux-gnu/libgomp.so. 1 /home/noah/anaconda3/lib/libgomp.so. 1
Then import CV2 will be able to ~ ~ ~
Vi. installation of CuDNN5.1
Go to the official website to download the latest version cudnn5.1,tga format.
Terminal input:
tar -zxf cudnn-8.0-linux-x64-v5. 1 . tgz CD cuda/sudocp lib64/* /usr/local/cuda-8.0/lib64/sudo CP include /cudnn.h/usr/local/cuda-8.0/include/
Vii. installation of Mxnet
Download mxnet:
git clone https://github.com/dmlc/mxnet.git ~/mxnet--recursive
Modify the/mxnet/make/config.mk, change the use_cudnn=0, use_cuda=0 to = 1, and specify the CUDA path:/usr/local/cuda, compile under the mxnet root directory:
make-j16
Cd/mxnet/python directory, execute:
Install
Run down the sample program ~ ~ cd/mxnet/example/image-classification/, execute:
--gpus 0
No problem, then OK!!
Attached: References
Http://www.cnblogs.com/muchong/p/6093328.html
https://my.oschina.net/u/1046919/blog/479947
Http://www.cnblogs.com/gaowengang/p/6068788.html
Http://mxnet.io/get_started/setup.html#installing-mxnet
Http://jingyan.baidu.com/article/d45ad148a78cbe69552b8089.html
Server with Tesla k40c installed Ubuntu16.04 and install CUDA8.0, Anaconda3, matlab2016a, OPENCV3.1, CuDNN5.1, MXNet