Problems of Pytorch installation on Ubuntu 17.10 (GPU)
Problems of Pytorch installation on Ubuntu 17.10 (GPU)
I would like to use PyTorch and its GPU computations on my computer.
I have a computer running with Ubuntu 17.10. The computer (Alienware m17x) has two graphic cards:
In order to install PyTorch, I followed the instructions on the PyTorch website pytorch.org
1) I installed CUDA 9 with the deb file: https://developer.nvidia.com/cuda-downloads
=> Linux/x86_64/Ubuntu/17.04/deb (local)
2) I installed Pytorch using the conda command line: conda install pytorch torchvision cuda90 -c pytorch
None of these two steps returned me any type of errors.
I restarted my computer. Apparently the two cards are detected:
$ lspci | grep -i vga
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
01:00.0 VGA compatible controller: NVIDIA Corporation GF114M [GeForce GTX 675M] (rev a1)
But apparently there is something wrong with the drivers or CUDA itself. nvidia-detector does not return me anything:
$ nvidia-detector
none
And pytorch can not use cuda:
[1]: import torch
In [2]: torch.cuda.is_available()
Out[2]: False
Could you help me? I can provide additional informations if necessary, but I am not sure what could be relevant.
What is your Nvidia driver version? If Ubuntu is using the default nouveau driver that might cause issues. (nvidia-smi shows the driver version)
– Forcetti
Jan 16 at 12:26
1 Answer
1
You do not need to install cuda to use a GPU with pytorch, if you install pytorch like this: pytorch binaries include all the necessary cuda libraries.
Therefore it also does not matter which cuda version flavour you choose when installing pytorch. Usually one will probably want the latest version, but in cases where an old GPU needs to get used, the pytorch binary that comes with the older cuda version may be the only one still supporting that GPU.
If no GPU is detected then this is probably not related to the CUDA library but to your kernel driver. Make sure that your system has the latest tested NVIDIA proprietary kernel driver installed.
What is maybe a bit confusing is that one can install pytorch binaries with cuda support on any system, including one without a GPU or with a GPU but without the system driver installed. This works fine until you try to actually use the GPU and invoke .cuda()
.cuda()
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Ubuntu 17.10 isn't a supported distro for any currently available CUDA version. Did you perform the validation steps in the CUDA linux install guide?
– Robert Crovella
Jan 16 at 12:05