本文介绍了Ubuntu 16.04上的TensorFlow的NVIDIA cuDNN发行版类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于Ubuntu 16.04,根据



显然,对于Ubuntu 16.04,它是Linux,Ubuntu Runtime或Developer,但是由于我在网络上看到确切应安装哪个文件的说法,我想知道哪个是最好的安装文件,或者

解决方案

首先,我建议您阅读开发人员指南和安装指南。我将尝试不重复其中包含的信息(例如特定的安装步骤/命令行)。



基本上有2种安装方法,对于各种NVIDIA软件的数量:




  • 直接安装(在这种情况下,通过.tgz压缩存档)

  • 软件包管理器安装(即在Ubuntu上使用dpkg / apt / apt-get)



有多种原因,包括关于您为什么更喜欢使用tar存档(.tgz)并解压缩所有内容的个人偏好,而不是让apt或apt-get为您处理安装。



如果您选择.tgz方法,则所需的所有内容都包含在单个.tgz归档文件用于Linux的cuDNN v7.0.5库中,我们可以立即观察到,如果您正在使用其他Linux OS, Ubuntu,这是(唯一的)方法。该zip文件包含已编译的库,根据cuDNN API开发所需的头文件,以及根据cuDNN编译/链接代码所需的其他内容。



如果选择软件包管理器方法,则该方法当前仅适用于列出的操作系统(在此示例中为Ubuntu 16.04和Ubuntu 14.04)。您有一些独立的选择:




  • 运行时库-如果您要使用cuDNN进行的唯一操作是运行另一项就足够了已被编译为在该版本的Ubuntu上使用该版本的cuDNN的二进制文件。例如,如果您通过pip方法安装了Tensorflow(TF),那么您就可以使用预编译的二进制文件,并且这些预编译的二进制文件已针对Ubuntu 16.04和cuDNN 7.0.5进行了设置,那么您只需安装cuDNN运行时库(按照安装指南中的步骤进行操作),足以开始使用预编译的TF。


  • 开发者库-这将包括头文件和根据此特定版本的cuDNN API编译和构建代码所需的其他事项。因此,如果您想 build rebuild TF(用于CUDA GPU使用),或者只是在自己的cuDNN API使用上工作,则需要此选项。 / p>


  • 代码示例和用户指南-在.tgz安装方法中,所有这些组件(包括文档和代码示例)都包含在单个.tgz归档文件中。在包管理器方法中,甚至将代码示例和API用户指南分解为单独的.deb安装,因此,如果不需要它,则不必下载(例如,如果您仅针对cuDNN 7.0.5,您需要开发人员库,但不需要代​​码示例或API用户指南。




更新:对于最新版本的CUDNN,.tgz文件/方法不再包含示例代码或文档。该文档(用户指南和安装指南)位于。这些示例仅在.deb安装程序中可用。


According to TensorFlow 1.5 installation instructions for Ubuntu 16.04, you need to install cuDNN 7.0 but they don't mention exactly what should be installed:

After registering and going through all the hoops to download cuDNN there is are multiple options to download and install:

Obviously, for Ubuntu 16.04 it's either the Linux or Ubuntu Runtime or Developer but since I saw different mentions on the web of which file exactly should be installed I was wondering which is the best one to install, or if there's actually any difference?

解决方案

First of all, I would encourage you to read the developer guide and the install guide. I'm going to try not to duplicate information contained there (such as specific install steps/command lines).

There are basically 2 install methods, which is true for a number of different kinds of NVIDIA software:

  • direct install (in this particular case via a .tgz compressed archive)
  • package manager install (i.e. using dpkg/apt/apt-get on Ubuntu)

There are various reasons including just personal preferences as to why you may prefer to use a tar archive (.tgz) and "unzip" everything, vs. letting apt or apt-get handle the install for you.

If you choose the .tgz method, everything you need is contained in the single .tgz archive "cuDNN v7.0.5 Library for Linux", and right off the bat we can make the observation that if you were using some Linux OS besides Ubuntu, this is the (only) way to go. This zip file contains the compiled libraries, the header files needed for development against the cuDNN API, and other things you will need to compile/link code against cuDNN.

If you choose the package manager method, this is currently only available for the listed OS's (Ubuntu 16.04 and Ubuntu 14.04 in this example). You have some independent choices:

  • Runtime Library - this is sufficient if the only thing you will be doing with cuDNN is running another binary that is already compiled to use that version of cuDNN on that version of Ubuntu. For example, if you have installed Tensorflow (TF) via a pip method, so you get precompiled binaries that are ready to go, and those precompiled binaries are set up for Ubuntu 16.04 and cuDNN 7.0.5, then you could just install the cuDNN runtime library (follow the steps in the install guide) and that would be sufficient to begin using your precompiled TF.

  • Developer Library - this will include header files and other things that are needed to compile and build codes against this particular version of the cuDNN API. So if you wanted to build or rebuild TF (for CUDA GPU usage), or you simply were working on your own API usage of cuDNN, you would want this option.

  • Code Samples and User Guide - In the .tgz install method, all of these components, including documentation and code samples, are included in the single .tgz archive. In the package manager method, even the Code samples and API user guide are broken out into a separate .deb install, so you don't have to download it if you don't need it (for example if you were just rebuilding TF against cuDNN 7.0.5, you would want the Developer Library but would not need the Code Samples or API User Guide).

UPDATE: With more recent versions of CUDNN, the .tgz file/method no longer contains the sample codes or documentation. The documentation (user guide and install guide) is here. The samples are only available in the .deb installer(s).

这篇关于Ubuntu 16.04上的TensorFlow的NVIDIA cuDNN发行版类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 02:11