序言

tensorflow中,为了编译并运行能够使用 GPU 的 TensorFlow, 需要先安装 NVIDIA 提供的 Cuda Toolkit和 CUDNN

失败的安装过程

首先tensorflow中文社区的安装提示中提示Cuda Toolkit 7.0和 CUDNN 6.5 V2.这版本.在CUDA官网中查询release notes:http://docs.nvidia.com/cuda/#axzz4g719e0em,得知Cuda Toolkit主要包含一下内容:
CompilerThe CUDA-C and CUDA-C++ compiler
ToolsThe following development tools are available in the bin/ directory (except for Nsight Visual Studio Edition (VSE) which is installed as a plug-in to Microsoft Visual Studio)IDEs: nsight (Linux, Mac), Nsight VSE (Windows)Debuggers: cuda-memcheck, cuda-gdb (Linux, Mac), Nsight VSE (Windows)Profilers: nvprof, nvvp, Nsight VSE (Windows)Utilities: cuobjdump, nvdisasm, gwiz

cudnn主要是NIVAD提供的神经网络GPU加速的库.

我选择安装最新版本,想当然也知道,N卡加速肯定有系统要求的,去官网查看安装说明里面有如下内容:
To use CUDA on your system, you will need the following installed:CUDA-capable GPUA supported version of Linux with a gcc compiler and toolchainNVIDIA CUDA Toolkit (available at http://developer.nvidia.com/cuda-downloads) 显卡需求:TensorFlow 的 GPU 特性只支持 NVidia Compute Capability >= 3.5 的显卡.
操作系统需求和GCC版本需求.
最后才是安装开发TOOLKIT.
我选择runfile的安装形式,官网提示直接使用 sudo sh cudaxxxx报错:
It appears that an X server is running. Please exit X before installation. If you're sure that X is not running, but are getting this error, please delete any X lock files in /tmp.
官网提示:
Disable the Nouveau drivers.
Reboot into text mode (runlevel 3).
Verify that the Nouveau drivers are not loaded. If the Nouveau drivers are still loaded, consult your distribution's documentation to see if further steps are needed to disable Nouveau.其中disable需要将模块添加黑名单,然后加载到内核中.期间需要使用到mkinitramfs报错:E: Problem with MergeList /var/lib/apt/lists/ppa.launchpad.net_vincent-c_nevernote_ubuntu_dists_xenial_main_binary-amd64_Packages解决:sudo rm /var/lib/apt/lists/* -vflsmod | grep nouveau显示已经没有该模块,报错如下please delete any x lock file in /tmp删除/temp 下.X0文件

ERROR: The kernel module failed to load, because it was not signed by a key

   that is trusted by the kernel. Please try installing the driveragain, and sign the kernel module when prompted to do so.

仔细看下报错,然后阅读安装说明.

查看/usr/src/ 目录下没有kernel source

使用apt-get install linux-source 4.8.0安装

放弃了安装默认361版本的驱动,去官网上下载375的适配我设配的版本。安装后NVIDIA驱动问题,导致桌面循环登录(不确定是不是这个原因,我猜的)

现在桌面进不去,首先我想先把NVIDIA的驱动给删掉,重启试试。

命令行下中文乱码(也是醉了,把语言还原成英文算了)

用vi(或nano等文本编辑器)打开 /etc/default/locale 文件
将原来的配置内容修改为
LANG=”en_US.UTF-8″
LANGUAGE=”en_US:en”

Use the following command to uninstall a Driver runfile installation:

$ sudo /usr/bin/nvidia-uninstall

reboot 继续报错,session 会话下的所有内容都不会被保存。此时startx 可以进去了

xsession-error 里面全都是sogoupy的错误?

安装gdm后命令行也无法进入。放弃了~

重装系统待续。~


重新整理安装步骤

经过上述过程,我的ubuntu系统已经崩溃掉了。解决方法如下。
1.重装Ubuntu16.04系统。
2.安装NVIDIA375驱动,仍然进不去。
3.卸载sudo ./NVIDIAxxxxxxx.run –uninstall 后可以进去。
根据别人博客说明,解决如下
1.lsmod |grep nouveau,查看到源生的驱动在。
2.禁用自带的 nouveau nvidia驱动 (important!)
创建一个文件通过命令 sudo vim /etc/modprobe.d/blacklist-nouveau.conf
并添加如下内容:
blacklist nouveau
options nouveau modeset=0
再更新一下
sudo update-initramfs -u
修改后需要重启系统。确认下Nouveau是已经被你干掉,使用命令: lsmod | grep nouveau
3.禁掉lightdm桌面管理器,安装驱动(secure boot disabled)
sudo /etc/init.d/lightdm stop
sudo ./NVIDIA-Linux-x86_64-375.20.run –no-opengl-files(这个参数不知道什么用,别人说有用我就加了)
sudo /etc/init.d/lightdm start
4.OK,解决。

PS:其中用了sigh the kernel 选项,因为without it 安装失败。

安装cuda toolkit

sudo sh cuda_xxxx_linux.run
选项如下

DescriptionThis package includes over 100+ CUDA examples that demonstrate
various CUDA programming principles, and efficient CUDA
implementation of algorithms in specific application domains.
The NVIDIA CUDA Samples License Agreement is available in
Do you accept the previously read EULA?
accept/decline/quit: acceptInstall NVIDIA Accelerated Graphics Driver for Linux-x86_64 367.48?
(y)es/(n)o/(q)uit: nInstall the CUDA 8.0 Toolkit?
(y)es/(n)o/(q)uit: yEnter Toolkit Location[ default is /usr/local/cuda-8.0 ]:Do you want to install a symbolic link at /usr/local/cuda?
(y)es/(n)o/(q)uit: yInstall the CUDA 8.0 Samples?
(y)es/(n)o/(q)uit: yEnter CUDA Samples Location[ default is /home/c302 ]:Installing the CUDA Toolkit in /usr/local/cuda-8.0 ...
Installing the CUDA Samples in /home/c302 ...
Copying samples to /home/c302/NVIDIA_CUDA-8.0_Samples now...
Finished copying samples.===========
= Summary =
===========Driver:   Not Selected
Toolkit:  Installed in /usr/local/cuda-8.0
Samples:  Installed in /home/c302Please make sure that-   PATH includes /usr/local/cuda-8.0/bin-   LD_LIBRARY_PATH includes /usr/local/cuda-8.0/lib64, or, add /usr/local/cuda-8.0/lib64 to /etc/ld.so.conf and run ldconfig as rootTo uninstall the CUDA Toolkit, run the uninstall script in /usr/local/cuda-8.0/binPlease see CUDA_Installation_Guide_Linux.pdf in /usr/local/cuda-8.0/doc/pdf for detailed information on setting up CUDA.***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 361.00 is required for CUDA 8.0 functionality to work.
To install the driver using this installer, run the following command, replacing <CudaInstaller> with the name of this run file:sudo <CudaInstaller>.run -silent -driverLogfile is /tmp/cuda_install_9045.log

添加环境变量

export PATH=/usr/local/cuda-8.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH

添加系统变量修改到系统文件

sudo vi /etc/profile
reboot(重启生效)

验证cuda

c302@c302-dl:~/Downloads$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2016 NVIDIA Corporation
Built on Sun_Sep__4_22:14:01_CDT_2016
Cuda compilation tools, release 8.0, V8.0.44

测试

cd ‘/home/xxxx/NVIDIA_CUDA-8.0_Samples’
make  //这里需要点时间
cd 0_Simple/matrixMul
./matrixMul

其他问题:
循环登录
黑屏
驱动不工作参见如下博客
http://www.cnblogs.com/matthewli/p/6715553.html?utm_source=tuicool&utm_medium=referral
secure boot情况下签名内核模块参考如下:
http://www.linuxdiyf.com/linux/20154.html

ubuntu16.04 + GTX1050-Ti + cuda8.0(解决桌面重复登录)相关推荐

  1. gtx1050双显卡 linux,ubuntu16.04+GTX1050-Ti+cuda8.0(解决桌面重复登录)

    序言 tensorflow中,为了编译并运行能够使用 GPU 的 TensorFlow, 需要先安装 NVIDIA 提供的 Cuda Toolkit和 CUDNN 失败的安装过程 首先tensorfl ...

  2. 群星怎么让服务器稳定,DL服务器主机环境配置(ubuntu14.04+GTX1080+cuda8.0)解决桌面重复登录...

    前面部分是自己的记录,后面方案部分是成功安装驱动+桌面的正解 问题的开始在于:登录不了桌面,停留在重复输入密码界面 博文中分析的结论: 虚拟机中不能直接调用物理显卡进行 CUDA 编程:虚拟机中运行 ...

  3. DynamicFusion在ubuntu16.04+显卡GT740+cuda8.0上的实现

    目录 介绍 1.驱动与cuda安装 (1)驱动安装 a.驱动下载 b.禁用nouveau驱动 c.禁用X-Window服务 d.命令行安装驱动 e.驱动测试 (2)cuda7.5安装 2.环境配置 ( ...

  4. GTX1050 Ti(notebook)+Ubuntu16.04上安装Cuda8.0

    本文主要总结了我在笔记本电脑上安装cuda8.0的过程和经验.内容参考了博客 http://blog.csdn.net/victoryaoyu/article/details/70034569, ht ...

  5. [深度学习]Ubuntu16.04 + GTX 1050 + cuda8.0 + cuDNN5.1 + caffe安装详解

    首先吐个槽,ubuntu + nvidia的显卡驱动简直是反人类,害的我折腾了一天多. 一.问题及解决办法 寒假放假回家没事干,正好给家里电脑升级了显卡gtx1050可以跑跑CNN.我在实验室的显卡是 ...

  6. Ubuntu16.04+Titan X+CUDA8.0+cudnn5.1+Caffe

    1.安装Ubuntu16.04 LTS x64 利用工具rufus制作USB系统盘(官方下载64位版本: ubuntu-16.04-desktop-amd64.iso),因为已有Win7系统,此处选择 ...

  7. 配有Tesla K40c的服务器新装Ubuntu16.04并安装CUDA8.0、Anaconda3、Matlab2016a、OPENCV3.1、CuDNN5.1、MXNet...

    注:本文原创,作者:Noah Zhang  (http://www.cnblogs.com/noahzn/) 决定加入深度学习的大军,感谢导师给配了台新设备!第一次接触服务器并配置开发环境,整个过程中 ...

  8. 安装ubuntu16.04+Nvidia驱动+Cuda8.0+Cudnn5.1+Matlab R2017b+Pycharm+WPS

    硬件环境:NVIDIA GTX 760+i5 本文只是为了方便以后自己再安装时比较方便,做的一个记录.所以基本所有步骤都来自各参考文章的步骤. 安装ubuntu16.04 安装Nvidia驱动 安装C ...

  9. tesla p100 linux,服务器(Tesla P100)Ubuntu16.04+显卡驱动+cuda8.0+cudnn7.0.5

    首先推荐这两篇文章,写完之后才发现: https://blog.csdn.net/yhaolpz/article/details/71375762 https://blog.csdn.net/bali ...

最新文章

  1. git 代码回退_「Vue 入门系列」第三期,适合新手入门的 Git 使用教程
  2. 显著增加bash交互舒适度的.inputrc
  3. guido正式发布python年份_Python 基础学习笔记.docx
  4. RPC框架的可靠性设计
  5. 我的同事Leo做的一个AR增强现实的项目
  6. debug模式的开关与功能 django
  7. keychain 的学习
  8. AttributeError: 'NoneType' object has no attribute 'append'
  9. 老web换新枝----Sails.js移动设备的全新生产力(一)
  10. 生物信息学的研究方向
  11. c语言程序设计计划书示例,C语言学习计划书
  12. Hadoop原理之checkpoint机制
  13. 问题匹配/文本匹配数据集(自用)
  14. [虚树dp] bzoj2286: Sdoi2011消耗战
  15. html语言制作表格模板,十个最简单实用的Table设计模板
  16. spring tx:advice(转)
  17. Thinkpad E450c开启Intel virtual technology
  18. 经典动画《大闹天宫》4K 版上映,老动画是如何修复的?
  19. java实现word模板文件填充
  20. Android 颜色(不)透明度的使用及项目开发中的心得总结

热门文章

  1. css3 calc函数不生效问题
  2. MySQL数据库中arg函数_数据库函数有哪些
  3. 钱越存越少,合理吗?
  4. linux最新分区方案
  5. Java实现二叉查找树及其相关操作
  6. ios中safari浏览器中window.open()无效的问题
  7. 玩转 RTC时钟库 DS3231
  8. javascript王国的一次旅行,一个没有类的世界怎么玩转面向对象?
  9. 教你如何在短时间迅速掌握海量SAT词汇
  10. 【windows系统cmd下打开管理员模式】