GeForce® 驱动程序
控制面板
opencv-python GPU 读取 rtsp
cuda
D:\NVIDIA GPU Computing Toolkit\CUDA\v12.0
D:\NVIDIA GPU Computing Toolkit\CUDA\v12.0
D:\NVIDIA Corporation\CUDA\Samples\v12.0
CUDA_PATH
D:\NVIDIA GPU Computing Toolkit\CUDA\v12.0
CUDA_PATH_V12_0
D:\NVIDIA GPU Computing Toolkit\CUDA\v12.0
D:\NVIDIA GPU Computing Toolkit\CUDA\v12.0\bin
D:\NVIDIA GPU Computing Toolkit\CUDA\v12.0\libnvvp
D:\NVIDIA GPU Computing Toolkit\CUDA\v12.0\include
nvcc -V
CUDA Toolkit | Minimum Required Driver Version for CUDA Minor Version Compatibility* | |
---|
| Linux x86_64 Driver Version | Windows x86_64 Driver Version |
CUDA 12.x | >=525.60.13 | >=528.33 |
CUDA 11.8.x CUDA 11.7.x CUDA 11.6.x CUDA 11.5.x CUDA 11.4.x CUDA 11.3.x CUDA 11.2.x CUDA 11.1.x | >=450.80.02 | >=452.39 |
CUDA 11.0 (11.0.3) | >=450.36.06** | >=451.22** |
torch
import torch
print(torch.__version__)
print(torch.cuda.is_available())
cuDNN
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/721c6c9aa8c3c45a68b95c6ebaf27cc0.png)
tensorflow
CUDA - Pytorch - Torchvision - Torchaudio - Python
cuda 和 cudnn 的版本对照直接参照官网上
CUDA | Torch | Torchvision | Torchaudio | Python |
---|
12.4 | | | | |
12.3 | | | | |
12.2 | | | | |
12.1 | 2.2.0 | 0.17.0 | 2.2.0 | >=3.8, <=3.11 |
12.1 | 2.1.1 | 0.16.1 | 2.1.1 | >=3.8, <=3.11 |
12.1 | 2.1.2 | 0.16.2 | 2.1.2 | >=3.8, <=3.11 |
12.1 | 2.1.0 | 0.16.0 | 2.1.0 | >=3.8, <=3.11 |
11.8 | 2.2.0 | 0.17.0 | 2.2.0 | >=3.8, <=3.11 |
11.8 | 2.1.2 | 0.16.2 | 2.1.2 | >=3.8, <=3.11 |
11.8 | 2.1.1 | 0.16.1 | 2.1.1 | >=3.8, <=3.11 |
11.8 | 2.1.0 | 0.16.0 | 2.1.0 | >=3.8, <=3.11 |
11.8 | 2.0.1 | 0.15.2 | 2.0.2 | >=3.8, <=3.11 |
11.8 | 2.0.0 | 0.15.1 | 2.0.1 | >=3.8, <=3.11 |
11.7 | 2.0.1 | 0.15.2 | 2.0.2 | >=3.8, <=3.11 |
11.7 | 2.0.0 | 0.15.1 | 2.0.1 | >=3.8, <=3.11 |
11.7 | 1.13.1 | 0.14.1 | 0.13.1 | >=3.7.2, <=3.10 |
11.7 | 1.13.0 | 0.14.0 | 0.13.0 | >=3.7.2, <=3.10 |
11.6 | 1.13.1 | 0.14.1 | 0.13.1 | >=3.7.2, <=3.10 |
11.6 | 1.13.0 | 0.14.0 | 0.13.0 | >=3.7.2, <=3.10 |
11.6 | 1.12.1 | 0.13.1 | 0.12.1 | >=3.7, <=3.10 |
11.6 | 1.12.0 | 0.13.0 | 0.12.0 | >=3.7, <=3.10 |
11.3 | 1.12.1 | 0.13.1 | 0.12.1 | >=3.7, <=3.10 |
11.3 | 1.12.0 | 0.13.0 | 0.12.0 | >=3.7, <=3.10 |
11.3 | 1.11.0 | 0.12.0 | 0.11.0 | >=3.7, <=3.10 |
11.1 | 1.10.1 | 0.11.2 | 0.10.1 | >=3.6, <=3.9 |
11.1 | 1.10.0 | 0.11.0 | 0.10.0 | >=3.6, <=3.9 |
11.1 | 1.9.1 | 0.10.1 | 0.9.1 | >=3.6, <=3.9 |
11.1 | 1.9.0 | 0.10.0 | 0.9.0 | >=3.6, <=3.9 |
11.1 | 1.8.2 | 0.9.2 | 0.8.2 | >=3.6, <=3.9 |
11.1 | 1.8.1 | 0.9.1 | 0.8.1 | >=3.6, <=3.9 |
11.1 | 1.8.0 | 0.9.0 | 0.8.0 | >=3.6, <=3.9 |
11.0 | 1.7.1 | 0.8.2 | 0.7.2 | >=3.6, <=3.9 |
11.0 | 1.7.0 | 0.8.0 | 0.7.0 | >=3.6, <=3.9 |
10.2 | 1.12.1 | 0.13.1 | 0.12.1 | >=3.7, <=3.10 |
10.2 | 1.12.0 | 0.13.0 | 0.12.0 | >=3.7, <=3.10 |
10.2 | 1.11.0 | 0.12.0 | 0.11.0 | >=3.7, <=3.10 |
10.2 | 1.10.1 | 0.11.2 | 0.10.1 | >=3.6, <=3.9 |
10.2 | 1.10.0 | 0.11.0 | 0.10.0 | >=3.6, <=3.9 |
10.2 | 1.9.1 | 0.10.1 | 0.9.1 | >=3.6, <=3.9 |
10.2 | 1.9.0 | 0.10.0 | 0.9.0 | >=3.6, <=3.9 |
10.2 | 1.8.2 | 0.9.2 | 0.8.2 | >=3.6, <=3.9 |
10.2 | 1.8.1 | 0.9.1 | 0.8.1 | >=3.6, <=3.9 |
10.2 | 1.8.0 | 0.9.0 | 0.8.0 | >=3.6, <=3.9 |
10.2 | 1.7.1 | 0.8.2 | 0.7.2 | >=3.6, <=3.9 |
10.2 | 1.7.0 | 0.8.0 | 0.7.0 | >=3.6, <=3.9 |
10.2 | 1.6.0 | 0.7.0 | - | >=3.6, <=3.8 |
10.1 | 1.8.1 | 0.9.1 | 0.8.1 | >=3.6, <=3.9 |
10.1 | 1.8.0 | 0.9.0 | 0.8.0 | >=3.6, <=3.9 |
10.1 | 1.7.1 | 0.8.2 | 0.7.2 | >=3.6, <=3.9 |
10.1 | 1.7.0 | 0.8.0 | 0.7.0 | >=3.6, <=3.9 |
10.1 | 1.6.0 | 0.7.0 | - | >=3.6, <=3.8 |
9.2 | 1.7.1 | 0.8.2 | 0.7.2 | >=3.6, <=3.9 |
9.2 | 1.7.0 | 0.8.0 | 0.7.0 | >=3.6, <=3.9 |
9.2 | 1.6.0 | 0.7.0 | - | >=3.6, <=3.8 |
CPU - Pytorch - Torchvision - Torchaudio
CUDA | Torch | Torchvision | Torchaudio |
---|
CPU only | 2.2.0 | 0.17.0 | 2.2.0 |
CPU only | 2.1.2 | 0.16.2 | 2.1.2 |
CPU only | 2.1.1 | 0.16.1 | 2.1.1 |
CPU only | 2.1.0 | 0.16.0 | 2.1.0 |
CPU only | 2.0.1 | 0.15.2 | 2.0.2 |
CPU only | 2.0.0 | 0.15.1 | 2.0.1 |
CPU only | 1.13.1 | 0.14.1 | 0.13.1 |
CPU only | 1.13.0 | 0.14.0 | 0.13.0 |
CPU only | 1.12.1 | 0.13.1 | 0.12.1 |
CPU only | 1.12.0 | 0.13.0 | 0.12.0 |
CPU only | 1.11.0 | 0.12.0 | 0.11.0 |
CPU only | 1.10.1 | 0.11.2 | 0.10.1 |
CPU only | 1.10.0 | 0.11.0 | 0.10.0 |
CPU only | 1.9.1 | 0.10.1 | 0.9.1 |
CPU only | 1.9.0 | 0.10.0 | 0.9.0 |
CPU only | 1.8.2 | 0.9.2 | 0.8.2 |
CPU only | 1.8.1 | 0.9.1 | 0.8.1 |
CPU only | 1.8.0 | 0.9.0 | 0.8.0 |
CPU only | 1.7.1 | 0.8.2 | 0.7.2 |
CPU only | 1.7.0 | 0.8.0 | 0.7.0 |
CPU only | 1.6.0 | 0.7.0 | - |
CUDA - Tensorflow - cuDNN - Python
CUDA | Tensorflow | cuDNN | python |
---|
12.4 | | | |
12.3 | 2.16.1 | 8.9? | 3.9-3.12 |
12.2 | 2.15.0 | 8.9 | 3.9-3.11 |
11.8 | 2.14.0 | 8.7 | 3.9-3.11 |
11.8 | 2.13.0 | 8.6 | 3.8-3.11 |
11.8 | 2.12.0 | 8.6 | 3.8-3.11 |
11.2 | 2.11.0 | 8.1 | 3.7-3.10 |
11.2 | 2.10.0 | 8.1 | 3.7-3.10 |
11.2 | 2.9.0 | 8.1 | 3.7-3.10 |
11.2 | 2.8.0 | 8.1 | 3.7-3.10 |
11.2 | 2.7.0 | 8.1 | 3.7-3.9 |
11.2 | 2.6.0 | 8.1 | 3.6-3.9 |
11.2 | 2.5.0 | 8.1 | 3.6-3.9 |
11.0 | 2.4.0 | 8.0 | 3.6-3.8 |
10.1 | 2.3.0 | 7.6 | 3.5-3.8 |
10.1 | 2.2.0 | 7.6 | 3.5-3.8 |
10.1 | 2.1.0 | 7.6 | 2.7, 3.5-3.7 |
10.0 | 2.0.0 | 7.4 | 2.7, 3.3-3.7 |
10.0 | 1.15.0 | 7.4 | 2.7, 3.3-3.7 |
示例程序 torch
import torch
import time
print(torch.cuda.current_device())
print(torch.cuda.device_count())
print(torch.cuda.get_device_name(0))
print(torch.cuda.is_available())
print(torch.version.cuda)
print (torch.cuda.is_available())
print(torch.cuda.is_available())
a = torch.randn(10000, 1000)
b = torch.randn(1000, 2000)
t0 = time.time()
c = torch.matmul(a, b)
t1 = time.time()
print(a.device, t1 - t0, c.norm(2))
device = torch.device('cuda')
a = a.to(device)
b = b.to(device)
t0 = time.time()
c = torch.matmul(a, b)
t1 = time.time()
print(a.device, t1 - t0, c.norm(2))
t0 = time.time()
c = torch.matmul(a, b)
t1 = time.time()
print(a.device, t1 - t0, c.norm(2))
其他
pip 创建虚拟环境
python -m venv env-py311
cd .\env-py311\
cd .\Scripts\
.\activate
(env-py311) PS C:\Users\xulon\Desktop\env-py311\Scripts>
deactivate
关于环境激活的问题
PS E:\py_env\Scripts> .\activate
.\activate : 无法加载文件 E:\py_env\Scripts\activate.ps1,因为在此系统上禁止运行脚本。
有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_E xecution_Policies。
所在位置 行:1 字符: 1
+ .\activate
+ ~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [],PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
PS E:\py_env\Scripts> get-executionpolicy
Restricted
PS E:\py_env\Scripts> Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
Y
PS E:\py_env\Scripts> .\activate
(py_env) PS E:\py_env\Scripts>
更新 pip
python -m ensurepip
pip install pip -U
pip install --upgrade pip
python -m pip install --upgrade pip
pip 换源
pip install markdown -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install markdown -i https://mirrors.aliyun.com/pypi/simple/
pip install markdown -i http://mirrors.cloud.tencent.com/pypi/simple
pip install markdown -i http://pypi.douban.com/simple/
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
pip config set global.index-url http://mirrors.cloud.tencent.com/pypi/simple
pip config set global.index-url http://pypi.douban.com/simple/
pip config unset global.index-url