这个问题是新的,以前从未发生过,因此可能已经更新了 nvidia 驱动程序或 libtorch。问题:我正在使用 Google Colab 来获取额外的 GPU,并且想要安装一个需要 libtorch 的程序。因此,过去几周安装工作正常,但是从今天开始,无法安装该程序。我已经尝试重新启动几次,重新启动等,但似乎没有任何效果。我还为 cuda 11.3 下载了新的 libtorch 版本并更新了 cuda,以便运行时在 cuda 11.3 上运行。当我打电话时
!nvidia-smi
它像往常一样给出信息。尽管如此,在根据需要添加 libtorch 作为环境变量之后,以便使用 libtorch
os.environ['LIBTORCH'] = "/content/libtorch"
和
os.environ['LD_LIBRARY_PATH'] = "/content/libtorch/lib"
!nvidia-smi
突然显示“无法初始化 NVML:驱动程序/库版本不匹配”。由于发生这种情况,我无法再安装该程序。
因此,我安装了 rustc(因为程序需要 rustup)并将其添加到路径中
os.environ['PATH] += os.pathsep + "path/to/.cargo/bin"
我将 Libtorch 添加为环境变量。我尝试货物安装程序。它通常工作正常,现在失败,抛出错误消息:
error: linking with `cc` failed: exit status: 1
= note: "cc" "-m64" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-Wl,--as-needed" "-L" "/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib"
.........................................
= note: /usr/bin/ld: cannot find -ltorch_cuda
/usr/bin/ld: cannot find -ltorch_cuda_cu
/usr/bin/ld: cannot find -ltorch_cuda_cpp
/usr/bin/ld: cannot find -ltorch_cpu
/usr/bin/ld: cannot find -ltorch
/usr/bin/ld: cannot find -lc10
collect2: error: ld returned 1 exit status