【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

相关推荐
郭庆汝3 小时前
pytorch、torchvision与python版本对应关系
人工智能·pytorch·python
思则变6 小时前
[Pytest] [Part 2]增加 log功能
开发语言·python·pytest
漫谈网络7 小时前
WebSocket 在前后端的完整使用流程
javascript·python·websocket
try2find8 小时前
安装llama-cpp-python踩坑记
开发语言·python·llama
博观而约取9 小时前
Django ORM 1. 创建模型(Model)
数据库·python·django
精灵vector11 小时前
构建专家级SQL Agent交互
python·aigc·ai编程
Zonda要好好学习11 小时前
Python入门Day2
开发语言·python
Vertira11 小时前
pdf 合并 python实现(已解决)
前端·python·pdf
太凉11 小时前
Python之 sorted() 函数的基本语法
python
项目題供诗11 小时前
黑马python(二十四)
开发语言·python