Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pytorch detection of CUDA

Tags:

pytorch

Which is the command to see the "correct" CUDA Version that pytorch in conda env is seeing? This, is a similar question, but doesn't get me far.

  1. nvidia-smi says I have cuda version 10.1

  2. conda list tells me cudatoolkit version is 10.2.89

  3. torch.cuda.is_available() shows FALSE, so it sees No CUDA?

  4. print(torch.cuda.current_device()), I get 10.0.10 (10010??) (it looks like):

    AssertionError: The NVIDIA driver on your system is too old (found version 10010)

  5. print(torch._C._cuda_getCompiledVersion(), 'cuda compiled version') tells me my version is 10.0.20 (10020??)?

    10020 cuda compiled version

Why are there so many different versions? What am I missing?

P.S I have Nvidia driver 430 on Ubuntu 16.04 with Geforce 1050. It comes with libcuda1-430 when I installed the driver from additional drivers tab in ubuntu (Software and Updates). I installed pytorch with conda which also installed the cudatoolkit using conda install -c fastai -c pytorch -c anaconda fastai

like image 314
agent18 Avatar asked Sep 27 '20 14:09

agent18


1 Answers

In the conda env (myenv) where pytorch is installed do the following:

conda activate myenv

torch.version.cuda

Nvidia-smi only shows compatible version. Does not seem to talk about the version pytorch's own cuda is built on.

like image 72
agent18 Avatar answered Oct 02 '22 15:10

agent18