Ubuntu 16.04 CUDA 6.5のアンインストールとCUDA 8.0のインストール

8978 ワード

一、引用


システムがUbuntu 14.04から16.04にアップグレードされたため、元のCUDA 6.5は引き続き使用できないため、CUDA 8.0を再インストールしました.

二、CUDA 6.5と駆動をアンインストールする


次の操作は、Ctrl+alt+F 1を押してコマンドラインに入るなど、コマンドラインインタフェースで行います.まずlightdm:sudo service lightdm stopを停止します.
NVIDIAドライバのアンインストール
元CUDA 6.5をインストールする時一緒にNVIDIA駆動をインストールして、まずアンインストールして、命令は普通です:
sudo /usr/bin/nvidia-uninstall

コマンドが見つからない場合は、コマンドラインの下に直接入力します.
sudo apt-get install autoremove --purge nvidia*

CUDA toolkitのアンインストール
CUDAのデフォルトは/usr/local/cuda-6.5でインストールされ、次のコマンドでアンインストールされます.
sudo /usr/local/cuda-6.5/bin/uninstall_cuda-6.5.pl

この場合は通常再起動が必要です

三、CUDA 8.0を取り付ける


まずCUDAインストールファイルをダウンロードします.https://developer.nvidia.com/cuda-release-candidate-downloadNVIDIAの開発者アカウントを登録する必要があります.パソコンのシステムによって対応するインストールファイルをダウンロードします.ここでダウンロードしたのはCUDA 8.0のrunfile(local)ファイルです.インストール方法は、公式インストールガイドに従います.http://docs.nvidia.com/cuda/cuda-installation-guide-linux/#axzz4HIBXnwyt
コマンドラインインタフェースにアクセスしても、
sudo service lightdm stop

次の文を実行してrunfileファイルを実行します.
sudo sh cuda_8.0.44_linux.run

NVIDIA 367ドライバをインストールするかどうかなど、一連のインストールオプションがあります.これまで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

あとで
source /etc/profile

変更をすぐに有効にすることができます
テストCDUA samplesがインストールされている場合は、CUDAが正常に動作するかどうかをテストするために実行できます.Sampleのディレクトリに入ると、CUDA 8.0のデフォルトインストールディレクトリがユーザーホームディレクトリになり、NVIDA_が1つあります.CUDA-8.0_Samplesのディレクトリは、Makefileファイルが入っていて、直接makeでいいので、一般的には長い時間コンパイルする必要があります.その後、現在のディレクトリのbinディレクトリで任意にいくつかのプログラムを実行して、deviceQueryプログラムの実行結果などのCUDAが正しくインストールされているかどうかを確認できます.
./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.0
  CUDA Capability Major/Minor version number:    5.0
  Total amount of global memory:                 1999 MBytes (2095841280 bytes)
  ( 5) Multiprocessors, (128) CUDA Cores/MP:     640 CUDA Cores
  GPU Max Clock rate:                            1084 MHz (1.08 GHz)
  Memory Clock rate:                             2700 Mhz
  Memory Bus Width:                              128-bit
  L2 Cache Size:                                 2097152 bytes
  Maximum 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 layers
  Maximum Layered 2D Texture Size, (num) layers  2D=(16384, 16384), 2048 layers
  Total amount of constant memory:               65536 bytes
  Total amount of shared memory per block:       49152 bytes
  Total number of registers available per block: 65536
  Warp size:                                     32
  Maximum number of threads per multiprocessor:  2048
  Maximum number of threads per block:           1024
  Max 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 bytes
  Texture alignment:                             512 bytes
  Concurrent copy and kernel execution:          Yes with 1 copy engine(s)
  Run time limit on kernels:                     Yes
  Integrated GPU sharing Host Memory:            No
  Support host page-locked memory mapping:       Yes
  Alignment requirement for Surfaces:            Yes
  Device has ECC support:                        Disabled
  Device supports Unified Addressing (UVA):      Yes
  Device PCI Domain ID / Bus ID / location ID:   0 / 1 / 0
  Compute 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

リファレンス
http://www.th7.cn/system/lin/201608/176823.shtml blog.csdn.net/xulingqiang/article/details/46660107