请参考这篇详细指导(GitHub): TyBruceChen/Tutorial-Conda-and-cuDNN-installation-for-Pytorch: This is a tutorial for installing CUDA (v11.8) and cuDNN (8.6.9) to enable programming torch with GPU. It also mentioned about the solution of unabling for torch to detect the CUDA core. (github.com)

总的来说,就是查询自己的显卡,驱动是否兼容你想安装的CUDA, 然后从Nvdia官网下载CUDA并进行安装,然后找到对你刚安装的CUDA兼容的cuDNN,下载之后替换文件。修改/添加系统路径(用nvcc -m检查系统是否识别到了)。然后下载对应的cuda兼容的pytorch(详情请看提供的链接)。最后用 torch.cuda.is_available() 进行验证(True)。

Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐