- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试安装具有 CUDA 支持的手电筒。
这是我的 collect_env.py
的结果脚本:
PyTorch version: 1.7.1+cu101
Is debug build: False
CUDA used to build PyTorch: 10.1
ROCM used to build PyTorch: N/A
OS: Ubuntu 20.04.1 LTS (x86_64)
GCC version: (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Clang version: Could not collect
CMake version: Could not collect
Python version: 3.9 (64-bit runtime)
Is CUDA available: False
CUDA runtime version: 10.1.243
GPU models and configuration: GPU 0: GeForce GTX 1080
Nvidia driver version: 460.39
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Versions of relevant libraries:
[pip3] numpy==1.19.2
[pip3] torch==1.7.1+cu101
[pip3] torchaudio==0.7.2
[pip3] torchvision==0.8.2+cu101
[conda] blas 1.0 mkl
[conda] cudatoolkit 10.1.243 h6bb024c_0
[conda] mkl 2020.2 256
[conda] mkl-service 2.3.0 py39he8ac12f_0
[conda] mkl_fft 1.3.0 py39h54f3939_0
[conda] mkl_random 1.0.2 py39h63df603_0
[conda] numpy 1.19.2 py39h89c1606_0
[conda] numpy-base 1.19.2 py39h2ae0177_0
[conda] torch 1.7.1+cu101 pypi_0 pypi
[conda] torchaudio 0.7.2 pypi_0 pypi
[conda] torchvision 0.8.2+cu101 pypi_0 pypi
Process finished with exit code 0
这是
nvcc - V
的输出
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243
最后,这里是
nvidia-smi
的输出
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.39 Driver Version: 460.39 CUDA Version: 11.2 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 GeForce GTX 1080 Off | 00000000:01:00.0 On | N/A |
| 0% 52C P0 46W / 180W | 624MiB / 8116MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 873 G /usr/lib/xorg/Xorg 101MiB |
| 0 N/A N/A 1407 G /usr/lib/xorg/Xorg 419MiB |
| 0 N/A N/A 2029 G ...AAAAAAAAA= --shared-files 90MiB |
+-----------------------------------------------------------------------------+
但是,当我尝试运行时
print(torch.cuda.is_available())
我收到以下错误:
UserWarning: CUDA initialization: CUDA unknown error - this may be due to an incorrectly set up environment, e.g. changing env variable CUDA_VISIBLE_DEVICES after program start. Setting the available devices to be zero. (Triggered internally at /pytorch/c10/cuda/CUDAFunctions.cpp:100.)
return torch._C._cuda_getDeviceCount() > 0
我执行了重新启动,并按照
here 中详述的安装后步骤进行了操作。
最佳答案
您的安装非常适合 CUDA 和 nvidia 驱动程序,但问题在于您的 PyTorch 和 CUDA 版本,您至少需要 CUDA 10.2 才能获得支持 python 3.9 的最新版火炬
如果您使用 conda 只是创建一个新环境,则 conda 会处理 cuda 工具包,pip 和 conda 不能很好地配合使用:
pip uninstall uninstall torch torchaudio torchvision
创建新的 conda 环境
conda create --name yourenv python=3.9
conda activate yourenv
对于 CUDA 11.1:
conda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c conda-forge
对于 CUDA 10.2:
conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch -c conda-forge
如果您使用的是 pip 而不是 anaconda 环境
pip uninstall torch torchaudio torchvision
升级点:
pip3 install --upgrade pip
安装 PyTorch:
pip install torch torchvision torchaudio //cuda 10.2
pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html //cuda 11.1
关于python - CUDA 初始化 : CUDA unknown error - this may be due to an incorrectly set up environment,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66857471/
我正在使用带有 64 位插件的 64 位操作系统 Windows 7 终极机器 VS2008。 我已经在 32 位和 64 位、调试和发布配置中成功构建了我的项目。64 位调试未启动;它给出了错误:
我遇到了一个我不理解的 java 泛型编译时错误。 我有两种方法: public static final T doStuff(List list, int k, Comparator compar
在下面的类(class)中,我尝试打印工资系统中员工的详细信息。请注意,Porter、Pharmacist 和 Surgeon 均继承自 Employee。 但是,它只是重复打印添加到数组中的第一个员
package chapter5; import java.util.Scanner; public class Exercise5 { public static void main(Str
WITH list_dedup (Company, duplicate_count) AS ( SELECT *, ROW_NUMBER() OVER (
我有一些 base64 编码的数据,即使其中存在填充错误,我也想将其转换回二进制。如果我使用 base64.decodestring(b64_string) 它会引发“不正确的填充”错误。还有其他方法
我正在致力于将大型 Delphi 代码库调整为 64 位。在许多情况下,有些行将指针转换为 32 位值或从 32 位值转换为类似于以下内容的行: var p1,p2 : pointer; begi
我正在尝试在 rtaudio 中生成一个简单的正弦波,以验证我了解发生了什么。但是,结果是错误的。 我有一个全局float timec ,以及使用 openStream 调用的回调它应该用样本填充缓冲
将我们的 Jenkins 主安装更新到最新的 LTS 版本 2.46.3 后,其从属设备之一(Windows 7 计算机,32 位)无法与主设备连接。 我们收到的错误是: java -jar slav
实现ROCR曲线,kNN,K进行10倍交叉验证。 我正在使用电离层数据集。 这是属性信息,供您引用: -如上所述,所有34个都是连续的 -根据定义,第35个属性为“好”或“坏” 以上总结。这是一个二进
我正在阅读有关“Servlet 3.0 中的异步处理支持”的专家(?)教程(http://www.javaworld.com/javaworld/jw-02-2009/jw-02-servlet3.h
我目前正在为我即将开展的项目制作自己的关卡创建器(图 block map )。一切都很顺利,只是当我添加放大和缩小选项时遇到了问题。我有一个类正在处理当前的所有输入和渲染,因为我刚刚开始。 Level
我在 Eclipse mars 2.0 中使用 Mockito(1.10.19) 进行 Java EE 测试来测试离线存储库。此类依赖于 InitialData 类来检索信息。 我的第一个任务是将地址
我正在尝试实现“算法简介”一书中所述的合并排序算法。尽管实现是按照书中指定的,但输出不正确。很有可能出现相差一的错误,但我无法指出它。有什么指点吗? #include #include #defi
我正在尝试确定 Windows 任务栏(系统托盘?)停靠在哪一侧 - 这样我就可以将弹出窗口定位在任务栏的上方/下方/左侧/右侧。 我正在使用 SHAppBarMessage(ABM_QUERYPOS
我正在使用以下公式实现 DCT 变换: 但是结果不正确。对于一些 8 × 8 矩阵, 0 0 0 0 0 0 0 0 210 210 210 210 210 210 21
我正在尝试编写将内存流转换为 png 图像的代码,但在 using(Image img = Image.从流(毫秒))。它没有进一步指定它,所以我不知道为什么会收到错误以及我应该怎么做。 此外,如何将
这个语句工作正常: SELECT * FROM table_name WHERE DATE(date_event) < DATE(NOW() - INTERVAL 90 DAY); 在 DELETE
当我删除图像并尝试保存配置文件时,它显示错误“incorect padding” 我的代码是 模型.py import webcam.admin from webcam import widgets
我正在尝试创建一个函数来计算两个字符串之间的汉明距离。当我调用这个函数时,它应该告诉我两个字符串之间不匹配的字符数。 我的输出不正确。我不断得到随机数结果。下面是我的代码: using namespa
我是一名优秀的程序员,十分优秀!