conda里面有没有cuda_已安装的没有conda的cuda:pytorch可以使用非conda cuda工具包吗?...

博客探讨了Conda环境中PyTorch安装是否需要特定版本的CUDA,以及是否可以使用官方非Conda安装的CUDA工具包。尽管Conda安装可能与特定CUDA版本(如10.2)绑定,但建议使用Conda提供的CUDA工具包以避免兼容性问题。无论怎样安装PyTorch,它都将依赖于编译时指定的CUDA版本,无法与其他版本的CUDA互换。
摘要由CSDN通过智能技术生成

Does conda pytorch need a different version than the official non-conda cuda at https://developer.nvidia.com/cuda-toolkit?

In other words: Can I use a non-conda cuda toolkit for a pytorch installation?

Context:

If you go through the "command helper" at https://pytorch.org/get-started/locally/, you can choose between cuda versions 9.2, 10.1, 10.2 and None.

Taking 10.2 can result in:

conda install pytorch torchvision cudatoolkit=10.2 -c pytorch

Taking "None" builds the following command, but then you also cannot use cuda in pytorch:

conda install pytorch torchvision cpuonly -c pytorch

The question arose since pytorch installs a different version (10.2 instead of the officially available 11.0 of the non-conda install), and the conda install takes 325 MB. If both versions were 11.0 and the installation were smaller, you might not even notice the possible difference.

解决方案

I imagine it is probably possible to get a conda-installed pytorch to use a non-conda-installed CUDA toolkit. I don't know how to do it, and in my experience, when using conda packages that depend on CUDA, its much easier just to provide a conda-installed CUDA toolkit, and let it use that, rather than anything else. This often means I have one CUDA toolkit installed inside conda, and one installed in the usual location.

However, regardless of how you install pytorch, if you install a binary package (e.g. via conda), that version of pytorch will depend on a specific version of CUDA (that it was compiled against, e.g. 10.2) and you cannot use any other version of CUDA, regardless of how or where it is installed, to satisfy that dependency.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值