自学内容网 自学内容网

【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


原文地址:https://blog.csdn.net/agent_snail/article/details/142773078

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!