本文介绍了Nvidia Cudatoolkit和Conda Cudatoolkit的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

直到现在,我一直在使用 Tensorflow-GPU ,方法是使用 pip 以及 Nvidia网站上的Cuda相关软件和Nvidia软件/驱动程序进行安装强>.最近,我发现使用conda install tensorflow-gpu还会安装 cudatoolkit cudnn .

Till date, I have been using Tensorflow-GPU by installing it using pip and the Cuda related software and Nvidia softwares/drivers from Nvidia's website. Recently, I found that using conda install tensorflow-gpu also installs cudatoolkit and cudnn.

那么,这些(conda提供的)与我从Nvidia网站下载的那些有何不同?

So, how are these(the ones provided by conda) different from the ones that I downloaded from Nvidia's website?

在我的第一个(先前)环境中,conda list显示我只安装了TensorFlow(来自PyPi),没有安装cudnn/cudatoolkit,但仍然一切正常.

In my first (previous) environment, conda list showed that I have installed only TensorFlow(from PyPi) and no cudnn/cudatoolkit, but still everything worked.

此外,在我运行conda install tensorflow-gpu的新环境中,conda list显示我已安装 tensorflow-gpu 以及 cudatoolkit cudnn (由 Anaconda ).而且在这种环境下,一切都可以正常工作.

Also, in a new environment in which I ran conda install tensorflow-gpu, conda list showed me tensorflow-gpu has been installed along with cudatoolkit and cudnn by Anaconda. And in this environment also, everything worked fine.

这是否意味着,如果我使用pip安装TensorFlow,仅需要 从Nvidia网站下载和安装Cuda?

So does this mean, that downloading and installing Cuda from Nvidia's website is only necessary if I use pip to install TensorFlow?

推荐答案

如果使用anaconda安装tensorflow-gpu,是的,它将在与tensorflow-gpu相同的conda环境中为您安装cuda和cudnn.您自己需要安装的是最新的nvidia驱动程序(以便它可以与最新的CUDA级别以及您使用的所有旧CUDA级别一起使用.)

If using anaconda to install tensorflow-gpu, yes it will install cuda and cudnn for you in same conda environment as tensorflow-gpu. All you need to install yourself is the latest nvidia-driver (so that it works with the latest CUDA level and all older CUDA levels you use.)

与pip install tensorflow-gpu方法相比,它具有许多优点:

This has many advantages over the pip install tensorflow-gpu method:

  1. Anaconda将始终安装TensorFlow代码被编译为使用的CUDA和CuDNN版本.
  2. 您可以拥有具有不同级别的TensorFlow,CUDA和CuDNN的多个conda环境,只需使用conda activate在它们之间进行切换即可.
  3. 您不必手动在系统级安装CUDA和cuDNN.

与pip install tensorflow-gpu相比,缺点是在Anaconda能够更新conda配方并发布其最新TensorFlow版本的构建之前,将最新版本的tensorflow添加到pypi.

The disadvantage when compared to pip install tensorflow-gpu, is the latest version of tensorflow is added to pypi weeks before Anaconda is able to update the conda recipe and publish their builds of the latest TensorFlow version.

这篇关于Nvidia Cudatoolkit和Conda Cudatoolkit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-13 14:33