当我们在安装tensorflow时,我们在安装什么?- Intro to TF, Virtualenv, Docker, CUDA, cuDNN, NCCL, Bazel
(Mainly quoted from its official website)
Summary:
1. TensorFlow™ is an open source software library.
2. Virtualenv is a tool to create isolated Python environments.
3. Docker:
An image is a executable package.
A container is a runtime instance of an image.
4. CUDA® is a parallel computing platform and programming model.
The CUDA Toolkit is used to develop GPU-accelerated applications.
5. cuDNN is a GPU-accelerated library of primitives for deep neural networks.
6. NCCL implements multi-GPU and multi-node collective communication primitives.
7. Bazel is an open-source build and test tool.
------------------------------------------------------------------------------------
TensorFlow™
TensorFlow™ is an open source software library for high performance numerical computation.
Its flexible architecture allows easy deployment of computation across a variety of platforms (CPUs, GPUs, TPUs), and from desktops to clusters of servers to mobile and edge devices.
------------------------------
Virtualenv
Virtualenv is a tool to create isolated Python environments.
e.g. Some applications need python 2.x, while some need python 3.x, so that they cannot share the system default python.
One solution is to use virtualenv to create isolated python environments for different applications.
Usage:
- Create an environment (e.g. venv)
- Use source to enter this environment (e.g. $ source venv/bin/activate)
- Inside the venv, the packages installed by pip will be installed in the venv and will not be influenced by system default python. (e.g. (venv) $ pip install ***)
- Use deactivate to exit the current environment. (e.g. (venv) $ deactivate)
------------------------------
Docker
An image is a lightweight, stand-alone, executable package that includes everything needed to run a piece of software, including the code, a runtime, libraries, environment variables, and config files.
A container is a runtime instance of an image—what the image becomes in memory when actually executed. It runs completely isolated from the host environment by default, only accessing host files and ports if configured to do so.
Container vs. virtual machines
Containers run apps natively on the host machine’s kernel. They have better performance characteristics than virtual machines that only get virtual access to host resources through a hypervisor. Containers can get native access, each one running in a discrete process, taking no more memory than any other executable.

Virtual machines run guest operating systems—note the OS layer in each box. This is resource intensive, and the resulting disk image and application state is an entanglement of OS settings, system-installed dependencies, OS security patches, and other easy-to-lose, hard-to-replicate ephemera. 这是资源密集型的,所产生的磁盘映像和应用程序状态,会导致众多问题的纠缠,如操作系统设置、系统安装依赖项、OS安全修补程序和其他易丢失、因仅短期有效而难以复制的生命期。
Containers can share a single kernel, and the only information that needs to be in a container image is the executable and its package dependencies, which never need to be installed on the host system. These processes run like native processes, and you can manage them individually by running commands like docker ps—just like you would run ps on Linux to see active processes. Finally, because they contain all their dependencies, there is no configuration entanglement; a containerized app “runs anywhere.” 容器可以共享单个内核,并且容器映像中唯一需要的信息是可执行文件及其包依赖项,它们永远不需要安装在主机系统上。 这些进程像本机进程一样运行,您可以通过运行docker ps之类的命令来单独管理它们,就像在Linux上运行ps来查看活动进程一样。 最后,因为它们包含所有依赖项,所以没有配置纠缠; 容器化的应用程序“随处运行”。
With containerization, developers don’t need to write application code into different VMs operating different app components to retrieve compute, storage and networking resources. A complete application component can be executed in its entirety within its isolated environment without affecting other app components or software. Conflicts within libraries or app components do not occur during execution and the application container can move between the cloud or data center instances efficiently.
(https://www.bmc.com/blogs/containers-vs-virtual-machines/)
------------------
Virtualenv vs. Container
Virtualenv is used to isolate different python versions.
Container is used to let different components of a complete application be executed in its entirety within its isolated resources. Each container contains everything needed to run a piece of software.
-----------------------------------
CUDA (https://developer.nvidia.com/cuda-zone)
CUDA® is a parallel computing platform and programming model developed by NVIDIA for general computing on graphical processing units (GPUs). With CUDA, developers are able to dramatically speed up computing applications by harnessing the power of GPUs.
In GPU-accelerated applications, the sequential part of the workload runs on the CPU – which is optimized for single-threaded performance – while the compute intensive portion of the application runs on thousands of GPU cores in parallel. When using CUDA, developers program in popular languages such as C, C++, Fortran, Python and MATLAB and express parallelism through extensions in the form of a few basic keywords.
The CUDA Toolkit from NVIDIA provides everything you need to develop GPU-accelerated applications. The CUDA Toolkit includes GPU-accelerated libraries, a compiler, development tools and the CUDA runtime.
-------------------------------
cuDNN (https://developer.nvidia.com/cudnn)
The NVIDIA CUDA® Deep Neural Network library (cuDNN) is a GPU-accelerated library of primitives for deep neural networks. cuDNN provides highly tuned implementations for standard routines such as forward and backward convolution, pooling, normalization, and activation layers. cuDNN is part of the NVIDIA Deep Learning SDK.
Deep learning researchers and framework developers worldwide rely on cuDNN for high-performance GPU acceleration. It allows them to focus on training neural networks and developing software applications rather than spending time on low-level GPU performance tuning. cuDNN accelerates widely used deep learning frameworks, including Caffe,Caffe2, Chainer, Keras,MATLAB, MxNet, TensorFlow, and PyTorch.
---------------------
NCCL
The NVIDIA Collective Communications Library (NCCL) implements multi-GPU and multi-node collective communication primitives that are performance optimized for NVIDIA GPUs. NCCL provides routines such as all-gather, all-reduce, broadcast, reduce, reduce-scatter, that are optimized to achieve high bandwidth over PCIe and NVLink high-speed interconnect.
Developers of deep learning frameworks can rely on NCCL’s highly optimized, MPI compatible and topology aware routines, to take full advantage of all available GPUs within and across multiple nodes. Leading deep learning frameworks such as Caffe,Caffe2, Chainer, MxNet, TensorFlow, and PyTorch have integrated NCCL to accelerate deep learning training on multi-GPU systems.

---------------------
Bazel
Bazel is an open-source build and test tool similar to Make, Maven, and Gradle. It uses a human-readable, high-level build language. Bazel supports projects in multiple languages and builds outputs for multiple platforms. Bazel supports large codebases across multiple repositories, and large numbers of users.
(Can use it to build tensorflow from source.)
当我们在安装tensorflow时,我们在安装什么?- Intro to TF, Virtualenv, Docker, CUDA, cuDNN, NCCL, Bazel的更多相关文章
- 【tensorflow】1.安装Tensorflow开发环境,安装Python 的IDE--PyCharm
================================================== 安装Tensorflow开发环境,安装Python 的IDE--PyCharm 1.PyCharm ...
- Windows下安装程序时提示未安装Microsoft Net FrameWork 2.0
问题描述 安装程序时碰到如下: 现在基本都是用win7.win10系统,缺少环境大多数都是因为系统没有启用. 解决方法 控制面板 - 程序 - 启用或关闭Windows功能 - 把第一项'NET Fr ...
- 安装 tensorflow 时遇到 OSError: [Errno 1] Operation not permitted 的解决办法
Installing collected packages: numpy, scipy, six, pyyaml, Keras, opencv-python, h5py, html5lib, blea ...
- 安装TensorFlow时出现ERROR: Cannot uninstall 'wrapt'问题的解决方案
pip install -U --ignore-installed wrapt enum34 simplejson netaddr pip install -i https://pypi.tuna.t ...
- Winodws安装系统时,通过安装磁盘进行分区
今天使用一个系统盘安装的时候,很奇怪,分区总是分出来一个系统磁盘,一个MBR,剩下的只能分主分区. 这样就导致我在进行windows激活时,激活工具都找不到启动磁盘的盘符(因为自动分出来的系统磁盘和M ...
- ubuntu上安装adt时无法在线安装的问题
安装了新的ubuntu系统之后,就得重新布置android开发环境了. 找了网上的教程,一步一步做,到了在eclipse上在线下载adt总是出现 Unable to connect to reposi ...
- 8-linux 安装 requests 时 pip install 安装不了
安装提示更新:但是必须要sudo才行: sudo pip install --upgrade pip 安装 requests时有报错:这样写可以: sudo python -m pip install ...
- 安装Mysql时提示尚未安装Python 解决方案
我明明安装了python,结果在安装mysql是却提示没有安装python. 原因,没有将python添加到path中. 解决方法:卸载python,然后重装python,在安装界面中勾选将path添 ...
- 解决安装office2013时提示已安装相同版本的office
例如出现如上所示的图: ------------------------------------------------------------------ 在尝试使用官方的卸载清理工具无果后, 终极 ...
随机推荐
- ASP.NET mvc 验证码 (转)
ASP.net 验证码(C#) MVC http://blog.163.com/xu_shuhao/blog/static/5257748720101022697309/ 网站添加验证码,主要为防止机 ...
- deep learning学习记录一
最近不小心又赶了一下时髦,在做deep learning.今天去听了复旦吴老师的课程,感觉吴老讲解的还是很清晰的. 上午刚看过cnn,下午讲解的就是这章,相对来说,我听着给了很多启发.
- LeetCode4.寻找两个有序数组的中位数 JavaScript
给定两个大小为 m 和 n 的有序数组 nums1 和 nums2. 请你找出这两个有序数组的中位数,并且要求算法的时间复杂度为 O(log(m + n)). 你可以假设 nums1 和 nums2 ...
- 课时60.CSS的固定格式(掌握)
CSS就是用来设置样式的,美化界面的 如何验证? 打开一个京东首页 删除掉css样式 发现页面变得非常难看 由此我们验证了一个说法,css就是用来美化界面的 1.格式: <style type= ...
- Oracle数据库中 to_date()与to_char()函数的用法
to_date() ,to_char()与24小时制表示法及mm分钟的显示: 一.在使用Oracle的to_date函数来做日期转换时,很多Java程序员也许会直接的采用“yyyy-MM-dd HH: ...
- RabbitMQ消息中间件极速入门与实战
1:初识RabbitMQ RabbitMQ是一个开源的消息代理和队列服务器,用来通过普通协议在完全不同的应用之间共享数据,RabbitMQ是使用Erlang语言来编写的,并且RabbitMQ是基于AM ...
- noip模拟赛 动态仙人掌(并查集,贪心)
思路: 贪心+并查集 因为45‘,所以可以很方便的算出每个仙人掌的最晚起跳(左端点) 右端点自然也能出来 先按左端点排序 如果他右面的和他相交,就更新 用并查集维护这个更新的关系 更新的同时维护高就好 ...
- 第13届景驰-埃森哲杯广东工业大学ACM程序设计大赛--A-跳台阶
链接:https://www.nowcoder.com/acm/contest/90/A 来源:牛客网 1.题目描述 小明在坐景驰科技研发的无人车到达了目的地. 景驰科技(JingChi.ai)是一家 ...
- JavaScript--动态添加元素(纯js书写table并删除数据)
本文是对上一篇博文的扩展,用js书写表格,并添加和删除数据,详细代码解释见代码页. 对于文中使用的script脚本函数,下载地址如下:https://pan.baidu.com/s/13OFnj7nc ...
- 用bootstrap框架弄的网站。(首页)
网站的每一处代码都加上注解,以便浏览! 效果图: <!doctype html> <html lang="zh-cn"> <head> ...