質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
CUDA

CUDAは並列計算プラットフォームであり、Nvidia GPU(Graphics Processing Units)向けのプログラミングモデルです。CUDAは様々なプログラミング言語、ライブラリ、APIを通してNvidiaにインターフェイスを提供します。

Python 3.x

Python 3はPythonプログラミング言語の最新バージョンであり、2008年12月3日にリリースされました。

Ubuntu

Ubuntuは、Debian GNU/Linuxを基盤としたフリーのオペレーティングシステムです。

Q&A

解決済

1回答

19459閲覧

cudaのダウングレード

teefpc

総合スコア111

CUDA

CUDAは並列計算プラットフォームであり、Nvidia GPU(Graphics Processing Units)向けのプログラミングモデルです。CUDAは様々なプログラミング言語、ライブラリ、APIを通してNvidiaにインターフェイスを提供します。

Python 3.x

Python 3はPythonプログラミング言語の最新バージョンであり、2008年12月3日にリリースされました。

Ubuntu

Ubuntuは、Debian GNU/Linuxを基盤としたフリーのオペレーティングシステムです。

0グッド

0クリップ

投稿2020/09/11 23:24

編集2020/09/12 09:43

Ubuntuのcuda11.0をcuda10.2にできません。正しい方法を教えて下さい。

削除した方法

bash

1sudo apt purge cuda* 2sudo apt purge nvidia-cuda-* 3sudo apt purge *nvidia* 4sudo apt purge libcuda* 5sudo apt purge *nsight* 6sudo apt-get --purge remove nvidia-* 7sudo apt-get --purge remove *nvidia* 8sudo apt-get --purge remove *nsight* 9sudo apt-get --purge remove cuda-* 10sudo apt-get --purge remove cuda 11sudo apt autoremove 12# sudo rm -rf /var/cuda-repo-*** これらも削除か?

インストールした方法
CUDA Toolkit 10.2 Downloadl

インストール結果は、

bash

1$ cat /usr/local/cuda/version.txt 2CUDA Version 11.0.228

bash

1$ ls -ld /usr/local/cuda* 2lrwxrwxrwx 1 root root 9 912 18:30 /usr/local/cuda -> cuda-11.0 3drwxr-xr-x 15 root root 4096 912 18:28 /usr/local/cuda-11.0

bash

1$ ll /var/ | grep cuda 2drwxr-xr-x 2 root root 20480 912 15:14 cuda-repo-10-2-local-10.2.89-440.33.01/ 3drwxr-xr-x 2 root root 4096 912 08:22 cuda-repo-ubuntu1604-10-2-local/ 4drwxr-xr-x 2 root root 20480 911 23:44 cuda-repo-ubuntu1604-11-0-local/

dpkg はログなし

bash

1$ dpkg -l | grep nvidia-driver | grep -E ^ii

bash

1$ apt show cuda 2Package: cuda 3Version: 11.0.3-1 4Priority: optional 5Section: multiverse/devel 6Maintainer: cudatools <cudatools@nvidia.com> 7Installed-Size: 7,168 B 8Depends: cuda-11-0 (>= 11.0.3) 9Download-Size: 2,392 B 10APT-Manual-Installed: yes 11APT-Sources: http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 Packages 12Description: CUDA meta-package 13 Meta-package containing all the available packages required for native CUDA 14 development. Contains the toolkit, samples, driver and documentation. 15 16N: 追加レコードが 13 件あります。表示するには '-a' スイッチを付けてください。

-a オプションで全部表示

bash

1$ apt -a show cuda 2Package: cuda 3Version: 11.0.3-1 4Priority: optional 5Section: multiverse/devel 6Maintainer: cudatools <cudatools@nvidia.com> 7Installed-Size: 7,168 B 8Depends: cuda-11-0 (>= 11.0.3) 9Download-Size: 2,392 B 10APT-Manual-Installed: yes 11APT-Sources: http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 Packages 12Description: CUDA meta-package 13 Meta-package containing all the available packages required for native CUDA 14 development. Contains the toolkit, samples, driver and documentation. 15 16Package: cuda 17Version: 11.0.2-1 18Priority: optional 19Section: multiverse/devel 20Maintainer: cudatools <cudatools@nvidia.com> 21Installed-Size: 7,168 B 22Depends: cuda-11-0 (>= 11.0.2) 23Download-Size: 2,392 B 24APT-Sources: http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 Packages 25Description: CUDA meta-package 26 Meta-package containing all the available packages required for native CUDA 27 development. Contains the toolkit, samples, driver and documentation. 28 29Package: cuda 30Version: 11.0.1-1 31Priority: optional 32Section: multiverse/devel 33Maintainer: cudatools <cudatools@nvidia.com> 34Installed-Size: 7,168 B 35Depends: cuda-11-0 (>= 11.0.1) 36Download-Size: 2,394 B 37APT-Sources: http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 Packages 38Description: CUDA meta-package 39 Meta-package containing all the available packages required for native CUDA 40 development. Contains the toolkit, samples, driver and documentation. 41 42Package: cuda 43Version: 10.2.89-1 44Priority: optional 45Section: multiverse/devel 46Maintainer: cudatools <cudatools@nvidia.com> 47Installed-Size: 25.6 kB 48Depends: cuda-10-2 (>= 10.2.89) 49Download-Size: 2,514 B 50APT-Sources: http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 Packages 51Description: CUDA meta-package 52 Meta-package containing all the available packages required for native CUDA 53 development. Contains the toolkit, samples, driver and documentation. 54 55Package: cuda 56Version: 10.1.243-1 57Priority: optional 58Section: multiverse/devel 59Maintainer: cudatools <cudatools@nvidia.com> 60Installed-Size: 25.6 kB 61Depends: cuda-10-1 (>= 10.1.243) 62Download-Size: 2,510 B 63APT-Sources: http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 Packages 64Description: CUDA meta-package 65 Meta-package containing all the available packages required for native CUDA 66 development. Contains the toolkit, samples, driver and documentation. 67 68Package: cuda 69Version: 10.1.168-1 70Priority: optional 71Section: multiverse/devel 72Maintainer: cudatools <cudatools@nvidia.com> 73Installed-Size: 25.6 kB 74Depends: cuda-10-1 (>= 10.1.168) 75Download-Size: 2,512 B 76APT-Sources: http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 Packages 77Description: CUDA meta-package 78 Meta-package containing all the available packages required for native CUDA 79 development. Contains the toolkit, samples, driver and documentation. 80 81Package: cuda 82Version: 10.1.105-1 83Priority: optional 84Section: multiverse/devel 85Maintainer: cudatools <cudatools@nvidia.com> 86Installed-Size: 25.6 kB 87Depends: cuda-10-1 (>= 10.1.105) 88Download-Size: 2,512 B 89APT-Sources: http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 Packages 90Description: CUDA meta-package 91 Meta-package containing all the available packages required for native CUDA 92 development. Contains the toolkit, samples, driver and documentation. 93 94Package: cuda 95Version: 10.0.130-1 96Priority: optional 97Section: multiverse/devel 98Maintainer: cudatools <cudatools@nvidia.com> 99Installed-Size: 25.6 kB 100Depends: cuda-10-0 (>= 10.0.130) 101Download-Size: 2,514 B 102APT-Sources: http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 Packages 103Description: CUDA meta-package 104 Meta-package containing all the available packages required for native CUDA 105 development. Contains the toolkit, samples, driver and documentation. 106 107Package: cuda 108Version: 9.2.148-1 109Priority: optional 110Section: multiverse/devel 111Maintainer: cudatools <cudatools@nvidia.com> 112Installed-Size: 25.6 kB 113Depends: cuda-9-2 (>= 9.2.148) 114Download-Size: 2,502 B 115APT-Sources: http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 Packages 116Description: CUDA meta-package 117 Meta-package containing all the available packages required for native CUDA 118 development. Contains the toolkit, samples, driver and documentation. 119 120Package: cuda 121Version: 9.2.88-1 122Priority: optional 123Section: multiverse/devel 124Maintainer: cudatools <cudatools@nvidia.com> 125Installed-Size: 25.6 kB 126Depends: cuda-9-2 (>= 9.2.88) 127Download-Size: 2,508 B 128APT-Sources: http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 Packages 129Description: CUDA meta-package 130 Meta-package containing all the available packages required for native CUDA 131 development. Contains the toolkit, samples, driver and documentation. 132 133Package: cuda 134Version: 9.1.85-1 135Priority: optional 136Section: multiverse/devel 137Maintainer: cudatools <cudatools@nvidia.com> 138Installed-Size: 25.6 kB 139Depends: cuda-9-1 (>= 9.1.85) 140Download-Size: 2,512 B 141APT-Sources: http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 Packages 142Description: CUDA meta-package 143 Meta-package containing all the available packages required for native CUDA 144 development. Contains the toolkit, samples, driver and documentation. 145 146Package: cuda 147Version: 9.0.176-1 148Priority: optional 149Section: multiverse/devel 150Maintainer: cudatools <cudatools@nvidia.com> 151Installed-Size: 25.6 kB 152Depends: cuda-9-0 (>= 9.0.176) 153Download-Size: 2,504 B 154APT-Sources: http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 Packages 155Description: CUDA meta-package 156 Meta-package containing all the available packages required for native CUDA 157 development. Contains the toolkit, samples, driver and documentation. 158 159Package: cuda 160Version: 8.0.61-1 161Priority: optional 162Section: multiverse/devel 163Maintainer: cudatools <cudatools@nvidia.com> 164Installed-Size: 25.6 kB 165Depends: cuda-8-0 (>= 8.0.61) 166Download-Size: 2,510 B 167APT-Sources: http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 Packages 168Description: CUDA meta-package 169 Meta-package containing all the available packages required for native CUDA 170 development. Contains the toolkit, samples, driver and documentation. 171 172Package: cuda 173Version: 8.0.44-1 174Priority: optional 175Section: multiverse/devel 176Maintainer: cudatools <cudatools@nvidia.com> 177Installed-Size: 25.6 kB 178Depends: cuda-8-0 (>= 8.0.44) 179Download-Size: 2,504 B 180APT-Sources: http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 Packages 181Description: CUDA meta-package 182 Meta-package containing all the available packages required for native CUDA 183 development. Contains the toolkit, samples, driver and documentation. 184

宜しくお願いいたします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

quickquip

2020/09/11 23:40

sudo apt-get -y install cuda で実際に何が入ったのか、その結果はどうだったのですか? ls -ld /usr/local/cuda* の結果はどうなりますか?
teefpc

2020/09/12 00:28

$ ls -ld /usr/local/cuda* /usr/local/cuda -> cuda-11.0 となりました。
退会済みユーザー

退会済みユーザー

2020/09/12 03:08

保証はないですが、自分の場合は*nvidia*のように両側にアスタリスクをつけた覚えがあります。あとは、nsightも消した覚えがあります。根こそぎNVIDIA関係のもの、CUDA関係のものを一切合切消した気がします。というのも、根こそぎ消さないでダウングレードをしてもバージョン確認のコマンドを使うと新しいバージョンの表記が残ったためです。これはCUDAのバグだと思いますが…。
teefpc

2020/09/12 06:26

やはり、一度インストールしたcudaは見かけでは削除できても、ダウングレードまではできませんでした。 とりあえずCUDAのバグの可能性を想定できたことだけでも有益な情報でした。ありがとうございます。
quickquip

2020/09/12 08:32

> $ ls -ld /usr/local/cuda* > /usr/local/cuda -> cuda-11.0 > となりました。 lrwxrwxrwx 1 root 9 (日時) /usr/local/cuda -> cuda-11.0/ drwxr-xr-x 16 root 4096 (日時) /usr/local/cuda-11.0/ drwxr-xr-x 17 root 4096 (日時) /usr/local/cuda-10.2/ みたいになりませんか? なんか省略してませんか?
teefpc

2020/09/12 09:09 編集

$ ls -ld /usr/local/cuda* lrwxrwxrwx 1 root root 9 9月 12 15:20 /usr/local/cuda -> cuda-11.0 drwxr-xr-x 15 root root 4096 9月 12 15:18 /usr/local/cuda-11.0 cuda ディレクトリをまるごと削除しているのに、10.2をインストールすると毎回このようになります。 ご提示された上記の出力は、複数バージョンをシンボリックリンクで使い分けることができるという意味でしょうか。
quickquip

2020/09/12 09:10

了解です。情報はこの欄ではなくて編集して質問に載せてください。 dpkg -l | grep nvidia-driver | grep -E ^ii や apt show cuda の結果あたりもあるとよさそうです。
teefpc

2020/09/12 09:12

ちなみに、 $ ll /var/ | grep cuda drwxr-xr-x 2 root root 20480 9月 12 15:14 cuda-repo-10-2-local-10.2.89-440.33.01/ drwxr-xr-x 2 root root 4096 9月 12 08:22 cuda-repo-ubuntu1604-10-2-local/ drwxr-xr-x 2 root root 20480 9月 11 23:44 cuda-repo-ubuntu1604-11-0-local/ という結果があります。このディレクトリも削除が必要でしょうか。
quickquip

2020/09/12 09:14 編集

> ダウングレードをしてもバージョン確認のコマンドを使うと新しいバージョンの表記が残ったためです nvidia-smi のバージョン表示が違う、みたいな現象は遭遇しましたが、インストールできてからの話ではないかと…… sudo apt-get -y install cuda-10-2 と明示しないとバージョンが新しいものが入るとかいうことかとふと思いました。 やはり sudo apt-get -y install cuda した時の結果が知りたいですね。
teefpc

2020/09/12 09:46

sudo apt-get -y install cuda した時の結果を質問文に追記しました。
guest

回答1

0

自己解決

cuda 削除方法

bash

1# Remove existing CuDA versions 2sudo apt --purge remove "cublas*" "cuda*" 3sudo apt --purge remove "nvidia*" 4rm -rf /usr/local/cuda* 5sudo apt-get autoremove && sudo apt-get autoclean 6 7# Reboot to remove cached files 8reboot

インストール方法
nVidiaから各機種の方法を選択し、最後の行をバージョンに合わせて修正。

bash

1sudo apt install cuda-10.2

環境変数の追加

bash

1# copy the following files into the cuda toolkit directory. 2echo 'export PATH=/usr/local/cuda-10.0/bin:$PATH' >> ~/.bashrc 3echo 'export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:$LD_LIBRARY_PATH' >> ~/.bashrc 4reboot

Download とExport CuDNN
これはcuda 10.0での場合。
無料会員サイトでcuDNNをダウンロード。
マイナーバージョンの記述も要修正。

bash

1# Download from following link: https://developer.nvidia.com/rdp/cudnn-archive 2tar -xzvf cudnn-10.0-linux-x64-v7.4.2.24.tgz 3sudo cp -P cuda/include/cudnn.h /usr/local/cuda-10.0/include 4sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda-10.0/lib64/ 5sudo chmod a+r /usr/local/cuda-10.0/lib64/libcudnn*

TEST

bash

1nvcc -V 2cat /usr/local/cuda/version.txt 3ls -la /usr/local/cuda

投稿2020/09/15 00:20

teefpc

総合スコア111

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問