wordpress手機(jī)類主題東莞seo優(yōu)化案例
1.更換國內(nèi)源
打開終端,輸入指令:
wget http://fishros.com/install -O fishros && . fishros
?選擇【5】更換系統(tǒng)源,后面還有一個(gè)要輸入的選項(xiàng),選擇【0】退出,就會(huì)自動(dòng)換源。
2.安裝NVIDIA驅(qū)動(dòng)
這一步最痛心了家人們,網(wǎng)上的教程太多了,我總是想著離線安裝,每次安裝都無法開機(jī),要不就卡在鎖屏界面,要不就黑屏,要不就卡在snaped界面,重裝系統(tǒng)裝了七八次終于成功了!
1.點(diǎn)擊左下角那9個(gè)點(diǎn),找到軟件更新,點(diǎn)擊。
2.找到附加驅(qū)動(dòng),選擇一個(gè)你需要的nvidia driver版本
注意:安裝的版本號后面是沒有東西的,不要選擇 “-server” 或者 “-open”
然后重啟電腦,輸入nvidia-smi , 就可以看到顯卡驅(qū)動(dòng)安裝成功。?
3.安裝CUDA
下載地址:
CUDA Toolkit Archive | NVIDIA DeveloperPrevious releases of the CUDA Toolkit, GPU Computing SDK, documentation and developer drivers can be found using the links below. Please select the release you want from the list below, and be sure to check www.nvidia.com/drivers for more recent production drivers appropriate for your hardware configuration.https://developer.nvidia.com/cuda-toolkit-archive
?這里我下載的是CUDA11.3.1,下載命令如下:
wget https://developer.download.nvidia.com/compute/cuda/11.3.1/local_installers/cuda_11.3.1_465.19.01_linux.run
安裝CUDA:
sudo bash cuda_11.3.1_465.19.01_linux.run --override
(1)他會(huì)問你已經(jīng)有了一個(gè)nvidia驅(qū)動(dòng),是否繼續(xù),點(diǎn)擊continue.
(2)輸入accept
(3)進(jìn)入CUDA_Installer界面,按上下箭頭,選擇?Driver那一項(xiàng),回車取消勾選(因?yàn)槲覀儎偛乓呀?jīng)安裝driver了,安裝cuda默認(rèn)會(huì)再安裝一遍,這里我們就不需要了)。然后移動(dòng)到 install,回車?yán)^續(xù)安裝。
安裝完成后,會(huì)有一個(gè)summary如下圖,這個(gè)界面不要?jiǎng)?#xff0c;重新打開一個(gè)終端:
?(4)在新終端輸入
sudo gedit ~/.bashrc
在文件最下面加入兩句話,這兩個(gè)路徑就是上面summary里面的,直接復(fù)制過來就可以:
export PATH="/usr/local/cuda-11.3/bin$PATH"
export LD_LIBRARY_PATH="/usr/local/cuda-11.3/lib64:$LD_LIBRARY_PATH"
?(5)執(zhí)行命令 source ~/.bashrc ,然后輸入 nvcc -V ,就可以看到cuda 的版本了。
4.安裝CUDNN
下載地址
https://developer.nvidia.com/rdp/cudnn-archivehttps://developer.nvidia.com/rdp/cudnn-archive
安裝:
?解壓后將相關(guān)文件復(fù)制到usr/local/cuda-11
sudo cp cuda/include/cudnn.h /usr/local/cuda-11.3/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda-11.3/lib64
sudo chmod a+r /usr/local/cuda-11.3/include/cudnn.h
sudo chmod a+r /usr/local/cuda-11.3/lib64/libcudnn*
5.安裝Anaconda
下載:
Free Download | AnacondaAnaconda's open-source Distribution is the easiest way to perform Python/R data science and machine learning on a single machine.https://www.anaconda.com/download#downloads
?安裝:
sudo bash Anaconda_xxx.sh
安裝過程注意事項(xiàng):
?(1)安裝位置不要默認(rèn)的root,因?yàn)闀?huì)有權(quán)限問題,可以選擇安裝在/home目錄下,記住這個(gè)安裝目錄,下面要用。
(2)安裝完成后,會(huì)問你是否要自啟動(dòng)anaconda,直接回車就好(默認(rèn)是no),因?yàn)槲覀円猘naconda和ROS環(huán)境共存
?(3)再次編輯bashrc文件
sudo gedit ~/.bashrc
在最后加入這樣一句話,請?zhí)鎿Q為上面的anaconda3的安裝目錄:
alias setconda='. /home/anaconda3/bin/activate'
然后保存退出,在終端重新source一下:?source ~/.bashrc?
(4) 然后每次想用anaconda的時(shí)候,直接在終端輸入“setconda”,就可以切換到(base)環(huán)境。
?
6.安裝TensorRT
下載:
Log in | NVIDIA Developerhttps://developer.nvidia.com/tensorrt-download
安裝:
?(1) 解壓壓縮包:
tar -zxvf TensorRT-8.2.5.1.Linux.x86_64-gnu.cuda-11.4.cudnn8.2.tar.gz
(2)進(jìn)入虛擬anaconda虛擬環(huán)境,這里我的環(huán)境名稱是py39
setconda
conda activate py39
(3) 安裝依賴
pip install 'pycuda<2021.1'
pip install onnxruntime-gpu==1.11
onnxruntime-gpu和CUDA版本的對應(yīng)關(guān)系為:
NVIDIA - CUDA | onnxruntimeInstructions to execute ONNX Runtime applications with CUDAhttps://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html
(4) 配置環(huán)境
sudo gedit ~/.bashrc# 末尾添加以下兩條路徑,需根據(jù)解壓的實(shí)際路徑
export LD_LIBRARY_PATH=$PATH:/home/hhh/TensorRT-8.2.5.1/lib:$LD_LIBRARY_PATH
export LIBRARY_PATH=$PATH:/home/hhh/TensorRT-8.2.5.1/lib::$LIBRARY_PATH# 重新source一下
source ~/.bashrc
(5)安裝TensorRT
cd TensorRT-8.2.5.1/python
# 按tab補(bǔ)全的時(shí)候到cp3就停了,我的python版本是3.9,所以我輸入cp39再按tab補(bǔ)全
pip install tensorrt-8.2.5.1-cp39-none-linux_x86_64.whl # 安裝依賴
cd TensorRT-8.2.5.1/graphsurgeon
pip install graphsurgeon-0.4.5-py2.py3-none-any.whl
7.安裝ROS
?打開終端,輸入指令:
wget http://fishros.com/install -O fishros && . fishros
?選擇【1】安裝ROS
安裝好后,可以看到ROS和anaconda都可以使用:
8.參考
《conda和ros環(huán)境共存方法》
《【ubuntu環(huán)境配置】超詳細(xì)ubuntu20.04/22.04安裝nvidia驅(qū)動(dòng)/CUDA/cudnn》
《TensorRT學(xué)習(xí)筆記--Ubuntu20.04安裝TensorRT 8.2.5》
《Ubuntu20.04 顯卡驅(qū)動(dòng)、cuda安裝》
《Ubuntu20.04LTS系統(tǒng)CUDA已經(jīng)安裝但nvcc -V顯示command not found》