Nvidia CUDA 6 Installed In Ubuntu 12.04
環境:ubuntu 12.04 (x64)
如果不能夠 service lightdm stop,顯示:unknown service 或者其他的
sudo /etc/init.d/lightdm restart
cuda 6.0
1)Verify You Have a CUDA-Capable GPU
To verify that your GPU is CUDA-capable, go to your distribution’s equivalent of SystemProperties, or, from the command line, enter:
|
1
|
lspci | grep -i nvidia |
2) Verify the System Has gcc Installed
|
1
|
gcc --version |
一般系統安裝完畢后便自帶C編譯環境和Python編譯環境
3)安裝必要的庫
If you wish to build allof the samples, including those with graphical rather than
command-line interfaces, you may need to install additional system libraries or
headers if you have not done so before.
|
1
2
|
sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-devlibxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev |
注:安裝libgl1-mesa-* library時可能會提示你缺少依賴包,請謹記安裝提示信息中Recommended依賴包,否則,呵呵呵…
4)卸載(禁止)存在的NVIDIA(nouveau)驅動
一般Ubuntu系統安裝完畢后,會彈出Additional
Driver警示框,提醒安裝驅動,為了避免兼容性問題,如果已經安裝的請卸載PS:The CUDA 5.5 installers include
the CUDA Toolkit, SDK code samples, Nsight Visual Studio edition (for
Windows) and Nsight Eclipse Edition (for Linux / Mac OS X), and
developer drivers.
|
1
|
sudo nvidia-uninstall |
如果卸載失敗,或者卸載完成后,建議這樣做一下
|
1
|
|
禁止開源驅動nouveau的開機加載
|
1
|
sudo gedit /etc/modprobe.d/blacklist.conf |
在文件后添加如下內容保存后重啟
|
1
2
|
blacklist nouveauoptions nouveau modeset=0 |
5)Installation
Exit the GUI if you are in a GUI environment by pressing Ctrl-Alt-F1
and login as root, then type into the commond below and press Enter
|
1
|
service lightdm stop |
Install the CUDA Toolkit (xx in 5.5.xx is the minor version of the
installation package)by running the downloaded .runfile as a superuser.
|
1
|
sudo sh cuda_5.5.xx_linux_32_rhel5.x.run |
這個初始化時間有點長,耐心等待…
安裝完成后切換回GUI界面
|
1
|
service lightdm start |
6)Define the environment variables
我習慣用如下方式進行環境變量的添加修改:
首先
|
1
|
gedit ~/.bashrc |
添加如下內容
|
1
2
|
export PATH=/usr/local/cuda-6.0/bin:$PATHexport LD_LIBRARY_PATH=/usr/local/cuda-6.0/lib64:$LD_LIBRARY_PATH |
然后
|
1
|
gedit /etc/ld.so.conf |
添加如下內容
|
1
|
/usr/local/cuda-6.0/lib64 |
完成之后執行如下命令
|
1
|
sudo ldconfig |
驗證是否添加路徑成功
|
1
|
ldconfig -v|grep cuda |
以上內容其實在你安裝完畢CUDA Toolkit之后的信息中都有所提示!文章最后會給出安裝完畢后的截圖!
7)關于Bug:
執行 nvidia.settings 出現錯誤提示框 no driver detected 以及 nvidia driver is activated but not currently in use
不知道怎么解決,郁悶中…反正console project都能運行,只是進入Ubuntu系統時因為驅動未安裝好的緣故會花屏而已,另外建議運行一下Samples中的1_Utilities中的deviceQuery程序作為測試!
總結
以上是生活随笔為你收集整理的Nvidia CUDA 6 Installed In Ubuntu 12.04的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 上下结构开火念什么(开火念什么)
- 下一篇: 初中不等式的性质三条(不等式的性质三条)