Ubuntu 18.04 GT610 Cuda8.0 Caffe环境搭建

20170122-dev-install-caffe layout title categories tags date description post 深度学习:玩转caffe之安装 blog framework tools 2017-01-22 12:20:20 -0800 Caffe i... 阅读详情

安装前操作

  1. 验证系统是否具有支持CUDA的GPU
     确定显卡型号:
      查看系统属性,或者从命令行输入:
        $ lspci | grep -i nvidia
        只有NVIDIA显卡,并且能在 http://developer.nvidia.com/cuda-gpus 找到对应型号,那么该GPU就支持CUDA功能。

  2. GPU和CUDA Toolkit的对应版本确认
    支持GPU的驱动版本:
      https://www.nvidia.cn/object/unix-cn.html
    CUDA Toolkit版本与GPU版本对应信息:
      CUDA和显卡驱动对应信息
      信息来源:https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html
      相对较早的GPU,建议GPU支持的驱动版本和CUDA Toolkit版本都尽量选择对应较低的版本号,否则可能导致后面Caffe在运行时出现异常。

    验证系统是否正在运行受支持的Linux版本
      根据不同版本CUDA Toolkit,确定是否支持CUDA Toolkit。
      例如CUDA Toolkit v8.0:
      在这里插入图片描述
      信息来源:https://docs.nvidia.com/cuda/archive/8.0/cuda-installation-guide-linux/index.html

    验证系统是否已安装gcc
      查看gcc版本:
        $ gcc --version
      验证系统是否安装了正确的内核头文件和开发包。
        查看正在运行的分发和版本号:
          $ uname -m && cat /etc/*release
        或者,过运行以下命令找到系统正在运行的内核版本:
          $ uname -r
      如果没有任何信息显示,可以使用以下命令安装当前运行的内核的内核头文件和开发包:
        $ sudo apt-get install linux-headers - $(uname -r)

安装显卡驱动

  虽然在安装CUDA Toolkit会提供对应的驱动版本,但仍建议自行查找合适的驱动安装,因为CUDA Toolkit自带的驱动不一定是适合当前GPU的版本。
  需要下载以下package:
    GPU驱动:NVIDIA-Linux-x86_64-390.87.run
禁用Nouveau
  要安装显示驱动程序,必须首先禁用Nouveau驱动程序。Linux的每个发行版都有不同的方法来禁用Nouveau。
  创建文件:
    $ sudo vi /etc/modprobe.d/blacklist-nouveau.conf
  输入一下信息并保存:
    blacklist nouveau
    options nouveau modeset=0
  重新生成内核initramfs:
    $ sudo update-initramfs -u
  输入一下命令,查看是否禁用成功:
    $ lspci | grep nouveau
  没有任何信息显示,则表示禁用成功。如果此方法不能禁用成功,则可以选择以下方式:
    直接移除这个驱动(备份出来):
      $ mv /lib/modules/3.0.0-12-generic/kernel/drivers/gpu/drm/nouveau/nouveau.ko /lib/modules/3.0.0-12-generic/kernel/drivers/gpu/drm/nouveau/nouveau.ko.org
  重新加载一下
    $ sudo update-initramfs -u
  重启:
    $ sudo reboot

  显示器字体有明显变大模糊的情况。

安装驱动
  执行安装:
    $ sudo sh NVIDIA-Linux-x86_64-390.87.run
  运行安装文件过程中如果提示you appear to be running an x server;的类似错误,请运行以下命令进行关闭:
    $ sudo /etc/init.d/lightdm stop
  检查是否安装成功:
    $ cat /proc/driver/nvidia/version
    显示如下信息:
    在这里插入图片描述
    则安装成功。

安装CUDA Toolkit

  CUDA Toolkit的安装有多种方式,我们采用最可控的一种,runfile install(运行文件安装)。
  需要下载以下package:
    CUDA Toolkit工具包:cuda_8.0.61_375.26_linux.run
  官方建议GPU算力在3.0以下,不要安装Cudnn。因此,我们这次的环境搭建中不支持Cudnn(GT610算力为2.1,可在 http://developer.nvidia.com/cuda-gpus 查询相关信息)。
  确保显卡安装成功的前提下,进行CUDA Toolkit安装。
    $ sudo sh cuda_8.0.61_375.26_linux.run --no-opengl-libs //不安装opengl

  配置安装选项:

在这里插入图片描述
  显示如下信息,则是安装运行成功:
在这里插入图片描述

  配置环境变量:

    $ sudo vi ~/.bashrc
    将如下内容保存至.bashrc:
    export PATH=/usr/local/cuda/bin:$PATH
    export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
    执行生效:
    $ source ~/.bashrc

  检验CUDA 是否安装成功:

    cd /usr/local/cuda-8.0/samples/1_Utilities/deviceQuery
    sudo make
    ./deviceQuery

    显示Result = PASS,则表示安装成功:在这里插入图片描述
    如果没有成功,则需要卸载后重新install。
  以上安装内容,参考 https://docs.nvidia.com/cuda/archive/8.0/cuda-installation-guide-linux/index.html#runfile 第4章节和 https://blog.csdn.net/qq473179304/article/details/79444609 。

安装OpenCV3.4.3(含opencv_contrib)

  因为需要包含opencv_contrib的一些模块,所以OpenCV采用源码编译安装。

  安装FFmpeg

  鉴于OpenCV对FFmpeg的依赖,需要先安装FFmpeg。
    $ git clone https://github.com/FFmpeg/FFmpeg.git
    $ git checkout n3.4.5 // checkout到一个可以支持opencv3.4.3的任一版本
    $ ./configure --enable-shared // 需要编译成静态库
    $ make
    $ sudo make install

  安装Opencv

  opencv_contrib模块源码克隆:git clone https://github.com/opencv/opencv_contrib.git
  切换到指定版本:
    cd ~/opencv_contrib // 进入到opencv_contrib源码路径
    git checkout 3.4.3 // 切换到分支3.4.3

  [注意]:这里必须要与OpenCV的源码版本保持一致

  OpenCV模块源码克隆:git clone https://github.com/opencv/opencv.git
  依赖包安装:
    $ sudo apt-get install build-essential
    $ sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
  可选包:

ubuntu18, nvidia驱动的一些烦心事。 首先是一些结论: 1,在ubuntu18下用apt的包安装命令安装nvidia有假,虽然安装了能让xplane10跑起来,但性能明显差多了,卡图啊。 2,用nvidia 官网上下的.run的安装包安装吧。 今天重新安装时又发现新问题: 1,要先安装ubuntu18下用apt的nvidia驱动,但这处驱动个nvidia给出的不一样,安装时会改变一些ubuntu的配置。如果用先安装,这个... 阅读详情

相关推荐

利用Virtuoso IC 618进行LDO稳定性分析与补偿设计

本文详细介绍了如何利用Virtuoso IC 618进行LDO稳定性分析与补偿设计。通过搭建仿真环境、运行STB分析诊断环路问题,并深入探讨密勒补偿、调零电阻等关键技术,帮助工程师在Virtuoso平台中高效完成LDO的稳定性优化与验证,确保芯片在各种工艺角下的鲁棒性。

weixin_29170327的博客 169

Redis架构演进:从主从、哨兵到集群,如何支撑亿级流量的秒杀场景?

本文深入探讨了分布式缓存Redis的三种核心高可用模式:主从复制、哨兵模式与集群模式。以高并发的电商秒杀业务为切入点,我们分析了每种模式的优缺点和适用场景,并最终选择Redis集群模式作为最佳解决方案。文章提供了基于Spring Boot和Spring Data Redis的完整实现代码,详细展示了如何配置和使用Redis集群来应对高并发、高可用的挑战,旨在帮助开发者在实际项目中做出正确的技术选型和架构设计。

lingRJ777的博客 728

MODIS 遥感数据批量下载(使用Cygwin)

MODIS 遥感数据批量下载(使用Cygwin)包含Cygwin的下载教程

weixin_45913084的博客 918

基于电子海图的水面无人艇全局路径规划

Research and Implementation of Global Path Planning for Unmanned Surface Vehicle Based on Electronic Chart (基于电子海图的水面无人艇全局路径规划)   该论文已经在ICMIR2017会议上发表,附上springer的文献地址 Research and Implementation of Gl...

weixin_30797199的博客 1594

Mac Pro M2芯片成功安装麒麟银河高级服务器虚拟机

本人用的是1、Macbook m2pro芯片 16G+5123、安装homebrew、wegt、qemu。

vagatable_XX的博客 3312

从零搭建SPI通信系统:AXI Quad SPI IP核在Xilinx平台上的完整配置流程

本文详细介绍了在Xilinx平台上使用AXI Quad SPI IP核从零搭建SPI通信系统的完整配置流程。涵盖IP核架构解析、Vivado环境配置、寄存器编程实战及性能优化策略,帮助开发者快速实现高速稳定的SPI通信,特别适用于嵌入式系统开发中的外围设备连接需求。

hh234的博客 1055

【异常】Cursor编辑器 “Taking longer than expected...“ 报错全链路排查与解决方案

该提示并非传统的程序崩溃或语法报错,本质是Cursor编辑器的超时预警机制——当核心任务(云端AI推理请求、本地项目索引等)的执行耗时超出系统预设阈值时,触发的用户告知类提示,核心诱因是任务执行全链路出现阻塞或性能瓶颈。以下方案按排查优先级从高到低排序,覆盖从快速急救到根因根治的全流程,可按步骤逐步验证解决。针对大仓库、多依赖项目的索引超时问题,核心是通过规则过滤无效文件,从根源降低索引负载。

奶爸的编程之路,也就一周冷个三天 3137

RK3588网卡出现丢包或者带宽不足的问题验证排查

注意除了有最大的TCP数据接收缓冲,还有/proc/sys/net/core/wmem_max — 最大的TCP数据发送缓冲可以调整,这里暂时没用到,针对具体需要可适当调整。比如把ethx接口中断从默认的cpu0迁移到其它cpu,例如将eth0中断234移到cpu7 (10是16进制, cpu0 =3588的cpu有8个核,4个A55(小核)+4个A76(大核),可以找到对应中断 将中断从默认cpu0核切到cpu7。tcp_rmem:单位是字节,接收缓存区大小,缓存从对端接收的数据,后续会被应用程序读取。

Android/Linux驱动开发传帮带学习,让驱动入门门槛更低! 2034

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

上一篇: TensorFLow object detection API训练数据集
Arvin_liang
博客等级 码龄9年 1粉丝 4原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值