Skip to content

cuda_gpu

陳鍾誠 edited this page Oct 21, 2021 · 4 revisions

CUDA GPU

conda

(base) csienqu-teacher:ccc csienqu$ conda activate demo
Could not find conda environment: demo
You can list all discoverable environments with `conda info --envs`.

(base) csienqu-teacher:ccc csienqu$ python --version
Python 3.8.5
(base) csienqu-teacher:ccc csienqu$ python
Python 3.8.5 (default, Sep  4 2020, 02:22:02) 
[Clang 10.0.0 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch

>>> 
>>> torch.cuda.is_available()

MAC 安裝

# MacOS Binaries dont support CUDA, install from source if CUDA is needed
pip3 install torch torchvision torchaudio

MAC 檢查

(base) csienqu-teacher:~ csienqu$ cat /usr/local/cuda
cat: /usr/local/cuda: Is a directory
(base) csienqu-teacher:~ csienqu$ cat /usr/local/cuda/version.txt
CUDA Version 10.0.130

Clone this wiki locally