简体   繁体   English

使用 python tvm 时,未检测到支持 CUDA 的设备

[英]When using python tvm, No CUDA-capable device is detected

I wrote the following python code我写了以下 python 代码

import tvm

ctx = tvm.device("cuda", 0)
print("ctx: ", ctx.exist)

The output is output 是

ctx:  False

However, I install cuda and cuda driver.但是,我安装了 cuda 和 cuda 驱动程序。 The nvidia-smi result is, nvidia-smi结果是,

NVIDIA-SMI 495.44       Driver Version: 495.44       CUDA Version: 11.5

I use lspci -vnn | grep VGA我使用lspci -vnn | grep VGA lspci -vnn | grep VGA to check whether there is a GPU. lspci -vnn | grep VGA检查是否有GPU。 The result is结果是

03:00.0 VGA compatible controller [0300]: Matrox Electronics Systems Ltd. Integrated Matrox G200eW3 Graphics Controller [102b:0536] (rev 04) (prog-if 00 [VGA controller])
3b:00.0 VGA compatible controller [0300]: NVIDIA Corporation Device [10de:1e04] (rev a1) (prog-if 00 [VGA controller])
af:00.0 VGA compatible controller [0300]: NVIDIA Corporation Device [10de:1e04] (rev a1) (prog-if 00 [VGA controller])
d8:00.0 VGA compatible controller [0300]: NVIDIA Corporation Device [10de:1e04] (rev a1) (prog-if 00 [VGA controller])

And my system is Linux PowerEdge-R740 5.4.0-90-generic #101~18.04.1-Ubuntu .My python version is 3.6.我的系统是Linux PowerEdge-R740 5.4.0-90-generic #101~18.04.1-Ubuntu 。我的 python 版本是 3.6。

I don't know why tvm cannot find the correct device.我不知道为什么 tvm 找不到正确的设备。

One possible source of error could be that you did not enable CUDA backend support when installing TVM.一种可能的错误来源可能是您在安装 TVM 时没有启用 CUDA 后端支持。

Edit build/config.cmake to customize the compilation options.编辑 build/config.cmake 以自定义编译选项。 Change set(USE_CUDA OFF) to set(USE_CUDA ON) to enable CUDA backend.将 set(USE_CUDA OFF) 更改为 set(USE_CUDA ON) 以启用 CUDA 后端。 Do the same for other backends and libraries you want to build for (OpenCL, RCOM, METAL, VULKAN, …).对您要为其构建的其他后端和库(OpenCL、RCOM、METAL、VULKAN ......)执行相同的操作。

Please refer to: https://tvm.apache.org/docs/install/from_source.html#install-from-source请参考: https://tvm.apache.org/docs/install/from_source.html#install-from-source

(I would have commented, but not enough reputation) (我会评论,但没有足够的声誉)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 RuntimeError 未检测到支持 CUDA 的设备 - RuntimeError no CUDA-capable device is detected Cuda 运行时错误 cudaErrorNoDevice:未检测到支持 CUDA 的设备 - Cuda Runtime Error cudaErrorNoDevice: no CUDA-capable device is detected Docker 容器上带有 GPU 的 Pytorch 错误 - 未检测到支持 CUDA 的设备 - Pytorch w/ GPU on Docker Container Error - no CUDA-capable device is detected Tensorflow 2.2 在我的 Microsoft Windows Surface book 3 上找不到 GPU — 未检测到支持 CUDA 的设备 - Tensorflow 2.2 does not find GPU on my Microsoft Windows Surface book 3— no CUDA-capable device is detected CUDA 错误:使用 python 3.9 时设备序号无效 - CUDA error: invalid device ordinal when using python 3.9 pytorch不使用CUDA设备 - Pytorch not using cuda device 导入 TVM 时未找到 GLBCX - GLBCX not found when importing TVM 尝试官方 TVM 教程时获取“无法找到 target=opencl -device=intel_graphics -model=unknown,workload='error”的配置 - Getting ’Cannot find config for target=opencl -device=intel_graphics -model=unknown, workload=' error` when trying official TVM tutorial 使用 CUDA 在 Python 中循环 - Loops in Python using CUDA CUDA 错误:在 python 中使用并行时出现初始化错误 - CUDA ERROR: initialization error when using parallel in python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM