1
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?

自分の CUDA のバージョン確認する.

Posted at

1. nvcc コマンドで確認

nvcc(NVIDIA のコンパイラ)が入っていれば:

nvcc --version

または

nvcc -V

で CUDA のバージョンが表示されます.


2. nvidia-smi コマンドで確認

GPU ドライバと一緒にインストールされている nvidia-smi を使うと,ドライバと CUDA の対応バージョンがわかります:

nvidia-smi

出力の右上に CUDA Version: 12.x のように出ます.


3. PyTorch から確認(仮想環境内で)

すでに PyTorch をインストールしているなら Python で確認できます:

import torch
print(torch.version.cuda)   # PyTorch がビルドされた CUDA のバージョン
print(torch.cuda.is_available())  # GPU が使えるかどうか

4. システムに入っているライブラリを確認

Linux なら /usr/local/ 以下に CUDA がインストールされていることが多いです:

ls /usr/local/ | grep cuda

1
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
1
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?