【CuPy报错】NVRTC_ERROR_COMPILATION (6)找不到 ‘vector_types.h‘

cupy安装不要再使用pip install cupy了,

已经替换成基于版本安装了pip install cupy-cuda12x,详见cupy官网。

安装完成后,在import cupy之后报错,找不到 'vector_types.h':

复制代码
CompileException: /home/zoe/venv/lib/python3.10/site-packages/cupy/_core/include/cupy/_cuda/cuda-12.4/cuda_fp16.h(129): catastrophic error: cannot open source file "vector_types.h"
  #include "vector_types.h"
                           ^

1 catastrophic error detected in the compilation of "/tmp/tmpj2ipaghf/e51b12159fb86782de36519c3d354c9de068af57.cubin.cu".
Compilation terminated.

你还需要安装一个CUDA的头文件,其中12.6可以替换成你用的cupy版本。

复制代码
pip install "nvidia-cuda-runtime-cu12==12.6.*"

参考:

1\]: https://github.com/cupy/cupy/issues/8466 \[2\]: https://docs.cupy.dev/en/latest/install.html#cupy-always-raises-nvrtc-error-compilation-6

相关推荐
TF男孩3 小时前
ARQ:一款低成本的消息队列,实现每秒万级吞吐
后端·python·消息队列
该用户已不存在8 小时前
Mojo vs Python vs Rust: 2025年搞AI,该学哪个?
后端·python·rust
站大爷IP10 小时前
Java调用Python的5种实用方案:从简单到进阶的全场景解析
python
用户83562907805115 小时前
从手动编辑到代码生成:Python 助你高效创建 Word 文档
后端·python
c8i15 小时前
python中类的基本结构、特殊属性于MRO理解
python
liwulin050616 小时前
【ESP32-CAM】HELLO WORLD
python
Doris_202316 小时前
Python条件判断语句 if、elif 、else
前端·后端·python
Doris_202316 小时前
Python 模式匹配match case
前端·后端·python
这里有鱼汤17 小时前
Python量化实盘踩坑指南:分钟K线没处理好,小心直接亏钱!
后端·python·程序员
大模型真好玩17 小时前
深入浅出LangGraph AI Agent智能体开发教程(五)—LangGraph 数据分析助手智能体项目实战
人工智能·python·mcp