0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Linux Mint Mate 20でCUDAをインストールする

Last updated at Posted at 2021-01-02

はじめに

最近、linux Mintを最新版のMINT20に入れ替えました。それまで動かしていたCUDAを再インストールしました。この間、わかったことなどを後日のために記録します。

Linux Mint

Linux Mint 20 MATE 
ハード GALLERIA DT(ドスパラ)

インストール手順

Nvidia社の下記のページよりインストール
https://developer.nvidia.com/cuda-downloads

Linux -> x86_64 -> Ubunut -> 20.04 -> dev[network]

この後に表示されたインストールの指示にしたがい端末にコピーペーストして作業しました。所要時間はおよそ40分

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
sudo apt-get update
sudo apt-get -y install cuda

インストールは順調に進んでいたのですが、最後になって次のメッセージがでてストップしました。


Your system has UEFI Secure Boot enabled.

UEFI Secure Boot requires additional configuration to work with third-party drivers.

スクロールして読んでいきますと最後にパスワードの入力を求められました。2度、linuxに設定したのと同じパスワードを入力すると先に進むことができました。その後、すぐにインストールは終了しました。

その後、再起動しました。すると画面の表示が妙です。画像が大きく表示されています。画面設定が変更になったようでした。端末からnvccを起動しようと試みるもの認識されていません。そこで、さらに、再度、再起動しました。すると画面サイズは正常に戻っていました。でも、まだnvccは起動しません。再度、sudo apt-get -y install cuda を実行すると、すでにCUDAはインストールされているというメッセージがでてきました。ドライバもちゃんとnvidia社のものが設定されていました。

後処理

最後にもうひとつやらなければならないことがありました。パスの設定です。
https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions

$ export PATH=/usr/local/cuda-11.2/bin${PATH:+:${PATH}}

このように端末から入力することによりnvccが起動するようになりました。

パスの設定

パスの設定をhomeディレクトリにあるprofileというファイルの最後に追加しておきます。これでいつでも端末からnvccを呼び出せるようになりました。

nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Mon_Nov_30_19:08:53_PST_2020
Cuda compilation tools, release 11.2, V11.2.67
Build cuda_11.2.r11.2/compiler.29373293_0


0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?