DL服务器主机环境配置(ubuntu14.04+GTX1080+cuda8.0)解决桌面重复登录

前面部分是自己的记录,后面方案部分是成功安装驱动+桌面的正解

问题的开始在于:登录不了桌面,停留在重复输入密码界面

博文中分析的结论:

虚拟机中不能直接调用物理显卡进行 CUDA 编程;虚拟机中运行 CUDA 需要硬件和软件的配合才能使用,对于一般使用者可能暂时不太可能的。

参考博文:

深度学习主机环境配置: Ubuntu16.04+Nvidia GTX 1080+CUDA8.0

深度学习主机环境配置: Ubuntu16.04+GeForce GTX 1080+TensorFlow

ubuntu14.04+cuda8.0(GTX1080)+caffe安装

如何搭建一台深度学习服务器

Ctrl+alt+F1进入字符界面,关闭图形界面

sudo service lightdm stop //必须有,不然会安装失败
sudo /etc/init.d/lightdm stop //一样的命令 sudo chmod 755 NVIDIA-Linux-x86_64-367.27.run //获取权限
sudo ./NVIDIA-Linux-x86_64-367.27.run //安装驱动

Accept

Continue installation

安装完成之后

sudo service lightdm start

图形界面出现,然后关机,由让人重复输入密码,登录不了

博主

$ sudo /etc/init.d/gdm stop
$ sudo nvidia-installer --update
$ sudo /etc/init.d/gdm start

升级到375版本, 还是没用,启动进入不了桌面,重复登录

Install driver 367

Uninstall previous nvidia drivers.

$ sudo apt-get purge nvidia-*

Stop light gdm (graphical interface)

$ sudo service lightgdm

Go to tty (CTRL+ALT+F1). Set your init state to 3 (text only mode). It is important to do this. Note these commands on a paper or something. I experienced sometimes the tty does not show with the newest driver. I just ssh to my PC as a way around.

$ sudo init 3

Log in to tty and cd to the directory where your have downloaded the driver.

$ sudo ./NVIDIA-Linux-x86_64-367.35.run

It will ask if you want to install 32-bit libraries, say no (assuming you do not have a 32-bit OS, hopefully. If you do have a 32-bit OS it is a good idea to upgrade…)

In a few minutes it is done….smooth. Reboot your PC

$ sudo reboot

update 之后还是不能进 图形界面

Uninstall previous nvidia drivers.

sudo apt-get purge nvidia-*
sudo apt-get autoremove
sudo apt-get --purge remove nvidia-*

remove 之后,

nvidia-smi

还是能看到gpu的。why?

卸载不了?

sudo apt-get install nvidia-prime

$ sudo /etc/init.d/lightdm stop
$ sudo nvidia-installer --update
$ sudo /etc/init.d/lightdm start

升级到375版本, 还是没用,启动进入不了桌面,重复登录

有人说,安装必须要在安装桌面前安装GTX 1080 driver,后面方案验证来看, 那个参数才是关键。

解决方法

利用sudo gedit /etc/modprobe.d/blacklist-nouveau.conf新建blacklist-nouveau.conf文件,输入命令

blacklist nouveau

blacklist lbm-nouveau

options nouveau modeset=0

alias nouveau off

alias lbm-nouveau off

保存并退出。这一步是为了禁掉Ubuntu自带开源驱动nouveau。之后sudo reboot重启系统。在终端执行命令

lsmod | grep nouveau

查看nouveau模块是否被加载。如果什么都没输出,则执行下一步。

根本问题在于 参数: --no-opengl-files

sudo /etc/init.d/lightdm stop
sudo ./NVIDIA-Linux-x86_64-375.20.run --no-opengl-files
sudo /etc/init.d/lightdm start

即可以正常登录界面了!!

在安装过程中的选项:

Accept

Continue installation

register the kernel moudle sources with DKMS?

NO

Would you like to run the nvidia-xconfig utility to automatically update your X Configuration file so set the NVIDIA X driver will be used when you restart X?

NO

Install 32-Bit compatibility libraries?参考

NO

cuda8.0安装

运行

sudo sh cuda_8.0.44_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 <CudaInstaller> with the name of this run file:
sudo <CudaInstaller>.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

在最后添加上面两句,然后保存。使立即生效

sudo ldconfig //环境变量立即生效

验证 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

测试cuda的samples

cd ‘/home/zhou/NVIDIA_CUDA-8.0_Samples’
make //这里需要点时间

最后显示:

make[1]: Leaving directory `/home/c302/NVIDIA_CUDA-8.0_Samples/7_CUDALibraries/MersenneTwisterGP11213'

Finished building CUDA samples

cd 0_Simple/matrixMul

运行测试如下:

c302@c302-dl:~/NVIDIA_CUDA-8.0_Samples/0_Simple/matrixMul$ ./matrixMul
[Matrix Multiply Using CUDA] - Starting...
GPU Device 0: "GeForce GTX 1080" with compute capability 6.1 MatrixA(320,320), MatrixB(640,320)
Computing result using CUDA Kernel...
done
Performance= 1109.06 GFlop/s, Time= 0.118 msec, Size= 131072000 Ops, WorkgroupSize= 1024 threads/block
Checking computed result for correctness: Result = PASS NOTE: The CUDA Samples are not meant for performance measurements. Results may vary when GPU Boost is enabled.

下一篇将会是安装cuDNN、tensorflow等lib

DL服务器主机环境配置(ubuntu14.04+GTX1080+cuda8.0)解决桌面重复登录的更多相关文章

  1. caffe+GPU︱AWS.G2+Ubuntu14.04+GPU+CUDA8.0+cudnn8.0

    国服亚马逊的GPU实例G2.2xlarge的python+caffe的安装过程,被虐- 一周才装出来- BVLC/caffe的在AWS安装的官方教程github: https://github.com ...

  2. ubuntu14.04安装CUDA8.0

    ubuntu安装CUDA 因为深度学习需要用到CUDA,所以写篇博客,记录下自己安装CUDA 的过程. 1 安装前的检查 安装CUDA之前,首先要做一些事情,检查你的机器是否可以安装CUDA. 1.1 ...

  3. (转)深度学习主机环境配置: Ubuntu16.04+Nvidia GTX 1080+CUDA8.0

      深度学习主机环境配置: Ubuntu16.04+Nvidia GTX 1080+CUDA8.0 发表于2016年07月15号由52nlp 接上文<深度学习主机攒机小记>,这台GTX10 ...

  4. 深度学习主机环境配置: Ubuntu16.04 + GeForce GTX 1070 + CUDA8.0 + cuDNN5.1 + TensorFlow

    深度学习主机环境配置: Ubuntu16.04 + GeForce GTX 1070 + CUDA8.0 + cuDNN5.1 + TensorFlow 最近在公司做深度学习相关的学习和实验,原来一直 ...

  5. 深度学习主机环境配置: Ubuntu16.04+Nvidia GTX 1080+CUDA8.0

    不多说,直接上干货! 深度学习主机环境配置: Ubuntu16.04+Nvidia GTX 1080+CUDA8.0

  6. 深度学习主机环境配置: Ubuntu16.04+GeForce GTX 1080+TensorFlow

    接上文<深度学习主机环境配置: Ubuntu16.04+Nvidia GTX 1080+CUDA8.0>,我们继续来安装 TensorFlow,使其支持GeForce GTX 1080显卡 ...

  7. 初用Linux, 安装Ubuntu16.04+NVIDIA387+CUDA8.0+cudnn5.1+TensorFlow1.0.1

    因为最近Deep Learning十分热门, 装一下TensorFlow学习一下. 本文主要介绍安装流程, 将自己遇到的问题说明出来, 并记录自己如何处理, 原理方面并没有能力解释. 由于本人之前从来 ...

  8. Ubuntu16.04 + gtx1060 + cuda8.0 + cudnn5.1 + caffe + Theano + Tensorflow

    参考 ubuntu16.04+gtx1060+cuda8.0+caffe安装.测试经历 ,细节处有差异. 首先说明,这是在台式机上的安装测试经历,首先安装的win10,然后安装ubuntu16.04双 ...

  9. ubuntu16.04安装cuda8.0试错锦集

    ubuntu16.04安装cuda8.0试错锦集 参考文献: [http://www.jianshu.com/p/35c7fde85968] [http://blog.csdn.net/sinat_1 ...

随机推荐

  1. Kotlin 循环控制

    For 循环 for 循环可以对任何提供迭代器(iterator)的对象进行遍历,语法如下: for (item in collection) print(item) 循环体可以是一个代码块: for ...

  2. 第 8 章 容器网络 - 070 - 如何定制 Calico 网络 Policy?

    定制 Calico 网络 Policy Calico 默认的 policy 规则是:容器只能与同一个 calico 网络中的容器通信. Calico 能够让用户定义灵活的 policy 规则,精细化控 ...

  3. 《HTTP 权威指南》笔记:第十五章 实体与编码

     如果把 「HTTP 报文」想象为因特网货运系统的「箱子」,那么「HTTP 实体」就是报文中的实际的「货物」. 其中,实体又包含了「实体首部」 和 「实体主体」,实体首部用于描述各种参数,实体主体就 ...

  4. 【转】 RGB各种格式

      转自:https://blog.csdn.net/LG1259156776/article/details/52006457?locationNum=10&fps=1 RGB组合格式 名字 ...

  5. port 执行命令的封装和参数详解

    下面代码摘自rebar_utils.erl -module(tt7). %-export([start/0]). -compile(export_all). -define(FAIL, abort() ...

  6. Sonya and Problem Wihtout a Legend CodeForces - 714E (dp)

    大意: 给定序列, 每次操作可以任选一个数+1/-1, 求最少操作数使序列严格递增. 序列全-i后转化为求最少操作数使序列非降, 那么贪心可以知道最后$a_i$一定是修改为某一个$a_j$了, 暴力d ...

  7. 『PyTorch』第五弹_深入理解Tensor对象_下:从内存看Tensor

    Tensor存储结构如下, 如图所示,实际上很可能多个信息区对应于同一个存储区,也就是上一节我们说到的,初始化或者普通索引时经常会有这种情况. 一.几种共享内存的情况 view a = t.arang ...

  8. h5 中软键盘弹出后,点击退出键盘,页面无法恢复

    input 绑定blur事件,设置 window.scroll(0,0);

  9. 数据结构与算法之PHP排序算法(堆排序)

    一.堆的定义 堆通常是一个可以被看做一棵树的数组对象,其任一非叶节点满足以下性质: 1)堆中某个节点的值总是不大于或不小于其父节点的值: 每个节点的值都大于或等于其左右子节点的值,称为大顶堆.即:ar ...

  10. haxe相关的计划安排

    用多少写多少.先从入门开始,再到怎么写DSL解析器.最后自举(只是做个示范而已 在深入haxe的过程中,多少会跟typescript有交集,这些会边走边总结. 因为只是for example,所以这个 ...