日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Ubuntu >内容正文

Ubuntu

Ubuntu 16.04卸载CUDA 6.5和安装CUDA 8.0

發布時間:2024/9/21 Ubuntu 71 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Ubuntu 16.04卸载CUDA 6.5和安装CUDA 8.0 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一,引言

由于系統從Ubuntu 14.04升級到了16.04,原來的CUDA 6.5無法繼續使用,所以重新安裝了CUDA 8.0。

二,卸載CUDA 6.5 和驅動

以下操作都在命令行界面操作,比如按下Ctrl+alt+F1進入命令行
首先停止lightdm:
sudo service lightdm stop

卸載NVIDIA驅動

原來安裝CUDA 6.5的時候一起安裝了 NVIDIA驅動,首先卸載掉,命令一般是:

sudo /usr/bin/nvidia-uninstall
  • 1

如果找不到命令,可以在命令行下直接輸入:

sudo apt-get install autoremove --purge nvidia*
  • 1

卸載CUDA toolkit

CUDA默認安裝在 /usr/local/cuda-6.5下,用下面的命令卸載:

sudo /usr/local/cuda-6.5/bin/uninstall_cuda-6.5.pl
  • 1

此時一般需要重啟一下

三, 安裝CUDA 8.0

首先下載CUDA安裝文件,網址:https://developer.nvidia.com/cuda-release-candidate-download
需要注冊NVIDIA的開發者賬號。根據電腦的系統下載對應的安裝文件,這里下載的是CUDA 8.0的runfile(local)文件。安裝方法可以按照官方安裝指南:http://docs.nvidia.com/cuda/cuda-installation-guide-linux/#axzz4HIBXnwyt

依舊進入命令行界面,然后還是

sudo service lightdm stop
  • 1

執行下面語句,運行runfile文件:

sudo sh cuda_8.0.44_linux.run
  • 1

會有一系列的安裝選項,比如是否安裝NVIDIA367驅動等,由于之前卸載了NVIDAI驅動,所以這里選擇了安裝,其他還有比如是否安裝samples以及安裝目錄等。
安裝完成后會出現以下界面:

============ Summary ============Driver: Not SelectedToolkit: Installed in /usr/local/cuda-8.0Samples: Installed in /home/textminerPlease 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 with the name of this run file:sudo .run -silent -driverLogfile is /opt/temp//cuda_install_6583.log

然后設置環境變量和動態鏈接庫,在/etc/profile文件中添加:

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

之后再

source /etc/profile
  • 1

可以使改變立即生效

測試
如果安裝了CDUA samples可以運行一下以測試CUDA是否能成功運行。
進入sample的目錄,CUDA 8.0的默認安裝目錄變成了用戶主目錄,會有一個NVIDA_CUDA-8.0_Samples的目錄,里面有Makefile文件,直接make就行,一般需要編譯一段比較長的時間。之后就可以在當前目錄的bin目錄中隨意運行一些程序,以驗證CUDA是否正確安裝,比如deviceQuery程序的運行結果:

./deviceQuery Starting...CUDA Device Query (Runtime API) version (CUDART static linking)Detected 1 CUDA Capable device(s)Device 0: "GeForce GTX 980 Ti"CUDA Driver Version / Runtime Version 8.0 / 8.0CUDA Capability Major/Minor version number: 5.0Total amount of global memory: 1999 MBytes (2095841280 bytes)( 5) Multiprocessors, (128) CUDA Cores/MP: 640 CUDA CoresGPU Max Clock rate: 1084 MHz (1.08 GHz)Memory Clock rate: 2700 MhzMemory Bus Width: 128-bitL2 Cache Size: 2097152 bytesMaximum Texture Dimension Size (x,y,z) 1D=(65536), 2D=(65536, 65536), 3D=(4096, 4096, 4096)Maximum Layered 1D Texture Size, (num) layers 1D=(16384), 2048 layersMaximum Layered 2D Texture Size, (num) layers 2D=(16384, 16384), 2048 layersTotal amount of constant memory: 65536 bytesTotal amount of shared memory per block: 49152 bytesTotal number of registers available per block: 65536Warp size: 32Maximum number of threads per multiprocessor: 2048Maximum number of threads per block: 1024Max dimension size of a thread block (x,y,z): (1024, 1024, 64)Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535)Maximum memory pitch: 2147483647 bytesTexture alignment: 512 bytesConcurrent copy and kernel execution: Yes with 1 copy engine(s)Run time limit on kernels: YesIntegrated GPU sharing Host Memory: NoSupport host page-locked memory mapping: YesAlignment requirement for Surfaces: YesDevice has ECC support: DisabledDevice supports Unified Addressing (UVA): YesDevice PCI Domain ID / Bus ID / location ID: 0 / 1 / 0Compute Mode:< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 8.0, CUDA Runtime Version = 8.0, NumDevs = 1, Device0 = GeForce GTX 750 Ti Result = PASS
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42

參考

http://www.th7.cn/system/lin/201608/176823.shtml
blog.csdn.net/xulingqiang/article/details/46660107

版權聲明:本文雖然為博主原創文章,但是可以隨意轉載,只需注明出處即可

總結

以上是生活随笔為你收集整理的Ubuntu 16.04卸载CUDA 6.5和安装CUDA 8.0的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。