±----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 1224 G /usr/lib/xorg/Xorg 4MiB |
| 0 N/A N/A 1788 G /usr/lib/xorg/Xorg 4MiB |
±----------------------------------------------------------------------------+
$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243
$ python
Python 3.8.5 (default, Jan 27 2021, 15:41:15)
[GCC 9.3.0] on linux
torch.version
‘1.8.0+cu111’
I have installed PyTorch this way:
$ pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 torchaudio==0.8.0 -f https://download.pytorch.org/whl/torch_stable.html
Looking in links: https://download.pytorch.org/whl/torch_stable.html
Collecting torch==1.8.0+cu111
Using cached https://download.pytorch.org/whl/cu111/torch-1.8.0%2Bcu111-cp38-cp38-linux_x86_64.whl (1982.2 MB)
Collecting torchvision==0.9.0+cu111
Using cached https://download.pytorch.org/whl/cu111/torchvision-0.9.0%2Bcu111-cp38-cp38-linux_x86_64.whl (17.6 MB)
Requirement already satisfied: torchaudio==0.8.0 in /home/mona/venv/fall/lib/python3.8/site-packages (0.8.0)
Requirement already satisfied: numpy in /home/mona/venv/fall/lib/python3.8/site-packages (from torch==1.8.0+cu111) (1.20.1)
Requirement already satisfied: typing-extensions in /home/mona/venv/fall/lib/python3.8/site-packages (from torch==1.8.0+cu111) (3.7.4.3)
Requirement already satisfied: pillow>=4.1.1 in /home/mona/venv/fall/lib/python3.8/site-packages (from torchvision==0.9.0+cu111) (8.1.1)
Installing collected packages: torch, torchvision
Successfully installed torch-1.8.0+cu111 torchvision-0.9.0+cu111
Thanks a lot. I did restart again and still cannot access GPU. Do you know how I can fix it?
(fall) mona@goku:~$ python
Python 3.8.5 (default, Jan 27 2021, 15:41:15)
[GCC 9.3.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
By the way, it’s weird after I did the restart, now the NVIDIA driver is not recognized
$ nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
(fall) mona@goku:~$ python
Python 3.8.5 (default, Jan 27 2021, 15:41:15)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.is_available()
True
also:
$ nvidia-smi
Mon Mar 8 13:29:44 2021
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.39 Driver Version: 460.39 CUDA Version: 11.2 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 GeForce GTX 165... Off | 00000000:01:00.0 Off | N/A |
| N/A 42C P8 3W / N/A | 10MiB / 3911MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 1207 G /usr/lib/xorg/Xorg 4MiB |
| 0 N/A N/A 1784 G /usr/lib/xorg/Xorg 4MiB |
+-----------------------------------------------------------------------------+
@ptrblck
so I got the following error (I guess my system had an auto update), and after following all the steps I have provided in the answers above, I still get the same exact error. Do you have any tips how I could fix this?
$ nvidia-smi
Failed to initialize NVML: Driver/library version mismatch
a bit more details:
mona@goku:~$ cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module 460.39 Thu Jan 21 21:54:06 UTC 2021
GCC version:
Since your systems seems to update drivers behind your back quite often (which doesn’t seem to be wanted), you could disable these automatic updates and manually update the drivers when needed.