1. 程式人生 > >ubuntu16.04 + GTX1050-Ti + cuda8.0(解決桌面重複登入)

ubuntu16.04 + GTX1050-Ti + cuda8.0(解決桌面重複登入)

序言

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 <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
reboot(重啟生效)

驗證cuda

[email protected]-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(解決桌面重複登入)

序言 tensorflow中,為了編譯並執行能夠使用 GPU 的 TensorFlow, 需要先安裝 NVIDIA 提供的 Cuda Toolkit和 CUDNN 失敗的安裝過程 首先tensorflow中文社群的安裝提示中提示Cuda Toolkit

深度學習環境搭建:Tensorflow1.4.0+Ubuntu16.04+Python3.5+Cuda8.0+Cudnn6.0

edi tensor pkgs strong www url 輸出 軟鏈接 5.0 目錄 深度學習環境搭建:Tensorflow1.4.0+Ubuntu16.04+Python3.5+Cuda8.0+Cudnn6.0 Reference 硬件說明: 軟件準備: 1. 安

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

這篇文章的方法最後也有問題! 最終配置成功版請見下面這個連結的內容: https://blog.csdn.net/u014106566/article/details/83314626 前言: 一開始我們實驗室嘗試用deb安裝包的方法安裝NVIDIA Tesla P100對應的顯

caffe2環境配置:ubuntu16.04 LTS+GTX1070+CUDA8.0+cuDNN8.0+Caffe2

主題 背景 環境 硬體配置 系統 安裝步驟 第一步ubuntu系統安裝略 第二步CUDA80安裝 第三步GTX1070驅動安裝 第四步檢

[openpose最新&簡單安裝]ubuntu16.04+openpose1.4+cuda8.0+cudnn5.1+opencv2.4+caffe

由於實驗室需要,被安排跑卡內基梅隆大學開源專案openpose。按照網山各種教程安裝環境及測試,都遇到各種問題,有的編譯成功了測試時還出問題。幾經重灌與嘗試,花了六七天的時間,綜合各種帖子的方法,最後成功了。特寫部落格記錄一下,也希望能幫到看到此部落格的人。 個人覺得前面的

Ubuntu16.04 原始碼安裝CUDA8.0 tensorflow GPU 踩坑記

Ubuntu16.04 原始碼安裝tensorflow GPU 踩坑記 最近需要原始碼安裝一下tensorflow的GPU原始碼,踩了很多坑留給需要的 1.首先安裝CUDA 1.1 如果你原來有NVIDIA的驅動先解除安裝掉 sudo ap

多圖超詳細Ubuntu16.04下配置CUDA8.0+cuDNN5.1+Caffe+OpenPose

前言:參加英特爾杯需要配置Caffe(Intel Caffe的安裝這裡就沒寫了)和OpenPose,網上找到的Ubuntu下配置的教程比較少,踩了一天的坑之後決定還是把它寫下來,方便後來的人配置開發環境。下面的教程裡面預設是N卡,且已經安裝好驅動了。 0.安裝依賴 因為對l

Ubuntu16.04 + GTX 1070 + CUDA8.0 + cuDNN5.1環境配置

1.ubuntu16.04安裝,這個就略過了。。注意最好是純ubuntu,不要搞虛擬機器,虛擬機器對於顯示卡的識別好像有問題(聽說)2.GTX1070顯示卡驅動一次開啟 設定===》軟體和更新==>附加驅動==》會自動提示推薦的顯示卡驅動,我這裡安裝的版本是3843.下

深度學習ubuntu16.04+tensorflow+gpu+CUDA8.0環境配置--------------nvidia-docker2安裝

1.首先安裝docker,這個沒有什麼問題 curl -sSL https://get.daocloud.io/docker | sh 2.安裝完成之後檢視docker版本及其他資訊 sudo docker version 注意: 在此處和以後

Ubuntu16.04 雙卡+cuda8.0安裝

ubuntu16.04解決了ubuntu14.04中筆記本雙卡(獨立顯示卡+ 整合顯示卡)的問題 下面一步驟能一次性安裝成功. step1:安裝Nvidia顯示卡驅動 我的電腦配置:Nvidia GTX950M + Ubuntu16.04 64位 由於預

ubuntu16.04安裝CUDA 8.0(很詳盡,包括一些坑的解決方法)

每次配置環境都頭疼得要死,總是會遇到各種各樣的問題,這次決心一勞永逸地解決這個問題,踩最多的坑,裝最穩的環境。 先介紹用於測試的電腦:作業系統是在清華映象上下載的ubuntu16.04LTS,核心版本是4.15.0-29-generic,電腦是聯想Y430P,顯示卡我沒記錯的話是GTX850M。 本篇絕大

ubuntu16.04 安裝opencv3.2.0

3rd mod spa numpy 環境 b- ads rect 庫文件 2.2 安裝opencv3.2.02.2.1 安裝opencv依賴庫在終端輸入以下命令,進行安裝opencv依賴庫:1. sudo apt-get install build-essential2.

ubuntu16.04升級 vim 8.0

vim 8.0一,首先安裝依賴sudo apt-get install libncurses5-dev libgnome2-dev libgnomeui-dev \ libgtk2.0-dev libatk1.0-dev libbonoboui2-dev \ libcairo2-dev libx1

【記錄】 編譯matconvnet on ubuntu16.04 with cuda 9.0

src get erro _for comment gpu ror vlfeat bsp 最近需要用到matconvnet 在Ubuntu16.04下。 因為TensorFlow 1.6 支持了CUDA 9.0 所以新機器就直接裝了9.0 但是編譯matconvnet 時遇

Ubuntu16.04安裝Chrome瀏覽器及解決root不能打開的問題

nod install 打開 all context nbsp file exec serve 1. 安裝桌面(emmm,不知道是否只執行第二個命令就行) # apt-get install gonme# apt-get install ubuntu-desktop2.

Ubuntu16.04 unable to locatepackage錯誤解決辦法

#本文主要總結了在使用Ubuntu時遇到的一些問題,解決方案來自於百度貼吧、CSDN部落格等。 由於在做ARM開發板學習,需要使用到Linux作業系統。在安裝時完全出於裝逼的心理,加上筆記本的4G記憶體,就裝了個Ubuntu16.04 64位的系統。結果在學習中遇到了不少問題。包括:dnw軟體安

Hadoop HDFS基本操作(ubuntu16.04 、Hadoop 3.0.3)

hdfs shell的基本操作以及hdfsWeb檢視檔案 在安裝好hadoop叢集併成功的啟動了hdfs之後,我們就可以利用hdfs對檔案進行操作了,一下是對檔案的一些基本操作 特別注意:訪問HDFS目錄時,一定要帶有/  否則命令會出錯! hdfs基本操作 1、查詢命令

ubuntu16.04更改CUDNN 6.0 版本

在 ubuntu16.04 上安裝tensorflow-gpu發現沒有對應版本。檢視之後,我的電腦是cuda 8.0,cudnn 7版本 所以需要更換cudnn版本為6.0,才可以安裝tensorflow-gpu 一、下載linux版的CUDNN 6.0 官網下載:https://dev

ubuntu16.04安裝nvidia (待解決

  ubuntu16.04安裝nvidia 1、首先檢視自己的pc顯示卡的型號     ubuntu16.04 檢視方法:         檢視GPU型號 :lspci | grep -i

Ubuntu16.04安裝OpenCV3.4.0+OpenCV_contrib3.4.0+CUDA9.0完全教程

一、解除安裝已安裝的OpenCV 之前已經安裝了OpenCV3.4.3,但是這個版本好像和CUDA9.0不能相容,導致cuda的模組無法編譯,所以這裡先把它解除安裝掉。 進入opencv的安裝目錄,