torch.cuda.device_count()返回0

时间:2019-03-24 12:45:37

标签: python pip ubuntu-16.04 pytorch

我通过以下方式在virtualenv下安装了pytorch:

pip3 install https://download.pytorch.org/whl/cu100/torch-1.0.1.post2-cp35-cp35m-linux_x86_64.whl
pip3 install torchvision

但是由于某些原因:

import torch
torch.cuda.device_count()
0
torch.cuda.is_available()
False

像pytorch一样由于某种原因检测到了cuda 9:

torch._C._cuda_getDriverVersion()
9010

我的系统:

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.5 LTS
Release:    16.04
Codename:   xenial


nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Fri_Feb__8_19:08:17_PST_2019
Cuda compilation tools, release 10.1, V10.1.105


Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux


ls -l /usr/local/ | grep cuda
lrwxrwxrwx  1 root   root      21 Mar 24 02:05 cuda -> /usr/local/cuda-10.0/
drwxr-xr-x 17 root   root    4096 Mar 24 02:06 cuda-10.0
drwxr-xr-x 15 root   root    4096 Nov 29 23:03 cuda-9.0
drwxr-xr-x 15 root   root    4096 Jan 10  2018 cuda-9.1

nvidia-smi -q | grep "Product Name"
    Product Name                    : GeForce GTX TITAN X
    Product Name                    : GeForce GTX 1080 Ti

0 个答案:

没有答案