pycuda --“未设置 CUDA_ROOT,并且 nvcc 不在路径中。”
虽然我已经安装了 pycuda 并使用它,但它开始(不做某事)不起作用。所以,我尝试再次安装,但是当我正在做的时候
python configure.py --cuda-root=/usr/local/cuda/bin
它给了我标题中的错误。
nvcc 文件位于上述目录中。
Although i had installed pycuda and using it ok,it started (without doing sth) not to work.So,i i tried to do the install again ,but when i am doing
python configure.py --cuda-root=/usr/local/cuda/bin
it gives me the error in the title.
The nvcc file is in the above directory.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
pycuda 没有找到 nvcc。您是否尝试将 /usr/local/cuda/bin 添加到您的 env PATH 变量中?这就是我的设置方式。
编辑:
据我所知,configure.py 不会调用 nvcc 编译器,它只是创建 makefile。我认为当您运行 sudo -c "make install" 调用 setup.py 时会发生此问题。
有几件事值得尝试。确保您已设置 CUDA_ROOT:
如果它为空,请设置它:
尝试再次运行 make 命令。现在使用 -E 来保留您的环境:
pycuda is not finding nvcc. Did you try adding /usr/local/cuda/bin to your env PATH variable? That's the way I have this setup.
Edit:
As far as I can tell the configure.py doesn't call nvcc compiler it just creates the the makefile. I take that this problem happens when you run sudo -c "make install" which calls setup.py.
A couple of things to try. Make sure that you have CUDA_ROOT set:
If it's empty, set it with:
Try running the make command again. Now with the -E to preserve your env:
我在 Slackware64 13.37 上遇到了同样的问题。
安装命令
su -c "make install"
切换到 root (0bv10u5Ly),因此应在 root 的配置文件中设置CUDA_ROOT
。CUDA_ROOT
不是环境变量,它由 setup.py 使用。将 /usr/local/cuda/bin 添加到 PATH 并定义 CUDA_ROOT=/usr/local/cuda/bin 然后尝试再次安装。这是一种快速而肮脏的方法,但如果上面的方法都不适合像我这样的你,那么下面的方法肯定会起作用。 (:
删除
并设置。然后尝试
su -c "make install"
。在 setup.py 文件中
I encountered the same issue on a Slackware64 13.37.
Install command
su -c "make install"
switches to root (0bv10u5Ly) thusCUDA_ROOT
should be set in the root's profile.CUDA_ROOT
is not an environment variable, it's used by the setup.py. Add /usr/local/cuda/bin to PATH and defineCUDA_ROOT=/usr/local/cuda/bin
then try to install again.This is the quick and dirty way but if none of above worked out for you like me, below will definitely work. (:
Remove
and set
in setup.py file. Then try
su -c "make install"
.就我而言,我必须设置 CUDA_ROOT=/usr/local/cuda 因为使用
/usr/local/cuda/bin
路径,无法找到包含文件夹并且它因错误而失败,找不到 cuda.h。In my case, I had to set
CUDA_ROOT=/usr/local/cuda
because with/usr/local/cuda/bin
path, it was not able find include folder and it was failing with error didn't find cuda.h.