this is my first post and I am new to AI and RL… please apologize
I use ubuntu 18.04.1
I follow installation guide from pytorch and followed cuda instalation guide nvidia
I notice that I cannot choose cuda 10.2 but that nvidia download site only offer cuda 10.2.
And after following above guide, torch.cuda.is_available() give false result.
here is my nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Wed_Oct_23_19:24:38_PDT_2019
Cuda compilation tools, release 10.2, V10.2.89
nvidia-smi
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.33.01 Driver Version: 440.33.01 CUDA Version: 10.2 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 1050 On | 00000000:01:00.0 Off | N/A |
| N/A 48C P0 N/A / N/A | 355MiB / 3020MiB | 10% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1105 G /usr/lib/xorg/Xorg 27MiB |
| 0 1211 G /usr/bin/gnome-shell 47MiB |
| 0 1453 G /usr/lib/xorg/Xorg 138MiB |
| 0 1609 G /usr/bin/gnome-shell 136MiB |
| 0 4046 G /usr/lib/firefox/firefox 1MiB |
+-----------------------------------------------------------------------------+
and now when I type conda install pytorch torchvision cudatoolkit=10.1 -c pytorch it says # All requested packages already installed.
do you have any suggestion to solve this please ( I want to use cuda)…
## Package Plan ##
environment location: /home/silverant/anaconda3/envs/rl_gym_book
removed specs:
- pytorch
The following packages will be downloaded:
package | build
---------------------------|-----------------
mkl-2018.0.3 | 1 126.9 MB
mkl_fft-1.0.6 | py35h7dd41cf_0 134 KB
mkl_random-1.0.1 | py35h4414c95_1 313 KB
numpy-1.15.2 | py35h1d66e8a_0 46 KB
numpy-base-1.15.2 | py35h81de0dd_0 3.4 MB
tbb-2019.8 | hfd86e86_0 1.1 MB
tbb4py-2018.0.5 | py35h6bb024c_0 201 KB
------------------------------------------------------------
Total: 132.1 MB
The following NEW packages will be INSTALLED:
mkl_fft pkgs/main/linux-64::mkl_fft-1.0.6-py35h7dd41cf_0
mkl_random pkgs/main/linux-64::mkl_random-1.0.1-py35h4414c95_1
numpy-base pkgs/main/linux-64::numpy-base-1.15.2-py35h81de0dd_0
tbb pkgs/main/linux-64::tbb-2019.8-hfd86e86_0
tbb4py pkgs/main/linux-64::tbb4py-2018.0.5-py35h6bb024c_0
The following packages will be REMOVED:
cudatoolkit-10.1.243-h6bb024c_0
libtiff-4.1.0-h2733197_0
olefile-0.46-py35_0
pillow-5.2.0-py35heded4f4_0
pytorch-1.3.1-py3.5_cuda10.1.243_cudnn7.6.3_0
torchvision-0.4.2-py35_cu101
zstd-1.3.7-h0b5b093_0
The following packages will be UPDATED:
numpy 1.14.2-py35hdbf6ddf_0 --> 1.15.2-py35h1d66e8a_0
The following packages will be DOWNGRADED:
mkl 2019.4-243 --> 2018.0.3-1
Proceed ([y]/n)? y
It looks like I’m going to need to install the whole thing from source, i.e. switching to 10.1 isn’t going to work for me.
The instructions for installing from source also mention “# Add LAPACK support for the GPU if needed” but then rely on prebuilt packages for magma that don’t include CUDA 10.2.
Linear algebra methods rely on magma (e.g. here) so you won’t be able to use them. However, a lot of models don’t use these methods, so as long as you don’t need to e.g. calculate the log determinant of your weight parameter, you should be fine.
I would recommend to stick to pytorch/builder for the magma build.
For CUDA10.2 you shouldn’t need any changes in the build script besides the CUDA version change, but let me know, if you get stuck. Also, you could have a look at the NGC PyTorch container, which ships with CUDA10.2.
Hi , i did the same thing with you but it didn’t work.
My OS is Windows10.My cuda version 10.2
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Wed_Oct_23_19:32:27_Pacific_Daylight_Time_2019
Cuda compilation tools, release 10.2, V10.2.89
Try to Update conda, create a new conda environment, and rerun the install command.
Sometimes conda and pip seem to have some problems finding the right version.
I did it but i found that i have older version of nvidia driver i guess.
>>> a = torch.tensor([]).cuda()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\pavlo\Miniconda3\envs\TorchEnv\lib\site-packages\torch\cuda\__init__.py", line 194, in _lazy_init
_check_driver()
File "C:\Users\pavlo\Miniconda3\envs\TorchEnv\lib\site-packages\torch\cuda\__init__.py", line 102, in _check_driver
raise AssertionError("""
AssertionError:
The NVIDIA driver on your system is too old (found version 9010).
Please update your GPU driver by downloading and installing a new
version from the URL: http://www.nvidia.com/Download/index.aspx
Alternatively, go to: https://pytorch.org to install
a PyTorch version that has been compiled with your version
of the CUDA driver.
I have Pytorch 1.4 installed with Cuda 10.2 and cudnn 7.6.x and its working just fine! (Ubuntu 18.04)
There should be something else that prevents you from successful execution imho!
I think @PavlosTiritiris is currently trying to install the binaries with CUDA10.1, so creating a new topic might be a better idea to keep this topic clean, as it’s related to a CUDA10.2 installation.
It turned out that i had cuda compute capability < 3 and pytorch doesn’t support it, so i tried with a machine with cuda capability 5 and the installation was succesfull.
So does this mean that installing cudatoolkit=10.1(and pytorch) for cuda version 10.2 can solve the problem?
I met the same problem and tried the suggestion for a server with cuda 10.2:
However when I tried moving a tensor to cuda an error occurred:
AssertionError: Torch not compiled with CUDA enabled
What’s wrong with that? Actually I thought for the server installed with cuda 10.2, it should be reasonable to install pytorch with cudatoolkit=10.2 rather than 10.1. So I’m also confused with the previous suggestion.
Hope for your reply!
PS: I have also tried installing pytorch with cudatoolkit=10.2 and got the same error as before…
Each conda env should use their own set of installed libraries.
I’m not sure, if some libs are reused from the base environment, but you can definitely install different PyTorch builds in separate environments.
Hi, I have Cuda 10.2 and I have installed pytorch with cudatoolkit=10.2. I am getting error AssertionError: Torch not compiled with CUDA enabled. I am getting same error for cudatoolkit=10.1. Could you tell me what is going wrong?