2017年7月22日 星期六

安裝CUDA-8.0工具包在Debian8.8

Debian 8.8上安裝Nvidia驅動程式後,再來安裝CUDA toolkit。到官方網站上面下載:
  1. Operation System選Linux
  2. Architecture選x86_64
  3. Distribution選Ubuntu(這邊沒有Debian可選,所以選從Debian改出來的Ubuntu)
  4. Version選16.04
  5. Installer Type選runfile (local)
測試過用deb套件安裝,但無法成功故在此採改成用runfile安裝。下載後會有兩個檔案:
  • Base Installer:cuda_8.0.61_375.26_linux.run
  • cuBLAS Patch 2:cuda_8.0.61.2_linux.run
上面是需要的檔案,以下是安裝步驟,請用root權限做


步驟1:安裝一些需要的東西

  • apt-get install libxi libxi6 libxi-dev libglu1-mesa libglu1-mesa-dev libxmu6 libxmu6-dev

步驟2:用Base Installer安裝CUDA-8.0.61

  • sh cuda_8.0.61_375.26_linux.run
      處理一堆選擇題,紅字是問題的答案
  1. Do you accept the previously read EULA?
    accept/decline/quit: accept
  2. You are attempting to install on an unsupported configuration. Do you wish to continue?
    (y)es/(n)o [ default is no ]: y
  3. Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 375.26?
    (y)es/(n)o/(q)uit: n
  4. Install the CUDA 8.0 Toolkit?
    (y)es/(n)o/(q)uit: y
  5. Enter Toolkit Location
    default is /usr/local/cuda-8.0 :/usr/local/cuda-8.0.61_375.26
  6. Do you want to install a symbolic link at /usr/local/cuda?
    (y)es/(n)o/(q)uit: n
  7. Install the CUDA 8.0 Samples?
    (y)es/(n)o/(q)uit: y
  8. Enter CUDA Samples Location
    /usr/local/cuda-8.0.61_375.26
做完以後,去檢查下面兩的地方有沒有順利安裝:
  • CUDA Toolkit:/usr/local/cuda-8.0.61_375.26
  • CUDA samples:/usr/local/cuda-8.0.61_375.26/NVIDIA_CUDA-8.0_Samples

步驟3:安裝cuBLAS  Patch

  • sh cuda_8.0.61.2_linux.run
      只要回答兩個問題,紅字是問題的答案
  1. Do you accept the previously read EULA?
    accept/decline/quit: accept
  2. Enter CUDA Toolkit installation directory
    /usr/local/cuda-8.0.61_375.26

步驟4:新增檔案/etc/profile.d/cuda.sh

目的是要之後都找得到CUDA的執行檔與ld library,內容會是
export PATH=/usr/local/cuda-8.0.61_375.26/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-8.0.61_375.26/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

步驟5:檢查是否安裝成功,用內附的samples來測試

首先登出後再度登入,然後執行下面指令安裝samples
  1. cd /usr/local/cuda-8.0.61_375.26/NVIDIA_CUDA-8.0_Samples
  2. make -j 16 2>&1 | tee make.log
  3. cd /usr/local/cuda-8.0.61_375.26/NVIDIA_CUDA-8.0_Samples/bin/x86_64/linux/release
  4. ./deviceQuery
如果有顯示安裝的顯示卡的資訊就代表是順利安裝~
參考資料裡面有許多安裝CUDA-8.0到不同系統的教學

參考文件

_EOF_

沒有留言:

張貼留言