关闭

NVIDIA cuda7在centos6.5中的安装

标签: NVIDIAcuda7centos6-5安装
2015-08-03 15:14 123人阅读 评论(0)收藏 举报

分类:
CentOS(2)

版权声明:本文为博主原创文章,未经博主允许不得转载。

目录(?)[+]

基本环境

  • cuda_7.0.28_linux.run
  • CentOS 6.5

安装过程

  • 禁用Nouveau,这个驱动和Nvidia的驱动有冲突,需要先禁用掉,不然会不让安装,具体可参考NVIDIA CUDA GETTING STARTED GUIDE FOR LINUX

    1. 创建文件,/etc/modprobe.d/blacklist-nouveau.conf,其内容如下:
      blacklist nouveau
      options nouveau modeset=0
    2. 重新生成kernel initramfs,即Regenerate the kernel initramfs,执行如下命令
      sudo dracut –force
      注意:force前面是2个-
  • 设置系统启动为Text Mode,即修改文件:/etc/inittab,将id:5改为id:3,让系统不从界面化启动,安装完成后,再修改过来。注意,不要从界面启动,然后通过按ctrl+alt+f3进入Text界面来进行安装,这个好像会出问题,会不让安装。
  • 重启系统
  • 直接运行cuda_7.0.28_linux.run,该文件需要有可执行权限
  • 如果安装时,提示X server is running,不让进行安装,则执行如下操作:
    1. 查询下和X相关的服务,pstree -p | grep X
    2. 如果查询知道有服务在运行,就kill掉,比如:
      |-Xvnc(2259)
      |-Xvnc(2299)
      这时候,就依次执行
      sudo kill -9 2259
      sudo kill -9 2299
      将相关服务给杀掉,这时候应该就可以安装了
  • 运行安装文件后,根据提示进行默认安装即可。安装完成后需要配置PATH和LD_LIBRARY_PATH。
  • 将id:3修改回为id:5,重启系统。
  • 如果重启后停留在进度条界面,正常进不了界面化的登录界面,则按ctrl+alt+f3进入Text界面,登录进入系统。然后查看/etc/X11/xorg.conf文件是否存在。一般是因为这个文件不存在导致的。这时候执行如下命令:
    nvidia-xconfig
    该命令会生成相应的xorg.conf文件

其他命令

  • 在系统启动时,即进度条状态时,按下Esc键,会转换到类似CMD命令似的界面,会显示相关的启动日志,可以查看相关东西。
  • 也可以通过查看/var/log/文件夹下的Xorg.*类文件来查看启动日志,比如
    ls /var/log/Xorg.*
    会显示相关的文件:
    /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开发,安装和配置CUDA环境请参考另外一篇博客(Linux(redhat)CUDA安装)。因为Centos7有较大变动,所以安装CUDA过程中遇到了一些麻烦,原因初步归结于OpenGL的安装。下面详细介绍安装配置过程

关闭防火墙和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 
重新启动继续配置
=============================================================================================
[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;切记,否则有可能安装完之后,图形化桌面启动不了,过程中会出现如下错误信息
[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]# 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]# 
=================================================================================================================
恢复图形界面显示
[root@cuda02 cudainstall]# init 5
=================================================================================================================
安装vnc
[root@cuda02 cudainstall]# yum -y install tigervnc-server

NVIDIA cuda7在centos6.5中的安装相关推荐

  1. Apache源码包在LINUX(CENTOS6.8)中的安装(出现问题及解决)

    任务:在CENT6.8系统中安装Apache(版本为:httpd-2.4.41) 前提:由于源码包必须先编译后安装,所以必须先安装编译器:gcc 理论步骤: 1.检测gcc软件包,如果不存在则进行安装 ...

  2. centos编译apache php mysql,在CentOS6.7中编译安装 apache php mysql

    安装 开发工具 yum groupinstall "Development Tools" ------------------------------ tar -jxvf apr- ...

  3. centOS6.5中静默安装oracle 11gR2

    近日公司租用虚机,需要在虚机上安装oracle11gR2,由于先前从未使用过linux系统,在网上查了一些方法进行安装最后都安装失败,最后经多次试验才发现安装不成功的多数问题都是集中在包或者是权限上, ...

  4. centos6.x中yum安装nginx

    今天装了CentOS6.7,直接yum install nginx不行,错误如下: [root@localhost ~]# yum install nginx 已加载插件:fastestmirror ...

  5. 系统中编译安装ZLMediaKit的步骤

    这篇文章给大家分享的是centos6系统中编译安装ZLMediaKit的步骤.小编觉得挺实用的,因此分享给大家学习.如下资料是编译安装的步骤.  1.安装基础编译环境 1.1 gcc-5.4的安装  ...

  6. Linux(CentOS6.5)中安装maven

    Linux(CentOS6.5)中安装maven 1.上传相关包(*.tar.gz等) 使用相关软件上传或用Xshell连接后下载命令:yum install lrzsz 2.安装maven 1> ...

  7. centos6.5 php5.2,Linux中PHP安装与配置(CentOS-6.5:php-5.2.13)

    1 PHP简介     PHP(PHP: Hypertext Preprocessor的缩写,中文名:"超文本预处理器")是一种通用开源脚本语言.语法吸收了C语言.Java和Per ...

  8. CentOs6.5中安装和配置vsftp简明教程

    这篇文章主要介绍了CentOs6.5中安装和配置vsftp简明教程,需要的朋友可以参考下 一.vsftp安装篇 复制代码代码如下: # 安装vsftpd yum -y install vsftpd # ...

  9. centos6 安装 mantisbt-1.2.8 —— (4)在CentOS6.4中安装配置LAMP环境

    一.修改设置对安装做准备 1 1. 防火墙设置 2 2. 关闭SELINUX 3 二.开始安装软件 4 1. MySql的安装和配置 4 2. Apache服务的安装和配置 8 3.安装PHP 10 ...

最新文章

  1. Js打印表格时部分边框不显示(table 标签)
  2. R语言ggplot2可视化在ggplot2生成的可视化结果下方显示文本:显示一些关于数据的信息
  3. 虚拟电脑键盘app_说到弹吉他,这几个APP你一定用得上
  4. GCT之数学公式(代数部分)
  5. ACM模板--邻接矩阵 无向图
  6. 0xc000000f 由于系统注册表文件丢失或损坏,因此Windows无法加载
  7. Java的新项目学成在线笔记-day10(三)
  8. 软件定义闪存:加速闪存规模化应用
  9. CodeForces - 1400D Zigzags(简单dp)
  10. 佳能g3800故障灯说明书_佳能打印机故障如何维修 佳能打印机故障维修方法【介绍】...
  11. 搜索引擎排名点击跳转问题解决办法
  12. scrapy setting
  13. for 循环中实现多个点击事件
  14. SQL SERVER数据库三种数据插入方式
  15. PHP连接MySQL 8.0报错的解决办法
  16. 黑产和灰产的区别在于那里
  17. 互联网巨头介入P2P网贷的潜在风险
  18. 竞品分析(淘宝、京东)
  19. C语言练习题 :猴子吃桃程序
  20. java 杨辉三角(贾宪三角,帕斯卡三角)

热门文章

  1. 身体里面有多少细胞呢?
  2. 斯坦福cs161算法考试的cheat sheet!!!十分重要!!!
  3. 嵌入式_makefile简单语法介绍
  4. Spark-1.4.0集群搭建
  5. jQuery实战读书笔记(第五章)
  6. find server/ -type d|xargs -I {} echo mkdir /root/{}
  7. XML学习第三节 Schema介绍
  8. hdu 2586(LCA + 节点间距离)
  9. 数据结构(严蔚敏)之二——链表的c语言实现
  10. NYOJ 709 异形卵