大数据/深度学习机器组机以及CUDA10+RTX+18.04.2+Tensorflow1.13.1+cuDNN7.3.1

本文详细介绍了深度学习项目中GPU的选择依据,对比了NVIDIA不同型号GPU的性能参数,特别是针对单精度浮点运算、CUDA处理器数量及Tensor Core的重要性进行解析。作者最终选择了RTX2070,并分享了基于CUDA10、Python3.6的深度学习环境配置心得。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

组机缘由:

最近两次实习的工作内容,都与大数据关联不大,所积累的一些本就学得不深的知识便忘得不少。
深度学习和大数据都很感兴趣,考虑到毕设是深度学习项目,故准备过几天投一些大数据的实习岗。利用周末的时间,捣鼓毕设。这样一来,做大数据,好的CPU,大的内存必不可少;做深度学习,大显存的显卡必不可少。于是决定自己装台机器。

深度学习需要什么样的GPU?

NVIDIA 部分GPU的技术参数:

在这里插入图片描述
在这里插入图片描述

如何选择:

CUDA10与图灵架构特性
深度学习需要用到GPU的参数有:

  1. 单精度—深度学习只需要单精度,昂贵的双精度卡适合科学计算
    就单精度浮点性能而言,RTX 2070 Founders Edition为7.9TFLOPS,GTX 1080也有8.2TFLOPS。

  2. CUDA处理器—越多越好,无需解释
    比如这一代图灵显卡,RTX 2080 Ti/2080/2070分别使用不同的核心,全部都是独立型号,而RTX 2070显卡使用的是TU106-400核心。简单来说就是将RTX 2080 Ti规格剁剩一半,3组GPC单元,3×12=36组SM单元,经过计算,36×64=2304个CUDA单元。

  3. 张量处理单元(Tensor Core)—也是越多越好
    Pascal架构由于没有Tensor Core,直接就是0分,而RTX 2070则为252.1TFLOPS。
    所以,如果有钱,就上RTX2080Ti;我感觉RTX2070性价比高。不建议买丐版,卡吧里面,20系目前翻车不少。

最终决定的配置:

年后9代CPU一路狂飙,咬牙某东入了国行,4900Hz 1.35v,估计散片都难以挑出这样的雷。。。
在这里插入图片描述

装机

额。。。实在没精力写这一部分了。也没啥可写的

装机后的感想

  1. 真的快
  2. 电源、水冷不行,有噪音,影响强迫症患者工作

CUDA10还是CUDA9,Python3.6还是3.7?

上面已经说了,19年后组机的朋友,还是上RTX,性能肯定比GTX提升不少,不知有人做过测评没,什么时候看见的话,我把它贴出来
github很多人问为什么自己装了CUDA9.2,tensorflow却报错,说缺少9.0.so

  1. tensorflow目前没有官方的9.1 9.2编译的成品,民间有,docker镜像也有,当然也可以自己源码编译
  2. 1.13开始使用CUDA10 cudnn7.2编译:
    在这里插入图片描述
  3. 一直觉得硬件用新不用旧,软件不要用太新的,这次还真想倒腾下CUDA10,毕竟pytorch 1.0也有支持CUDA10的
  4. python就3.6吧,3.7的“配套设施”估计目前还是不太全,虽然3.7会是社区以后大力发展的版本,就像之前的2.7.X系列
  5. 此文写自2019年3月初

最终的深度学习环境

亲测稳定,安装步骤就不写了,都写烂了
ubuntu16.04.6 【目前不太想折腾18.04】

向老版本说拜拜:

名称版本
ubuntu18.04.2
python3.6.6
CUDA10.0
cuDNN7.3.1
tensorflow1.13.1
keras2.2.4
pytorch1.10.1

在这里插入图片描述

TensorRT 5推理加速引擎

在这里插入图片描述
目前我不清楚这个tensorRT所做的工作,以及它的使用对于普通深度学习开发者是否是透明的,甚至是否需要单独安装,不清楚
(貌似是一种推理加速,需要导出模型在tensorRT中工作???)
在这里插入图片描述

卸载cuda

1-1 RPM/Deb 安装的:

$ sudo yum remove <package_name> # Redhat/CentOS
$ sudo dnf remove <package_name> # Fedora
$ sudo zypper remove <package_name> # OpenSUSE/SLES
$ sudo apt-get --purge remove <package_name> # Ubuntu

1-2 runfile安装的:runfile安装的:

$ sudo /usr/local/cuda-X.Y/bin/uninstall_cuda_X.Y.pl

  1. 删除配置文件中相关export
  2. 卸载驱动(如果满足最低驱动版本限制,则没必要):卸载驱动(如果满足最低驱动版本限制,则没必要):

$ sudo /usr/bin/nvidia-uninstall


2019/3/28更
一直没时间去倒腾cuda10+tf1.13
4/16写完毕设再继续

参考

[1.] CUDA10与图灵架构特性
[2.] [Quadro RTX\GeForce RTX已来,来了解一下深度学习到底要用什么样的GPU] (https://blog.youkuaiyun.com/Su_wenfeng/article/details/82907890)
[3.] NVIDIA GeForce RTX 2070同步评测:光影与游戏AI的最佳呈现者
[4.] https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html
[5.] https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html
[6.] https://docs.nvidia.com/deeplearning/sdk/tensorrt-install-guide/index.html

自编译tensorflow1.python3.5,tensorflow1.12; 2.支持cuda10.0,cudnn7.3.1,TensorRT-5.0.2.6-cuda10.0-cudnn7.3; 3.无mkl支持; 软硬件硬件环境:Ubuntu16.04,GeForce GTX 1080 TI 配置信息: hp@dla:~/work/ts_compile/tensorflow$ ./configure WARNING: --batch mode is deprecated. Please instead explicitly shut down your Bazel server using the command "bazel shutdown". You have bazel 0.19.1 installed. Please specify the location of python. [Default is /usr/bin/python]: /usr/bin/python3 Found possible Python library paths: /usr/local/lib/python3.5/dist-packages /usr/lib/python3/dist-packages Please input the desired Python library path to use. Default is [/usr/local/lib/python3.5/dist-packages] Do you wish to build TensorFlow with XLA JIT support? [Y/n]: XLA JIT support will be enabled for TensorFlow. Do you wish to build TensorFlow with OpenCL SYCL support? [y/N]: No OpenCL SYCL support will be enabled for TensorFlow. Do you wish to build TensorFlow with ROCm support? [y/N]: No ROCm support will be enabled for TensorFlow. Do you wish to build TensorFlow with CUDA support? [y/N]: y CUDA support will be enabled for TensorFlow. Please specify the CUDA SDK version you want to use. [Leave empty to default to CUDA 10.0]: Please specify the location where CUDA 10.0 toolkit is installed. Refer to README.md for more details. [Default is /usr/local/cuda]: /usr/local/cuda-10.0 Please specify the cuDNN version you want to use. [Leave empty to default to cuDNN 7]: 7.3.1 Please specify the location where cuDNN 7 library is installed. Refer to README.md for more details. [Default is /usr/local/cuda-10.0]: Do you wish to build TensorFlow with TensorRT support? [y/N]: y TensorRT support will be enabled for TensorFlow. Please specify the location where TensorRT is installed. [Default is /usr/lib/x86_64-linux-gnu]://home/hp/bin/TensorRT-5.0.2.6-cuda10.0-cudnn7.3/targets/x86_64-linux-gnu Please specify the locally installed NCCL version you want to use. [Default is to use https://github.com/nvidia/nccl]: Please specify a list of comma-separated Cuda compute capabilities you want to build with. You can find the compute capability of your device at: https://developer.nvidia.com/cuda-gpus. Please note that each additional compute capability significantly increases your build time and binary size. [Default is: 6.1,6.1,6.1]: Do you want to use clang as CUDA compiler? [y/N]: nvcc will be used as CUDA compiler. Please specify which gcc should be used by nvcc as the host compiler. [Default is /usr/bin/gcc]: Do you wish to build TensorFlow with MPI support? [y/N]: No MPI support will be enabled for TensorFlow. Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native -Wno-sign-compare]: Would you like to interactively configure ./WORKSPACE for Android builds? [y/N]: Not configuring the WORKSPACE for Android builds. Preconfigured Bazel build configs. You can use any of the below by adding "--config=" to your build command. See .bazelrc for more details. --config=mkl # Build with MKL support. --config=monolithic # Config for mostly static monolithic build. --config=gdr # Build with GDR support. --config=verbs # Build with libverbs support. --config=ngraph # Build with Intel nGraph support. --config=dynamic_kernels # (Experimental) Build kernels into separate shared objects. Preconfigured Bazel build configs to DISABLE default on features: --config=noaws # Disable AWS S3 filesystem support. --config=nogcp # Disable GCP support. --config=nohdfs # Disable HDFS support. --config=noignite # Disable Apacha Ignite support. --config=nokafka # Disable Apache Kafka support. --config=nonccl # Disable NVIDIA NCCL support. Configuration finished 编译: bazel build --config=opt --verbose_failures //tensorflow/tools/pip_package:build_pip_package 卸载已有tensorflow: hp@dla:~/temp$ sudo pip3 uninstall tensorflow 安装自己编译的成果: hp@dla:~/temp$ sudo pip3 install tensorflow-1.12.0-cp35-cp35m-linux_x86_64.whl
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值