# 报错信息:

 In file included from src/cpp/cuda.cpp:4:
      src/cpp/cuda.hpp:14:10: fatal error: cuda.h: No such file or directory
         14 | #include <cuda.h>
            |          ^~~~~~~~
      compilation terminated.
note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pycuda
Failed to build pycuda
ERROR: Could not build wheels for pycuda, which is required to install pyproject.toml-based projects

# 在编译安装的时候主要是找不到库文件导致的

#解决方式

step1:打开.bashrc文件
vim ~/.bashrc

step2:.bashrc文件中在添加如下环境变量
export PATH=/usr/local/cuda-11.4/bin:/usr/local/cuda/bin:$PATH

step3:让环境变量生效
source ~/.bashrc

step4:重新安装pycuda
pip3 install pycuda

Logo

欢迎来到由智源人工智能研究院发起的Triton中文社区,这里是一个汇聚了AI开发者、数据科学家、机器学习爱好者以及业界专家的活力平台。我们致力于成为业内领先的Triton技术交流与应用分享的殿堂,为推动人工智能技术的普及与深化应用贡献力量。

更多推荐