【问题标题】:Error during PyCUDA installationPyCUDA 安装时出错
【发布时间】:2020-12-13 11:23:02
【问题描述】:

我尝试使用以下说明安装 PyCUDA:http://wiki.tiker.net/PyCuda/Installation/Linux 在第 3 点我正在编译:

su -c "make install"

从控制台获得以下输出:

running install
running bdist_egg
running egg_info
writing requirements to pycuda.egg-info/requires.txt
writing pycuda.egg-info/PKG-INFO
writing top-level names to pycuda.egg-info/top_level.txt
writing dependency_links to pycuda.egg-info/dependency_links.txt
reading manifest file 'pycuda.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pycuda.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
building '_driver' extension
gcc -pthread -DDYNAMIC_ANNOTATIONS_ENABLED=1 -fwrapv -Wall -g -fPIC -DPYGPU_PACKAGE=pycuda -DHAVE_CURAND=1 -DBOOST_PYTHON_SOURCE=1 -DPYGPU_PYCUDA=1 -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION=1 -Dboost=pycudaboost -Isrc/cpp -Ibpl-subset/bpl_subset -I/usr/local/cuda/include -I/usr/lib/python3.2/site-packages/numpy/core/include -I/usr/lib/python3.2/site-packages/numpy/core/include -I/usr/include/python3.2mu -c src/cpp/cuda.cpp -o build/temp.linux-x86_64-3.2/src/cpp/cuda.o
Inf ile included from src/cpp/cuda.cpp:1:0:
src/cpp/cuda.hpp:12:18: fatal error: cuda.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1

我该怎么办?

编辑:我的操作系统是:Arch Linux 3.3.2.1。 GPU:英伟达 GF 9600M GS

【问题讨论】:

  • 您链接到的那些说明用于安装 pycuda。你想做什么?
  • 对不起,我忘了说我当然是在尝试安装pycuda。
  • 您是否安装了受支持的 CUDA 工具包和匹配的驱动程序?
  • 我已经安装了 CUDA-toolkit (pacman -S cuda-toolkit),我的 Nvidia 驱动程序版本:295.40。如何检查驱动程序是否匹配?
  • 你的工具包可能被你的包管理器安装在一个非标准的地方。请注意在您链接到的 wiki 中使用 --cuda-root=...。您需要找到 CUDA 工具包并指定安装程序的路径。

标签: python pycuda


【解决方案1】:

尝试sudo su -(成为root)而不是su -c "make install",然后以root 身份:make install(导航到正确的目录后)

【讨论】:

  • 这将如何帮助修复缺少的 CUDA 工具包?
  • 是的,我认为这是缺少的 CUDA 工具包,正如 @talonmies 正确指出的那样。听从他的建议。
【解决方案2】:

这个完整的命令对我有用:

sudo pip3 install --global-option=build_ext --global-option="-I/usr/local/cuda/include" --global-option="-L/usr/local/cuda/lib64" pycuda

【讨论】:

    猜你喜欢
    • 2013-11-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-12
    • 2013-10-05
    相关资源
    最近更新 更多