pete
pete

Reputation: 61

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.

Upvotes: 1

Views: 820

Answers (2)

Ian
Ian

Reputation: 66

1.If you have two gpus, don't use CUDA deb file. Use run file instead, since you need to choose N when asking whether install openGL and x-server option.

2.More importantly, 17.10 is not supported by Cuda9.0. Cuda 9.0 only support unbuntu 17.04 and 16.04

3.Only cuda9.2 support ubuntu17.10 https://developer.nvidia.com/cuda-92-download-archive?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1710

4.Make sure you read the installation guide for linux carefully. I wrote a related answer here. ubuntu 18.04 driver setup for nvidia tesla k40m gpu for use with matlab

Upvotes: 0

jpp1
jpp1

Reputation: 2119

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()

Upvotes: 2

Related Questions