Install CUDA 10.1 without APT repository on Linux Mint 19.3

by Ugnius Malūkas

These days many people use NVIDIA graphic cards for increasing speed of computing time, for example, calculating outcomes of Machine Learning algorithms. In order to use a graphic processing of Nvidia GPUs, CUDA has to be installed. This article shows how to install CUDA, cuDNN and TensorRT packages without having a Nvidia APT repository.


Be sure that you have already installed Nvidia GPU drivers. My recommendation is to install it trough Driver Manager.

1) Download CUDA 10.1:

$ wget

2) Run

$ sudo sh

Screen picture:

CUDA installation

3) After installation you need open /etc/environment:

$ sudo nano /etc/environment

Append PATH in /etc/environment file with a following line:


4) Depending on your machine (64-bit or 32-bit) append LD_LIBRARY_PATH (or add if does not exist) in /etc/environment:





5) After 3rd and 4th step your /etc/environment file should look like this:

/etc/environment file

6) Restart the computer:

$ sudo reboot

Validate CUDA Installation

Go to ~/NVIDIA_CUDA-10.1_Samples/:

$ cd ~/NVIDIA_CUDA-10.1_Samples/


$ sudo make

Then go to ~/NVIDIA_CUDA-10.1_Samples/0_Simple/asyncAPI and run asyncAPI:

cd ~/NVIDIA_CUDA-10.1_Samples/0_Simple/asyncAPI

If there are no errors and just warnings, installation is complete.

Install cuDNN

Go to

Press Download cuDNN v7.6.Y, for CUDA 10.1.

Then press to download these selections: * cuDNN Runtime Library for Ubuntu18.04 (Deb), * cuDNN Developer Library for Ubuntu18.04 (Deb), * cuDNN Code Samples and User Guide for Ubuntu18.04 (Deb).

Install downloaded files:

sudo dpkg -i libcudnn7_7.6.Y.Z-1+cuda10.1_amd64.deb
sudo dpkg -i libcudnn7-dev_7.6.Y.Z-1+cuda10.1_amd64.deb
sudo dpkg -i libcudnn7-doc_7.6.Y.Z-1+cuda10.1_amd64.deb

Verify Installation:

Copy cuDNN samples:

$cp -r /usr/src/cudnn_samples_v7/ ~

Go to mnistCUDNN folder:

$ cd ~/cudnn_samples_v7/mnistCUDNN

Compile and run:

$ make clean && make

If you see Test passed! at the end of the output then installation is complete.

(Optional) Install Nvidia Libraries Required by TensorFlow

If you are planning to install TensorFlow (2.1.0+), TensorRT is needed to use that library.

1) Download and install libnvinfer6:

$ wget
sudo dpkg -i --ignore-depends=libcublas10,cuda-cudart-10-1 libnvinfer6_6.0.1-1+cuda10.1_amd64.deb

2) Download and install libnvinfer-dev:

$ wget
$ sudo dpkg -i --ignore-depends=libcublas-dev,cuda-cudart-dev-10-1 libnvinfer-dev_6.0.1-1+cuda10.1_amd64.deb

3) Download and install libnvinfer-plugin:

$ wget
$ sudo dpkg -i libnvinfer-plugin6_6.0.1-1+cuda10.1_amd64.deb


If there is a possibility of having an APT repository, I recommend installing CUDA, cuDNN and TensorRT libraries via APT because many of the above mentioned steps would not be needed and would require less effort.