1. 程式人生 > >Ubuntu16.04下同時安裝CUDA8.0和CUDA7.0

Ubuntu16.04下同時安裝CUDA8.0和CUDA7.0

首先可以說明一點的是,在ubuntu16.04環境下CUDA8.0和CUDA7.0可以共存。筆者自己先安裝的是CUDA8.0,然後再安裝的CUDA7.0,安裝完CUDA8.0發現安裝CUDA7.0一直不成功,後面發現是16.04系統預設版本的GCC、g++版本過高,因此後面又裝了gcc-4.8,g++-4.8,即安裝了多版本的gcc和g++。

1.安裝cuda-8.0

sudo dpkg -i cuda-repo-ubuntu1404-8-0-local-ga2_8.0.61-1_amd64.deb
sudo apt-get update
sudo apt-get install cuda

2.配置環境變數

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64"
export CUDA_HOME=/usr/local/cuda
export PATH="$CUDA_HOME/bin:$PATH"

3.安裝cuda-8.0對應的cudnn v5.1

tar xvzf cudnn-8.0-linux-x64-v5.1.tgz
mv cuda cudnn-8.0-v5.1
sudo cp cudnn-8.0-v5.1/include/cudnn.h /usr/local/cuda-8.0/include
sudo cp cudnn-8.0-v5.1/lib64/libcudnn*
/usr/local/cuda-8.0/lib64

到此cuda-8.0及其對應的cudnn就安裝結束了。

4.安裝多版本CUDA

我先安裝的是CUDA8.0 後面再安裝CUDA7.0
由於當前系統的GCC G++都是5.4.0 對於安裝Cuda7.0來說版本太高,因此需要安裝低版本的GCC G++ 4.8
原本 /usr/bin目錄下
gcc軟連線到系統預設的GCC-5.4.0
gcc -> gcc-5
g++連結到系統預設的g++-5.4.0
g++ -> g++-5
首先安裝 gcc-4.8 g++-4.8

sudo apt-get install -y gcc-4.8
sudo apt-get install -y g++-4.8
#現在需要把軟連線到GCC-4.8 g++-4.8
sudo rm gcc 
sudo rm g++
sudo ln -s gcc-4.8 gcc
sudo ln -s g++-4.8 g++

接著安裝cuda-7.0和對應的cudnn

./cuda_7.0.28_linux.run
# 給cuda7.0安裝對應的cudnn cudnn-7.0-v4.0
tar xvzf cudnn-7.0-linux-x64-v4.0-prod.tgz 
mv cuda cudnn-7.0-v4.0
sudo cp cudnn-7.0-v4.0/include/cudnn.h   /usr/local/cuda-7.0/include/
sudo cp cudnn-7.0-v4.0/lib64/libcudnn*  /usr/local/cuda-7.0/lib64/

安裝過程中注意事項:
Do you accept the previously read EULA? (accept/decline/quit): accept
You are attempting to install on an unsupported configuration. Do you wish to continue? ((y)es/(n)o) [ default is no ]: y
Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 346.46? ((y)es/(n)o/(q)uit): n
Do you want to install the OpenGL libraries? ((y)es/(n)o/(q)uit) [ default is yes ]: n
Install the CUDA 7.0 Toolkit? ((y)es/(n)o/(q)uit): y
Enter Toolkit Location [ default is /usr/local/cuda-7.0 ]:
/usr/local/cuda-7.0 is not writable.
Do you wish to run the installation with ‘sudo’? ((y)es/(n)o): y
Please enter your password:
Do you want to install a symbolic link at /usr/local/cuda? ((y)es/(n)o/(q)uit): n
Install the CUDA 7.0 Samples? ((y)es/(n)o/(q)uit): y
Enter CUDA Samples Location [ default is /home/wty ]:
Installing the CUDA Toolkit in /usr/local/cuda-7.0 …
Installing the CUDA Samples in /home/wty …
Copying samples to /home/wty/NVIDIA_CUDA-7.0_Samples now…
Finished copying samples.

You should pay attention carefully to the prompts offered you during install.
1. Select no when prompted to install the driver from the CUDA 7.5 runfile installer. Keep your CUDA 8 installed driver. It will work with CUDA 7.5
2. Select no when prompted to update the symlink for /usr/local/cuda (unless you want to switch the default config from CUDA 8 to CUDA 7.5)

When you want to actually switch your machine behavior from CUDA 8 to CUDA 7.0, you will need to modify the PATH and LD_LIBRARY_PATH env variables accordingly.

If you previous CUDA 8 install was via runfile installer, this should work fine. I use this method regularly. If you previous CUDA 8 install was via package manager method, I think this should still work but I don’t typically do that.

it’s probably also possible to do side-by-side install using only package manager methods, but I don’t have a set of instructions handy for that.

相關推薦

Ubuntu16.04同時安裝CUDA8.0CUDA7.0

首先可以說明一點的是,在ubuntu16.04環境下CUDA8.0和CUDA7.0可以共存。筆者自己先安裝的是CUDA8.0,然後再安裝的CUDA7.0,安裝完CUDA8.0發現安裝CUDA7.0一直不成功,後面發現是16.04系統預設版本的GCC、g++版本過

Ubuntu16.04同時安裝Anaconda2與Anaconda3

tps tools strong 安裝 a* 根據 tails environ 自動更新 轉自:http://blog.csdn.net/juezhanangle/article/details/78922888 由於編程時同時需要有python2/3的環境和大量的依賴包,

ubuntu16.04docker安裝簡單使用

purge 條件 service user amd rop pac pub bytes 前提條件 操作系統 docker-ce支持的ubuntu版本: Bionic 18.04 (LTS) Xenial 16.04 (LTS) Trusty 14.04 (LTS) 卸載

Ubuntu16.04 如何安裝解除安裝Google Chrome

參考文章: https://www.aliyun.com/jiaocheng/141917.html https://blog.csdn.net/luohuiwu/article/details/80722075 安裝 1.將下載源新增到系統源中。 sudo wget https

PCL1.8.0Ubuntu16.04安裝及測試

1、安裝PCL之前,需要先安裝以下依賴項: sudo apt-get update sudo apt-get install git build-essential linux-libc-dev sudo apt-get install cmake cmake-gui

ubuntu16.04解除安裝Anaconda,升級python為3.5,安裝pip3,安裝tensorflow==1.0.0

解除安裝Anaconda (一)刪除整個anaconda目錄: 由於Anaconda的安裝檔案都包含在一個目錄中,所以直接將該目錄刪除即可。到包含整個anaconda目錄的資料夾下,刪除整個Anaconda目錄: sudo rm -rf anaconda資料夾名 (二)建議

[環境配置]Ubuntu16.04編譯安裝gcc6.3.0

上一篇的SVS要用gcc6.3編譯,否則結果不正確,本來以為gcc很好裝,結果發現用apt-get安裝gcc6只能安裝6.5版本,程式碼作者奇特的要求只能用gcc6.3,沒辦法只能用原始碼裝了,期間碰見了各種各樣的問題,特此記錄。 1.環境要求 安裝gcc之前要安裝gmp,mpfr,mpc,isl這幾個庫

學習筆記(八)ubuntu16.04同時編譯opencvtensorflow

本文環境:ubuntu16.04+anaconda3+opencv3+tensorflow1.5.0+Sublime Text3+python3.5 注:本文非標準教程,僅是總結個人學習過程,可能存在紕漏,如有錯誤之處歡迎留言告知,非常感謝 anacon

環境配置錄——Ubuntu16.04Anaconda+TensorFlow1.8+CUDA9.1+CuDNN7.0.5+Torch7的安裝

首先,電腦的系統是Ubuntu 16.04硬體是GTX1080Ti,因為要用到GPU加速,所以要裝顯示卡驅動和CUDA。 打算安裝的東西和大概步驟按下面的來: 1. Anaconda(最容易裝,最先說其實是因為貧僧最先下載好了這個軟體的安裝包。。。) 2

ubuntu 14.04 同時安裝OpenCV2.4.8OpenCV3.2,版本共存切換

  由於實驗室需要用到ROS,在安裝ros-indigo的時候,系統預設安裝了 OpenCV2.4.8版本,直接使用還挺好的。但是,科研需要與時俱進啊,新版的OpenCV3.0以上集成了好多新的功能。比如說,近兩年很火的目標跟蹤演算法KCF、Goturn演算法等,都在Ope

Ubuntu16.04 如何安裝搜狗拼音輸入法【親測有效】

tor 有效 設置 添加 tro 如何 Go lin sta 一.添加fcitx鍵盤輸入法系統【系統默認是iBus】 1.將下載源添加至系統源: sudo add-apt-repository ppa:fcitx-team/nightly 2.更新系統列表獲得最新

ubuntu16.04g++安裝及使用

log 安裝 blog vim clas nbsp -- sudo su apt 1)首先在虛擬機中安裝Ubuntu16.04,網絡模式設置為NAT模式,安裝完成後在虛擬機中測試是否能夠上網。 2)進入Ubuntu,按Ctrl+alt+T,調出終端,輸入sudo su,輸

ubuntu16.04hive安裝與配置

cep ted dir mave value usr ubunt java HA 下載 wget http://mirrors.hust.edu.cn/apache/hive/hive-2.3.2/apache-hive-2.3.2-bin.tar.gz 解壓到指定

ubuntu16.04TensorFlow安裝

ubuntu 16.04、Python 2.7 1、安裝pip sudo apt-get install python-pip python-dev 2、安裝TensorFlow sudo pip install --upgrade https://storage.googleapi

ubuntu16.04go安裝

1、安裝go sudo apt-get install golang-go 2、設定go環境變數 export GOROOT=$HOME/go export PATH=$GOROOT/bin:$PATHU 3、新建一個檔案hello.go,在裡面寫入內容 package mai

機器視覺(一) : ubuntu16.04ORBSLAM2安裝除錯

轉載:Ubuntu16.04+Ros+Usb攝像頭跑ORB SLAM2 又好久沒有碰部落格了,估計草都兩米高了,來鋤鋤草. - 2018.7.22 簡單列一下已有配置 Ubuntu 16.04 ROS Kinetic Opencv 3.4.1

Ubuntu16.04 編譯安裝 Tensorflow

安裝bazel sudo ./bazel***.sh 輸入bazel version 檢查是否安裝。 編譯tensorflow 1)./configure 除了選擇支援cuda是y,其餘的都選擇n。 2) bazel build --config=opt //tensorflow:libtensor

ubuntu16.04opencv安裝專欄,問題集錦,包括GPU加速

參考:https://blog.csdn.net/cocoaqin/article/details/78163171 參考:https://blog.csdn.net/cocoaqin/article/details/78376382?utm_source=debugrun&utm_me

平行計算(一)之Ubuntu16.04MPICH安裝

 安裝步驟如下:  1.下載。從mpi官網下載mpich版本,我下載的是mpich-3.2.1。  2.解壓。sudo tar -xzvf mpich-3.2.1.tar.gz,這時可以看到有mpich-3.2.1資料夾,然後cd mpich-3.2.1,進入該

ubuntu16.04CMake安裝方法

檔案下載: sudo wget https://cmake.org/files/v3.9/cmake-3.9.1-Linux-x86_64.tar.gz   解壓: sudo tar zxvf cmake-3.9.1-Linux-x86_64.tar.gz