Reference article: https://blog.csdn.net/u012235003/article/details/54575758
Ready to work
- Cuda official website to download the installation file
- Enter text line mode
# install CUDA - Close graphical interface
sudo service lightdm stop
- Run cuda file
First to cuda executable permissions:
sudo chmod a+x filename
- Run cuda file
sudo ./filename --no-opengl-libs
Option to select the installation process
read the statement, keep pressing D can then accept
the option install nvidia accelerated Graphics Driver, enter n, as previously has been the nvidia driver install
options install the OpenGL libraries, if dual graphics cards (set was + alone significantly) selected n, if only significant independence can choose y, if y dual graphics options, then there will be black or circulatory problems logged, if coupled with the above parameters will not have this option
back can choose yes, we can choose the last option n, that is not copied sample, because there are sample installation directoryRestart the graphical interface
sudo service lightdm start
- Environment Configuration
After installation, restart open input terminal
export PATH="/usr/local/cuda-9.2/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/cuda-9.2/lib64:$LD_LIBRARY_PATH"
These two lines of command is to export cuda bin and lib files to the file system environment.
If the installed version is not the same, replace cuda-9.2 path
Detecting whether the installation is successful
Check the path
if there are multiple files at the beginning of the nvidia, if not, incorrect installation, please refer to the solution under an article under ~ / devCheck the CUDA Toolkit is successfully installed
terminal and type:nvcc -V
Outputs CUDA version information
Examples of samples compiled
into the Samples directory, then the directory input terminal make, waiting for ten minutes.After compilation the test
can then find Sample inside surface bin / x86_64 / linux / release / directory, that directory and switch to run the program deviceQuerysudo ./deviceQuery
See the output, focusing on the last line, Pass is indicated by the test
Run bandwidthTest program
sudo ./bandwidthTest
See the output displayed by the test results are expressed as PASS
If the above step indicates successful installation CUDA