Понизить версию CUDA на Colab до 9 - PullRequest
1 голос
/ 24 марта 2020

При попытке запустить репозиторий в Google Colab я получаю следующую ошибку:

torch.__version__  =  1.0.0.dev20190328
setup.py:46: UserWarning: Option --pyprof not specified. Not installing PyProf dependencies!
  warnings.warn("Option --pyprof not specified. Not installing PyProf dependencies!")

Compiling cuda extensions with
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
from /usr/local/cuda/bin

Traceback (most recent call last):
  File "setup.py", line 106, in <module>
    check_cuda_torch_binary_vs_bare_metal(torch.utils.cpp_extension.CUDA_HOME)
  File "setup.py", line 80, in check_cuda_torch_binary_vs_bare_metal
    "https://github.com/NVIDIA/apex/pull/323#discussion_r287021798.  "
RuntimeError: Cuda extensions are being compiled with a version of Cuda that does not match the version used to compile Pytorch binaries.  Pytorch binaries were compiled with Cuda 9.0.176.
In some cases, a minor-version mismatch will not cause later errors:  https://github.com/NVIDIA/apex/pull/323#discussion_r287021798.  You can try commenting out this check (at your own risk).

С тех пор я понял, что мне нужно понизить версию CUDA до 9.0.176, и я сделал это, используя следующий код:

!wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb
!dpkg -i cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb
!apt-key add /var/cuda-repo-9-0-local/7fa2af80.pub
!apt-get update
!apt-get install cuda=9.0.176-1

который я получил здесь

Однако, это не работает, так как я получаю эту ошибку:

--2020-03-24 13:15:36--  https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb
Resolving developer.nvidia.com (developer.nvidia.com)... 152.199.16.29
Connecting to developer.nvidia.com (developer.nvidia.com)|152.199.16.29|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://developer.download.nvidia.com/compute/cuda/9.0/secure/Prod/local_installers/cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64.deb?IMScfi-W1zJ3Wp79Q-2RqX_moDmC9pYGLUriU9OhSPrFsuIxAhKh1BXgcR44eXnLGT4UkrlBdf7n4-3q2GgZxCZgAgkNkxxA4EOyDDQVN5B_eqXLWnuSXZKWVOny13D5KOi8HalLDi7hNAbqlNn2ba7I5BS2m6aSWEX-g121qZ-ZGMzK2cyAyJcE0wEAtKDtJNfSiGnBAiGJ9knSIHDU [following]
--2020-03-24 13:15:37--  https://developer.download.nvidia.com/compute/cuda/9.0/secure/Prod/local_installers/cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64.deb?IMScfi-W1zJ3Wp79Q-2RqX_moDmC9pYGLUriU9OhSPrFsuIxAhKh1BXgcR44eXnLGT4UkrlBdf7n4-3q2GgZxCZgAgkNkxxA4EOyDDQVN5B_eqXLWnuSXZKWVOny13D5KOi8HalLDi7hNAbqlNn2ba7I5BS2m6aSWEX-g121qZ-ZGMzK2cyAyJcE0wEAtKDtJNfSiGnBAiGJ9knSIHDU
Resolving developer.download.nvidia.com (developer.download.nvidia.com)... 152.199.20.126
Connecting to developer.download.nvidia.com (developer.download.nvidia.com)|152.199.20.126|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1212738714 (1.1G) [application/x-deb]
Saving to: ‘cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb.2’

cuda-repo-ubuntu160 100%[===================>]   1.13G  64.0MB/s    in 18s     

2020-03-24 13:15:55 (64.6 MB/s) - ‘cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb.2’ saved [1212738714/1212738714]

(Reading database ... 157958 files and directories currently installed.)
Preparing to unpack cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb ...
Unpacking cuda-repo-ubuntu1604-9-0-local (9.0.176-1) ...
dpkg-deb (subprocess): cannot copy archive member from 'cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb' to decompressor pipe: unexpected end of file or stream
dpkg-deb (subprocess): decompressing archive member: lzma error: unexpected end of input
dpkg-deb: error: <decompress> subprocess returned error exit status 2
dpkg: error processing archive cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb (--install):
 cannot copy extracted data for './var/cuda-repo-9-0-local/cuda-visual-tools-9-0_9.0.176-1_amd64.deb' to '/var/cuda-repo-9-0-local/cuda-visual-tools-9-0_9.0.176-1_amd64.deb.dpkg-new': unexpected end of file or stream
Errors were encountered while processing:
 cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb
gpg: can't open '/var/cuda-repo-9-0-local/7fa2af80.pub': No such file or directory
Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:3 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic InRelease
Hit:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:5 http://ppa.launchpad.net/marutter/c2d4u3.5/ubuntu bionic InRelease
Hit:6 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:7 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ InRelease
Ign:8 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64  InRelease
Ign:9 https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64  InRelease
Hit:10 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64  Release
Hit:11 https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64  Release
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Version '9.0.176-1' for 'cuda' was not found

I думаю, что версию, которую я пытаюсь скачать для CUDA, не найти, как указано ниже. Как правильно найти версию для загрузки CUDA, чтобы иметь возможность понизить версию?

1 Ответ

0 голосов
/ 26 марта 2020

Использование apt для установки Cuda иногда не работает в colab, вы можете проверить это

! Wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda-repo-ubuntu1704-9-0-local_9.0.176-1_amd64-deb

! Sudo sh cuda-repo -ubuntu1704-9-0-local_9.0.176-1_amd64-deb

! wget https://developer.nvidia.com/compute/cuda/9.0/Prod/patches/4/cuda-repo-ubuntu1704-9-0-176-local-patch-4_1.0-1_amd64-deb

! sudo sh cuda-repo-ubuntu1704-9- 0-176-local-patch-4_1.0-1_amd64-deb

! Export PATH = $ PATH: /usr/local/cuda-9.0/bin

! Export CUDADIR = / usr /local/cuda-9.0

! export LD_LIBRARY_PATH = $ LD_LIBRARY_PATH: /usr/local/cuda-9.0/lib64

! pip3 установить https://download.pytorch.org/whl/cu90/torch-1.0.0-cp36-cp36m-linux_x86_64.whl

...