Article Directory
table of Contents
Install CUDA
CUDA is a computing platform launched by graphics card manufacturer NVIDIA. CUDA™ is a general-purpose parallel computing architecture launched by NVIDIA. It is a parallel computing platform and programming model that enables GPUs to solve complex computing problems. The full English name of CUDA is Compute Unified Device Architecture.
Some people say: CUDA is a programming language, like C, C++, python, and some people say CUDA is an API.
The official said: CUDA is a parallel computing platform and programming model that can make the use of GPU for general computing simple and elegant.
To run CUDA applications, the system requires at least one GPU with CUDA functions and a driver compatible with the CUDA Toolkit.
View CUDA version command:nvcc -V
ornvcc --version
orcat /usr/local/cuda/version.txt
Each version of CUDA Toolkit corresponds to a minimum version of CUDA Driver (graphics driver version), see the table below for details. CUDA Driver download , CUDA Toolkit download , CUDA Driver installation tutorial , CUDA Toolkit installation tutorial 1 , CUDA Toolkit installation tutorial 2
Install CUDA Driver core commands:
sudo sh ./NVIDIA-Linux-x86_64-???.??.run
refer to other blogs for detailed tutorials
Need to know: CUDA Toolkit and CUDA Driver graphics driver have version correspondence.
But at the same time: Multiple versions of CUDA (such as CUDA 9.0, CUDA 10.1) can be installed on the same machine (that is, the same CUDA Driver version). You only need to meet the CUDA version supported by the current CUDA Driver version. See The following figure.
My understanding: installing CUDA means installing the CUDA Toolkit (That means no driver), is to download the CUDA Toolkit installation .run file (such as cuda_9.0.176_384.81_linux.run) from the official website to install it.
Install TensorRT
According to this installation followed by cudnn
Install cudnn
Download as required
Unzip the downloaded file, you can see the cuda folder, open the terminal in the current directory, and execute the following command:
sudo cp cuda/include/cudnn.h /usr/local/cuda/include/
sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64/
sudo chmod a+r /usr/local/cuda/include/cudnn.h
sudo chmod a+r /usr/local/cuda/lib64/libcudnn*
Verify installation
cat /usr/local/cuda/include/cudnn_version.h | grep CUDNN_MAJOR -A 2
zhongsy@zhongsy:~$ cat /usr/local/cuda/include/cudnn_version.h | grep CUDNN_MAJOR -A 2
#define CUDNN_MAJOR 8
#define CUDNN_MINOR 0
#define CUDNN_PATCHLEVEL 5
--
#define CUDNN_VERSION (CUDNN_MAJOR * 1000 + CUDNN_MINOR * 100 + CUDNN_PATCHLEVEL)
#endif /* CUDNN_VERSION_H */