可以用
#include <stdio.h>
OK 囉。
~$ nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2018 NVIDIA Corporation Built on Sat_Aug_25_21:08:01_CDT_2018 Cuda compilation tools, release 10.0, V10.0.130 ~$ python3 --version Python 3.5.2選好,就會出現...Run this command:
pip3 install https://download.pytorch.org/whl/cu100/torch-1.0.1.post2-cp35-cp35m-linux_x86_64.whl pip3 install torchvision!!不要follow instruction upgrade pip 到 19.0.3.會有 main 錯誤
pip3 install numpy測試..
from __future__ import print_function import torch x = torch.rand(5,3) print(x)會是
tensor([[0.6098, 0.0374, 0.9580], [0.9531, 0.2159, 0.9694], [0.5153, 0.7471, 0.1269], [0.0336, 0.2670, 0.2762], [0.8283, 0.4620, 0.9425]])然後
torch.cuda.is_availebl() True