序言

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主要包含一下内容:

Compiler

The CUDA-C and CUDA-C++ compiler

Tools

The 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 GPU

A supported version of Linux with a gcc compiler and toolchain

NVIDIA 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/* -vf

lsmod | 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 driver again, 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

选项如下

Description

This 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: accept

Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 367.48?

(y)es/(n)o/(q)uit: n

Install the CUDA 8.0 Toolkit?

(y)es/(n)o/(q)uit: y

Enter 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: y

Install the CUDA 8.0 Samples?

(y)es/(n)o/(q)uit: y

Enter 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/c302

Please 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 root

To uninstall the CUDA Toolkit, run the uninstall script in /usr/local/cuda-8.0/bin

Please 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 with the name of this run file:

sudo .run -silent -driver

Logfile 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.linuxdiyf.com/linux/30056.html

secure boot情况下签名内核模块参考如下:

http://www.linuxdiyf.com/linux/20154.html

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

  1. ubuntu16.04 + GTX1050-Ti + cuda8.0(解决桌面重复登录)

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

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

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

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

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

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

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

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

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

  6. tensorflow gpu python3.5_tensorflow环境搭建:Ubuntu16.04+python3.5+cuda8.0+tensorflow1.4

    Ubuntu16.04是深度学习主流的操作系统,兼容性也最好. python3.5能够安装支持tensorflow的gpu cuda是nvidia推出的运算平台,cuda8.0对tensorflow比 ...

  7. 服务器(Dell T360)Ubuntu16.04+Tesla P100+CUDA8.0+CUDNN7.0.5配置

    这篇文章的方法最后也有问题! 最终配置成功版请见下面这个链接的内容: https://blog.csdn.net/u014106566/article/details/83314626 前言: 一开始 ...

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

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

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

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

最新文章

  1. Road-SLAM:基于道路标线车道级精度SLAM
  2. MPB:林科院袁志林组-​栎类外生菌根形态学特征描述
  3. linux java socket编程_linux下java程序与C语言程序通过SOCKET通信的简单例子
  4. 信息系统项目管理师-质量管理知识点
  5. 团队组建阶段,项目经理要做些什么?
  6. “约见”面试官系列之常见面试题第一篇说说promise(建议收藏)
  7. C. 啊对对对 (南阳理工oj—21第二次招新赛)
  8. Jinja2模板引擎语法
  9. (剑指Offer)面试题49:把字符串转换为整数
  10. BiLSTM-CRF模型中的CRF层讲解
  11. 区块链技术将有可能彻底颠覆音乐行业,思想启迪+P2Ptech,end
  12. 巴斯勒相机的ip掩码_子网掩码计算器让IP掩码计算不再难!
  13. 雷达 航迹跟踪 matlab,一种基于MATLAB建模的雷达航迹显示求解方法与流程
  14. STM8S AD采样电压值——采样值与实际值之间的计算
  15. am大学计算机科学,美国大学本科计算机科学专业排名一览
  16. python计算字节数_Python len()函数详解:获取字符串长度或字节数
  17. 吃着火锅唱着歌,我了解到海底捞的信息化太厉害了
  18. 关于下载《Java程序员,上班那点事儿》的电子版
  19. Python运维开发入门到精通学习 Day3
  20. VLDB2021会议论文列表(可下载)

热门文章

  1. excel中最后几位数值为0处理方法
  2. 计算机二进制补码为什么是原码取反加一
  3. matlab粒子群优化算法工具箱,MATLAB粒子群优化算法(PSO)
  4. java解析excle
  5. 登录mysql 1251_Navicat 连接 MySql 报错1251解决方案(亲测)
  6. 一个和同事间的小笑话
  7. 美甲店如何通过小红书开拓渠道?美甲店做小红书有效果吗
  8. Java推送IOS通知消息
  9. linux中min函数用法,linux内核中的min、max函数
  10. 课堂教学的动态生成与教师回应策略的研究课题申请•评审书