NVIDIA cuda7在centos6.5中的安装
生活随笔
收集整理的這篇文章主要介紹了
NVIDIA cuda7在centos6.5中的安装
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
關(guān)閉
[root@localhost ~]# systemctl disable firewalld.service?
rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'
rm '/etc/systemd/system/basic.target.wants/firewalld.service'
[root@localhost ~]# vi /etc/selinux/config?
[root@localhost ~]# cat /etc/selinux/config?
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# ? ? enforcing - SELinux security policy is enforced.
# ? ? permissive - SELinux prints warnings instead of enforcing.
# ? ? disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
# ? ? targeted - Targeted processes are protected,
# ? ? minimum - Modification of targeted policy. Only selected processes are protected.?
# ? ? mls - Multi Level Security protection.
SELINUXTYPE=targeted?
重新啟動繼續(xù)配置
=============================================================================================
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# mkdir -p ./bak
[root@localhost yum.repos.d]# mv *.repo ./bak/
[root@localhost yum.repos.d]# vi local.repo
[root@localhost yum.repos.d]# cat local.repo
[local_server]
name=This is a local repo
baseurl=file:///mnt/iso
enabled=1
gpgcheck=0
[root@localhost yum.repos.d]# yum clean all
[root@localhost yum.repos.d]# mkdir -p /mnt/iso
[root@localhost yum.repos.d]# mount -o loop /cudainstall/CentOS\ 7\ x86_64.iso /mnt/iso/
[root@localhost yum.repos.d]# vi /etc/rc.local?
[root@localhost yum.repos.d]# chmod +x /etc/rc.d/rc.local
[root@localhost yum.repos.d]# cat /etc/rc.lcoa
cat: /etc/rc.lcoa: Aucun fichier ou dossier de ce type
[root@localhost yum.repos.d]# cat /etc/rc.local?
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.
mount -o loop /cudainstall/CentOS\ 7\ x86_64.iso /mnt/iso/
touch /var/lock/subsys/local
[root@localhost yum.repos.d]# hostnamectl set-hostname cuda02
[root@cuda02 ~]# yum install kernel-devel gcc gcc-c++ yum install libX*
檢查nouveau
[root@cuda01 ~]# lsmod |grep nouveau
如果有輸出 使用modprobe -r nouveau
[root@cuda01 ~]#init 3
==================================================================================================
安裝cuda時一定不要安裝OpenGL;切記,否則有可能安裝完之后,圖形化桌面啟動不了,過程中會出現(xiàn)如下錯誤信息
[root@cuda02 cudainstall]# chmod +x cuda_7.0.28_linux.run
[root@cuda02 cudainstall]# ./cuda_7.0.28_linux.run
Do you accept the previously read EULA? (accept/decline/quit): accept ? ? ?
Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 346.46? ((y)es/(n)o/(q)uit): y
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 ]:?
Do you want to install a symbolic link at /usr/local/cuda? ((y)es/(n)o/(q)uit): y
Install the CUDA 7.0 Samples? ((y)es/(n)o/(q)uit): y
Enter CUDA Samples Location [ default is /root ]:?
Installing the NVIDIA display driver...
Installing the CUDA Toolkit in /usr/local/cuda-7.0 ...
Missing recommended library: libGLU.so
Installing the CUDA Samples in /root ...
Copying samples to /root/NVIDIA_CUDA-7.0_Samples now...
Finished copying samples.
===========
= Summary =
===========
Driver: ? Installed
Toolkit: ?Installed in /usr/local/cuda-7.0
Samples: ?Installed in /root, but missing recommended libraries
Please make sure that
?- ? PATH includes /usr/local/cuda-7.0/bin
?- ? LD_LIBRARY_PATH includes /usr/local/cuda-7.0/lib64, or, add /usr/local/cuda-7.0/lib64 to /etc/ld.so.conf and run ldconfig as root
To uninstall the CUDA Toolkit, run the uninstall script in /usr/local/cuda-7.0/bin
To uninstall the NVIDIA Driver, run nvidia-uninstall
Please see CUDA_Getting_Started_Guide_For_Linux.pdf in /usr/local/cuda-7.0/doc/pdf for detailed information on setting up CUDA.
Logfile is /tmp/cuda_install_2994.log
安裝cuda驅(qū)動
[root@cuda02 cudainstall]# chmod +x cuda_7.0.28_linux.run
[root@cuda02 cudainstall]# ./cuda_7.0.28_linux.run
Do you accept the previously read EULA? (accept/decline/quit): accept ? ? ?
Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 346.46? ((y)es/(n)o/(q)uit): y
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 ]:?
Do you want to install a symbolic link at /usr/local/cuda? ((y)es/(n)o/(q)uit): y
Install the CUDA 7.0 Samples? ((y)es/(n)o/(q)uit): y
Enter CUDA Samples Location [ default is /root ]:?
Installing the NVIDIA display driver...
Installing the CUDA Toolkit in /usr/local/cuda-7.0 ...
Missing recommended library: libGLU.so
Installing the CUDA Samples in /root ...
Copying samples to /root/NVIDIA_CUDA-7.0_Samples now...
Finished copying samples.
===========
= Summary =
===========
Driver: ? Installed
Toolkit: ?Installed in /usr/local/cuda-7.0
Samples: ?Installed in /root, but missing recommended libraries
Please make sure that
?- ? PATH includes /usr/local/cuda-7.0/bin
?- ? LD_LIBRARY_PATH includes /usr/local/cuda-7.0/lib64, or, add /usr/local/cuda-7.0/lib64 to /etc/ld.so.conf and run ldconfig as root
To uninstall the CUDA Toolkit, run the uninstall script in /usr/local/cuda-7.0/bin
To uninstall the NVIDIA Driver, run nvidia-uninstall
Please see CUDA_Getting_Started_Guide_For_Linux.pdf in /usr/local/cuda-7.0/doc/pdf for detailed information on setting up CUDA.
Logfile is /tmp/cuda_install_2994.log
廣播cuda的路徑
[root@cuda02 cudainstall]# vi /etc/profile.d/cuda.sh
[root@cuda02 cudainstall]# cat /etc/profile.d/cuda.sh?
export PATH=/usr/local/cuda-7.0/bin:$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-7.0/lib64
[root@cuda02 cudainstall]# chmod 755 /etc/profile.d/cuda.sh?
[root@cuda02 cudainstall]# source /etc/profile.d/cuda.sh
[root@cuda02 cudainstall]#?
=================================================================================================================
恢復(fù)圖形界面顯示
[root@cuda02 cudainstall]# init 5
=================================================================================================================
安裝vnc
[root@cuda02 cudainstall]# yum -y install tigervnc-server
NVIDIA cuda7在centos6.5中的安裝
標簽: NVIDIAcuda7centos6-5安裝 2015-08-03 15:14 123人閱讀 評論(0)收藏 舉報 分類: CentOS(2)版權(quán)聲明:本文為博主原創(chuàng)文章,未經(jīng)博主允許不得轉(zhuǎn)載。
目錄(?)[+]
基本環(huán)境
- cuda_7.0.28_linux.run
- CentOS 6.5
安裝過程
- 禁用Nouveau,這個驅(qū)動和Nvidia的驅(qū)動有沖突,需要先禁用掉,不然會不讓安裝,具體可參考NVIDIA CUDA GETTING STARTED GUIDE FOR LINUX
- 創(chuàng)建文件,/etc/modprobe.d/blacklist-nouveau.conf,其內(nèi)容如下:
blacklist nouveau
options nouveau modeset=0 - 重新生成kernel initramfs,即Regenerate the kernel initramfs,執(zhí)行如下命令
sudo dracut –force
注意:force前面是2個- - 設(shè)置系統(tǒng)啟動為Text Mode,即修改文件:/etc/inittab,將id:5改為id:3,讓系統(tǒng)不從界面化啟動,安裝完成后,再修改過來。注意,不要從界面啟動,然后通過按ctrl+alt+f3進入Text界面來進行安裝,這個好像會出問題,會不讓安裝。
- 重啟系統(tǒng)
- 直接運行cuda_7.0.28_linux.run,該文件需要有可執(zhí)行權(quán)限
- 如果安裝時,提示X server is running,不讓進行安裝,則執(zhí)行如下操作:
- 查詢下和X相關(guān)的服務(wù),pstree -p | grep X
- 如果查詢知道有服務(wù)在運行,就kill掉,比如:
|-Xvnc(2259)
|-Xvnc(2299)
這時候,就依次執(zhí)行
sudo kill -9 2259
sudo kill -9 2299
將相關(guān)服務(wù)給殺掉,這時候應(yīng)該就可以安裝了 - 運行安裝文件后,根據(jù)提示進行默認安裝即可。安裝完成后需要配置PATH和LD_LIBRARY_PATH。
- 將id:3修改回為id:5,重啟系統(tǒng)。
- 如果重啟后停留在進度條界面,正常進不了界面化的登錄界面,則按ctrl+alt+f3進入Text界面,登錄進入系統(tǒng)。然后查看/etc/X11/xorg.conf文件是否存在。一般是因為這個文件不存在導(dǎo)致的。這時候執(zhí)行如下命令:
nvidia-xconfig
該命令會生成相應(yīng)的xorg.conf文件
其他命令
- 在系統(tǒng)啟動時,即進度條狀態(tài)時,按下Esc鍵,會轉(zhuǎn)換到類似CMD命令似的界面,會顯示相關(guān)的啟動日志,可以查看相關(guān)東西。
- 也可以通過查看/var/log/文件夾下的Xorg.*類文件來查看啟動日志,比如
ls /var/log/Xorg.*
會顯示相關(guān)的文件:
/var/log/Xorg.0.log
/var/log/Xorg.1.log
/var/log/Xorg.2.log
一般Xorg.0.log是最新的日志文件,可以通過時間知道。
重要參考
endly nvidia-xconfig
NVIDIA CUDA GETTING STARTED GUIDE FOR LINUX
之前都是在Centos6下進行CUDA開發(fā),安裝和配置CUDA環(huán)境請參考另外一篇博客(Linux(redhat)CUDA安裝)。因為Centos7有較大變動,所以安裝CUDA過程中遇到了一些麻煩,原因初步歸結(jié)于OpenGL的安裝。下面詳細介紹安裝配置過程
關(guān)閉防火墻和selinux和補充包和建立本地yum源
[root@localhost ~]# systemctl stop firewalld.service?[root@localhost ~]# systemctl disable firewalld.service?
rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'
rm '/etc/systemd/system/basic.target.wants/firewalld.service'
[root@localhost ~]# vi /etc/selinux/config?
[root@localhost ~]# cat /etc/selinux/config?
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# ? ? enforcing - SELinux security policy is enforced.
# ? ? permissive - SELinux prints warnings instead of enforcing.
# ? ? disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
# ? ? targeted - Targeted processes are protected,
# ? ? minimum - Modification of targeted policy. Only selected processes are protected.?
# ? ? mls - Multi Level Security protection.
SELINUXTYPE=targeted?
重新啟動繼續(xù)配置
=============================================================================================
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# mkdir -p ./bak
[root@localhost yum.repos.d]# mv *.repo ./bak/
[root@localhost yum.repos.d]# vi local.repo
[root@localhost yum.repos.d]# cat local.repo
[local_server]
name=This is a local repo
baseurl=file:///mnt/iso
enabled=1
gpgcheck=0
[root@localhost yum.repos.d]# yum clean all
[root@localhost yum.repos.d]# mkdir -p /mnt/iso
[root@localhost yum.repos.d]# mount -o loop /cudainstall/CentOS\ 7\ x86_64.iso /mnt/iso/
[root@localhost yum.repos.d]# vi /etc/rc.local?
[root@localhost yum.repos.d]# chmod +x /etc/rc.d/rc.local
[root@localhost yum.repos.d]# cat /etc/rc.lcoa
cat: /etc/rc.lcoa: Aucun fichier ou dossier de ce type
[root@localhost yum.repos.d]# cat /etc/rc.local?
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.
mount -o loop /cudainstall/CentOS\ 7\ x86_64.iso /mnt/iso/
touch /var/lock/subsys/local
[root@localhost yum.repos.d]# hostnamectl set-hostname cuda02
[root@cuda02 ~]# yum install kernel-devel gcc gcc-c++ yum install libX*
檢查nouveau
[root@cuda01 ~]# lsmod |grep nouveau
如果有輸出 使用modprobe -r nouveau
[root@cuda01 ~]#init 3
==================================================================================================
安裝cuda時一定不要安裝OpenGL;切記,否則有可能安裝完之后,圖形化桌面啟動不了,過程中會出現(xiàn)如下錯誤信息
[root@cuda02 cudainstall]# chmod +x cuda_7.0.28_linux.run
[root@cuda02 cudainstall]# ./cuda_7.0.28_linux.run
Do you accept the previously read EULA? (accept/decline/quit): accept ? ? ?
Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 346.46? ((y)es/(n)o/(q)uit): y
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 ]:?
Do you want to install a symbolic link at /usr/local/cuda? ((y)es/(n)o/(q)uit): y
Install the CUDA 7.0 Samples? ((y)es/(n)o/(q)uit): y
Enter CUDA Samples Location [ default is /root ]:?
Installing the NVIDIA display driver...
Installing the CUDA Toolkit in /usr/local/cuda-7.0 ...
Missing recommended library: libGLU.so
Installing the CUDA Samples in /root ...
Copying samples to /root/NVIDIA_CUDA-7.0_Samples now...
Finished copying samples.
===========
= Summary =
===========
Driver: ? Installed
Toolkit: ?Installed in /usr/local/cuda-7.0
Samples: ?Installed in /root, but missing recommended libraries
Please make sure that
?- ? PATH includes /usr/local/cuda-7.0/bin
?- ? LD_LIBRARY_PATH includes /usr/local/cuda-7.0/lib64, or, add /usr/local/cuda-7.0/lib64 to /etc/ld.so.conf and run ldconfig as root
To uninstall the CUDA Toolkit, run the uninstall script in /usr/local/cuda-7.0/bin
To uninstall the NVIDIA Driver, run nvidia-uninstall
Please see CUDA_Getting_Started_Guide_For_Linux.pdf in /usr/local/cuda-7.0/doc/pdf for detailed information on setting up CUDA.
Logfile is /tmp/cuda_install_2994.log
安裝cuda驅(qū)動
[root@cuda02 cudainstall]# chmod +x cuda_7.0.28_linux.run
[root@cuda02 cudainstall]# ./cuda_7.0.28_linux.run
Do you accept the previously read EULA? (accept/decline/quit): accept ? ? ?
Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 346.46? ((y)es/(n)o/(q)uit): y
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 ]:?
Do you want to install a symbolic link at /usr/local/cuda? ((y)es/(n)o/(q)uit): y
Install the CUDA 7.0 Samples? ((y)es/(n)o/(q)uit): y
Enter CUDA Samples Location [ default is /root ]:?
Installing the NVIDIA display driver...
Installing the CUDA Toolkit in /usr/local/cuda-7.0 ...
Missing recommended library: libGLU.so
Installing the CUDA Samples in /root ...
Copying samples to /root/NVIDIA_CUDA-7.0_Samples now...
Finished copying samples.
===========
= Summary =
===========
Driver: ? Installed
Toolkit: ?Installed in /usr/local/cuda-7.0
Samples: ?Installed in /root, but missing recommended libraries
Please make sure that
?- ? PATH includes /usr/local/cuda-7.0/bin
?- ? LD_LIBRARY_PATH includes /usr/local/cuda-7.0/lib64, or, add /usr/local/cuda-7.0/lib64 to /etc/ld.so.conf and run ldconfig as root
To uninstall the CUDA Toolkit, run the uninstall script in /usr/local/cuda-7.0/bin
To uninstall the NVIDIA Driver, run nvidia-uninstall
Please see CUDA_Getting_Started_Guide_For_Linux.pdf in /usr/local/cuda-7.0/doc/pdf for detailed information on setting up CUDA.
Logfile is /tmp/cuda_install_2994.log
廣播cuda的路徑
[root@cuda02 cudainstall]# vi /etc/profile.d/cuda.sh
[root@cuda02 cudainstall]# cat /etc/profile.d/cuda.sh?
export PATH=/usr/local/cuda-7.0/bin:$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-7.0/lib64
[root@cuda02 cudainstall]# chmod 755 /etc/profile.d/cuda.sh?
[root@cuda02 cudainstall]# source /etc/profile.d/cuda.sh
[root@cuda02 cudainstall]#?
=================================================================================================================
恢復(fù)圖形界面顯示
[root@cuda02 cudainstall]# init 5
=================================================================================================================
安裝vnc
[root@cuda02 cudainstall]# yum -y install tigervnc-server
總結(jié)
以上是生活随笔為你收集整理的NVIDIA cuda7在centos6.5中的安装的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: CentOS启用sudo方法
- 下一篇: 详解Python的内置函数eval()