【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

相关推荐
暮冬-  Gentle°4 分钟前
用Python制作一个文字冒险游戏
jvm·数据库·python
小小小米粒16 分钟前
[特殊字符] 正常部署 AI + 流式输出(Stream)[特殊字符] 为什么会 CPU 炸了?
开发语言·python
站大爷IP19 分钟前
Python异步编程:asyncio核心用法与避坑指南
python
m0_5879589527 分钟前
游戏与图形界面(GUI)
jvm·数据库·python
不剪发的Tony老师31 分钟前
Spyder:一款面向数据科学的Python集成开发环境
ide·python
众创岛1 小时前
python中enumerate的用法
开发语言·python
布史1 小时前
Prometheus Python Client 实操指南:从零实现自定义 Exporter
网络·python·prometheus
纤纡.1 小时前
矿物识别分类:8 种机器学习算法对比与实战(平均值填充数据集)
python·深度学习·算法·机器学习
2301_818419011 小时前
使用PyTorch构建你的第一个神经网络
jvm·数据库·python
代码探秘者1 小时前
【算法篇】3.位运算
java·数据结构·后端·python·算法·spring