【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

相关推荐
Aspect of twilight9 分钟前
ACM输入输出格式详解
python·acm
见识星球13 分钟前
名企校招攻略
大数据·python
TL滕15 分钟前
从0开始学算法——第四天(题目参考答案)
数据结构·笔记·python·学习·算法
二川bro15 分钟前
循环性能提升:Python向量化计算技巧
开发语言·python
rabbit_pro1 小时前
Java 文件上传到服务器本地存储
java·服务器·python
serve the people1 小时前
PQ+IVF组合解决海量向量内存占用高和检索慢的问题
人工智能·python
on_pluto_1 小时前
【debug】解决 5070ti 与 pytorch 版本不兼容的问题
人工智能·pytorch·python
嫂子的姐夫1 小时前
02-多线程
爬虫·python·多线程·并发爬虫·基础爬虫
【建模先锋】2 小时前
基于Python的智能故障诊断系统 | SmartDiag AI (基础版)V1.0 正式发布!
开发语言·人工智能·python·故障诊断·智能分析平台·大数据分析平台·智能故障诊断系统
AIsdhuang2 小时前
2025 年企业 AI 培训精选指南:聚焦企业培训场景
人工智能·python