Hardware environment: CPU i5-6400; graphics card GTX1050ti
System environment: Ubuntu16.04
1. Install Ubuntu 16.04 dual system
1. Use UltraISO to make and install a bootable U disk
2. Partition the Windows disk for Ubuntu "See Install Ubuntu 16.04 Dual System under Windows "
3. Restart the computer, press and hold F11 <I have a colorful motherboard , different motherboards have different settings>, select the U disk boot method
without UEFI "See the explanation in Installing Ubuntu 16.04 Dual System under Windows "
4. For the follow-up installation steps, please refer to " Ubuntu 16.04 Installation Basics Getting Started Tutorial ", including the partition situation. My partition situation is as follows:
5. The installation is over
Second, install the graphics card driver
Step 1. After my system is installed and restarted, the screen keeps flashing, Ctrl+Alt+F1 is invalid to enter the command line
Solution: "See Deep Learning Host Environment Configuration: Ubuntu16.04 + GeForce GTX 1070 + CUDA8.0 + cuDNN5.1 + TensorFlow in Installing GTX1070 Driver "
- Restart the computer, press e on the boot item (GRUB menu selection) screen to enter the boot item editing mode, leave a space at the end of the Linux line and add "acpi_osi=linux nomodeset", then press F10 to use the edited boot item to start (The nomodest parameter is to tell the kernel not to load the graphics driver and use the BIOS mode until the graphical interface runs, see here for details).
- After turning it on again, I found that it was still flashing, but this time tty1-6 can be used
- Press Ctrl+Alt+F1 to switch to the console interface, enter the username and password to log in
Step 2. Disable the nouveau driver. See
here " Ubuntu16.04 + 1080Ti Deep Learning Environment Configuration Tutorial Part 1. Install Ubuntu16.04 and Graphics Card Driver "
Step 3. Disable X desktop service
sudo service lightdm stop
Step 4. Install the NVIDIA graphics card driver, the command is as follows: "See Deep Learning Host Environment Configuration: Ubuntu16.04 + GeForce GTX 1070 + CUDA8.0 + cuDNN5.1 + TensorFlow in the installation of GTX1070 driver ", restart after input
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install nvidia-367
sudo apt-get install mesa-common-dev
sudo apt-get install freeglut3-dev
- 1
- 2
- 3
- 4
- 5
Step 5. Enter nvidia-smi. If the following figure appears, the graphics card driver is successful. You can also enter nvidia-settings
3. Install CUDA 8.0: cuda_8.0.44_linux.run
- CUDA 8.0 official address When downloading, you need to select the runfile type file. The specific selection type is shown in the following figure:
Because the download is very slow, the Baidu network disk address is specially posted .
- The installation process is as follows: <Continue to disable X Desktop Services>
sudo service lightdm stop
sudo sh cuda_8.0.44_linux.run
- 1
- 2
Note : There will be a series of prompts for you to confirm after execution, but note that when there is a driver that allows you to choose whether to install nvidia361 (it will be different for different installation versions ), you must choose no :
Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 361.62?
- 1
Because we have installed a newer nvidia367 earlier, so do not choose to install here. The rest are just default or choose yes. "Refer to (2) Install CUDA in Ubuntu16.04+CUDA8.0+caffe configuration here "
- After the installation is successful, the following interface will appear: "See Ubuntu 16.04+CUDA8.0+Caffe Installation Tutorial 2. Install CUDA "
===========
= Summary =
===========
Driver: Not Selected
Toolkit: Installed in /usr/local/cuda-8.0
Samples: Installed in /home/textminer
Please make sure that
– PATH includes /usr/local/cuda-8.0/bin
– LD_LIBRARY_PATH includes /usr/local/cuda-8.0/lib64, or, add /usr/local/cuda-8.0/lib64 to /etc/ld.so.conf and run ldconfig as root
To uninstall the CUDA Toolkit, run the uninstall script in /usr/local/cuda-8.0/bin
Please see CUDA_Installation_Guide_Linux.pdf in /usr/local/cuda-8.0/doc/pdf for detailed information on setting up CUDA.
***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 361.00 is required for CUDA 8.0 functionality to work.
To install the driver using this installer, run the following command, replacing with the name of this run file:
sudo .run -silent -driver
Logfile is /opt/temp//cuda_install_6583.log
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- Environment variable configuration ( you can also modify it directly in the /home directory, the .bashrc file is hidden, and Ctrl+h can be displayed )
Open the ~/.bashrc file:
sudo vi ~/.bashrc
- 1
Write the following to the end of ~/.bashrc:
export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
- 1
- 2
Then execute sudo ldconfig to make the link take effect immediately.
- After the installation is complete, a NVIDIA_CUDA-8.0_Samples folder will be generated in the home directory, where you can test CUDA 8.0.
enter:
cd ~/NVIDIA_CUDA-8.0_Samples/1_Utilities/deviceQuery
make
sudo ./deviceQuery
- 1
- 2
- 3
Result: ( different for different installed versions )
./deviceQuery Starting...
CUDA Device Query (Runtime API) version (CUDART static linking)
Detected 1 CUDA Capable device(s)
Device 0: "GeForce GTX 1070"
CUDA Driver Version / Runtime Version 8.0 / 8.0
CUDA Capability Major/Minor version number: 6.1
Total amount of global memory: 8105 MBytes (8499167232 bytes)
(15) Multiprocessors, (128) CUDA Cores/MP: 1920 CUDA Cores
GPU Max Clock rate: 1759 MHz (1.76 GHz)
Memory Clock rate: 4004 Mhz
Memory Bus Width: 256-bit
L2 Cache Size: 2097152 bytes
Maximum Texture Dimension Size (x,y,z) 1D=(131072), 2D=(131072, 65536), 3D=(16384, 16384, 16384)
Maximum Layered 1D Texture Size, (num) layers 1D=(32768), 2048 layers
Maximum Layered 2D Texture Size, (num) layers 2D=(32768, 32768), 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 2 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 Domain ID / Bus ID / location ID: 0 / 1 / 0
Compute Mode:
< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >
deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 8.0, CUDA Runtime Version = 8.0, NumDevs = 1, Device0 = GeForce GTX 1070
Result = PASS
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
You can also enter nvcc –version to test whether the CUDA Toolkit is installed correctly. If the output is similar to the following information, it can be considered that the installation is correct.
4. Download cuDNN: cudnn-8.0-linux-x64-v5.1.tgz
cuDNN is a module used by NVIDIA to accelerate deep learning. Note that you must first register an NVIDIA account and download it after confirming the terms. cuDNN official address ; Baidu network disk address .
Installing cuDNN is very simple:
Enter the folder where cuDNN is stored and enter:
tar -zxvf cudnn-8.0-linux-x64-v5.1.tgz
- 1
After decompressing the installation package, the cuda folder will appear in the current directory, and copy the files in it to the corresponding directory of the system
sudo cp -a cuda/include/cudnn.h /usr/local/cuda/include/
sudo cp -a cuda/lib64/libcudnn* /usr/local/cuda/lib64/
- 1
- 2
3. Install keras and TensorFlow-gpu
pip install keras
pip install tensorflow-gpu
- 1
- 2
4. Install Pycharm
- Download the latest version of PyCharm and choose to download the free Community.
- After downloading, put the installation package in the Downloads directory, enter Downloads and decompress it.
cd Downloads/
tar xfz pycharm-*.tar.gz
- 1
- 2
- Run the pycharm.sh file in the bin directory in the unzipped folder to open Pycharm.
./pycharm.sh
- 1
Note :
After continuing to install Pycharm, there may be a problem that the module cannot be imported. The solution is to add the following path to the .bashrc file.
export LD_LIBRARY_PATH=/usr/local/cuda/lib64/
- 1
final execution
source ~/.bashrc
- 1
references:
- Ubuntu16.04+GTX1050+CUDA8.0 configure deep learning environment
- Ubuntu tensorflow-gpu + keras
- Deep learning host environment configuration: Ubuntu16.04 + GeForce GTX 1070 + CUDA8.0 + cuDNN5.1 + TensorFlow
- [Deep Learning] Ubuntu16.04 + GTX 1050 + cuda8.0 + cuDNN5.1 + caffe installation details
- Ubuntu16.04 + 1080Ti deep learning environment configuration tutorial
- Ubuntu16.04+Pycharm+Anaconda配置
- After building TensorFlow from source, seeing libcudart.so and libcudnn errors
- DQN Actual Chapter 1 Install Ubuntu, Cuda, Cudnn, Tensorflow, OpenAI Gym from scratch
- ubuntu 16.04+cudn Baidu search