马春杰杰博客
致力于深度学习经验分享!

[mcj]LXD容器中无法运行CUDAsamples:cudaGetDeviceCount returned 30解决方法

我想用cuda,然后我在主机上安装了NVIDIA390,cuda9.0,然后我在容器中安装了相同的版本。当我在容器中运行cuda的样本时,我收到一个错误:

I want to use cuda, then I installed NVIDIA390, cuda9.0 on the host machine, and then I installed the same version in the container. When I run cuda’s samples in the container, I get an error:

经过多方查找原因之后,发现大多数的解决方法都是在解决宿主机上发生这种情况的问题,而对于LXD虚拟容器很少有人提及,最终确定原因是宿主机没有/dev/nvidia-uvm设备。

After many reasons, I found that most of the solutions are to solve this problem on the host. However, there is very little mention of the LXD virtual container. The final reason is that the host does not have /dev/nvidia-uvm. device.

解决方法:

上面的操作时在宿主机上进行的,进行完之后,将设备挂在到容器中:

The above operation is performed on the host machine. After the operation is finished, the device is hung in the container:
挂载方法如下:

这样就行了。

或者新建一个脚本auto.sh,里面填入:

这样就行了。。

最近有人说执行了也不行,在这里有个注意点:

[qgg_pink]如果不行就关闭容器再试~[/qgg_pink]

赞(266) 打赏
版权声明:本文采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权
文章名称:《[mcj]LXD容器中无法运行CUDAsamples:cudaGetDeviceCount returned 30解决方法》
文章链接:https://www.machunjie.com/trouble/88.html
本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。

评论 2

  1. #1

    评论看看

    土拨鼠7年前 (2019-06-12)回复
    • 嘿嘿

      闪闪7年前 (2019-06-14)回复

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续提供更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫

微信扫一扫

:smile: :sad: :arrow: :cool: :confused: :cry: :eek: :evil: :exclaim: :idea: :lol: :mad: :mrgreen: :neutral: :question: :razz: :redface: :rolleyes: :surprised: :wink: :biggrin: :twisted: