龍灣做網站歌爾股份砍單
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