简体   繁体   English

如何删除 cuInit 失败:CUDA 中的未知错误 (PyCuda)

[英]How to remove cuInit failed: unknown error in CUDA (PyCuda)

I have CUDA installed then I tried the following:我安装了 CUDA 然后我尝试了以下操作:

In [1]: import pycuda.driver as cuda

In [2]: cuda.init()
---------------------------------------------------------------------------
Error                                     Traceback (most recent call last)
<ipython-input-2-2845c9c0ab3c> in <module>()
----> 1 cuda.init()

Error: cuInit failed: unknown error

How can resolve the error?如何解决错误?

I already have this installed:我已经安装了这个:

$ which nvidia-modprobe
/usr/bin/nvidia-modprobe

My other info:我的其他信息:

$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2015 NVIDIA Corporation
Built on Tue_Aug_11_14:27:32_CDT_2015
Cuda compilation tools, release 7.5, V7.5.17

And this:和这个:

$ uname -a
Linux foobar1 4.10.0-28-generic #32~16.04.2-Ubuntu SMP Thu Jul 20 10:19:48 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

And this is the information for the nvidia-smi这是 nvidia-smi 的信息

$ nvidia-smi
Mon Nov 19 15:56:43 2018
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 410.48                 Driver Version: 410.48                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Quadro P400         Off  | 00000000:AF:00.0 Off |                  N/A |
| 34%   45C    P0    N/A /  N/A |      0MiB /  1999MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

cuInit failed: unknown error is often the result of nvidia-uvm kernel module not being loaded. cuInit failed: unknown error通常是由于未加载 nvidia-uvm 内核模块造成的。 I've been periodically running into this issue on Ubuntu.我经常在 Ubuntu 上遇到这个问题。

sudo nvidia-modprobe -u should fix the problem. sudo nvidia-modprobe -u应该可以解决这个问题。 That is, until you reboot.也就是说,直到您重新启动。 Then you will need to do it again.然后你需要再做一次。

Another workaround is to run your failing application as root once .另一种解决方法是以 root 身份运行失败的应用程序一次 AFAICT it in this case CUDA runtime will attempt to load the missing module (and will most likely succeed at that, because we're running as root). AFAICT 在这种情况下,CUDA 运行时将尝试加载丢失的模块(并且很可能会成功,因为我们以 root 身份运行)。

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

相关问题 nvidia-docker 中的 TensorFlow:对 cuInit 的调用失败:CUDA_ERROR_UNKNOWN - TensorFlow in nvidia-docker: failed call to cuInit: CUDA_ERROR_UNKNOWN CUDA cuInit:未知 CUDA 错误值 | Blender 与 Google Colab - CUDA cuInit: Unknown CUDA error value | Blender with Google Colab tensorflow(不是 tensorflow-gpu):对 cuInit 的调用失败:未知错误(303) - tensorflow (not tensorflow-gpu): failed call to cuInit: UNKNOWN ERROR (303) TensorFlow 2.1 调用 cuInit 失败:未知错误 (303) - TensorFlow 2.1 failed call to cuInit: UNKNOWN ERROR (303) Pycuda 或 cuda 编译失败 - Pycuda or cuda failed to compile A100 tensorflow gpu 错误:“调用 cuInit 失败:CUDA_ERROR_NOT_INITIALIZED:初始化错误” - A100 tensorflow gpu error: "Failed call to cuInit: CUDA_ERROR_NOT_INITIALIZED: initialization error" 无法加载动态库“libcudart.so.11.0”? / 调用 cuInit 失败:未知错误 (303)? - Could not load dynamic library 'libcudart.so.11.0' ? / failed call to cuInit: UNKNOWN ERROR (303)? CUDA 9.0 和 pycuda,错误:CompileError:nvcc 编译……kernel.cu 失败 - CUDA 9.0 and pycuda, error:CompileError: nvcc compilation … kernel.cu failed OSX 10.9.2 + CUDA 5.5 + EDP 2.7.3 上的 PyCUDA 演示示例错误 - PyCUDA demo example error on OSX 10.9.2 + CUDA 5.5 + EDP 2.7.3 在 pyCUDA 中使用 CUDA 类型 - Using CUDA types in pyCUDA
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM