当前位置: 代码迷 >> 综合 >> apex安装报错:Cuda extensions are being compiled with a version of Cuda that does not match the verson
  详细解决方案

apex安装报错:Cuda extensions are being compiled with a version of Cuda that does not match the verson

热度:83   发布时间:2023-12-15 18:30:55.0

apex是nvdia的半精度运算库,能够增加运算速度,减小现存占用。
apex的仅支持带有tensor core的GPU,即RTX显卡。

apex的安装方式如下:

git clone https://github.com/NVIDIA/apex
cd apex
pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./

但是我在安装过程中:报错了

RuntimeError: Cuda extensions are being compiled with a version of Cuda that does not match the version used to compile Pytorch binaries.  Pytorch binaries were compiled with Cuda 9.0.176.

看这个意思是说cuda跟pytorch的版本不对应。后来我看到apex直接不带–global-option安装好像也能用。
于是修改最后一句

pip install -v --no-cache-dir ./

安装成功

  相关解决方案