之前都是在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

转载于:https://www.cnblogs.com/ljbguanli/p/7143343.html

Centos7.1安装CUDA7.0相关推荐

  1. 详解centos7虚拟机安装elasticsearch5.0.x-安装篇(自己做测试了,es启动有错误可以在这上面找)

    本篇文章主要介绍了centos7虚拟机安装elasticsearch5.0.x-安装篇,具有一定的参考价值,感兴趣的小伙伴们可以参考一下. centos7虚拟机安装elasticsearch5.0.x ...

  2. Centos7 Yum安装MYSQL8.0详细安装步骤

    Centos7 Yum安装MYSQL8.0详细安装步骤 0.更换yum源 1.打开 mirrors.aliyun.com,选择centos的系统,点击帮助 2.执行命令:yum install wge ...

  3. centos7.7安装mysql8.0.18

    centos7.7安装mysql8.0.18 1 卸载MySQL的步骤 2 安装MySQL的步 3 重新初始化mysql的两种方式 4 selinux开启的情况下改mysql的数据目录 5 libai ...

  4. CentOs7.8安装Redis6.0.9版本(主要是阿里云机器安装)详细步骤

    Redis单机版 一.首先进入Redis官网下载redis 官网下载链接:https://redis.io/download 二.安装Redis 1.切换到Linux下的/usr/local/目录下 ...

  5. centos7下安装redis6.0.6

    一.下载 1.进入下载网站: 打开网站 https://redis.io/download,在网站中右键点击 Download 6.0.6 ,复制链接地址. 2.使用wegt下载 wget http: ...

  6. centos7.0安装php,centos7.3安装php7.0

    需求:在Centos7.3下搭建LNMP环境 文章转载自:http://blog.csdn.net/wszll_alex/article/details/76285324 作者:1. 关闭防火墙和se ...

  7. Centos7.6安装mysql8.0.11

    # centOS7.6下安装mysql # 在/usr/local 下建立mysql文件夹rpm -qa | grep mariadb # 查看是否安装mariadb包rpm -e XXXXXX -- ...

  8. centOS7 下安装 mysql8.0

    1.官网下载 MySQL 安装包 1.1选择版本及下载 1.官网地址 https://dev.mysql.com/downloads/mysql/ 2.选择下载 MySQL 的 Linux 系统版本 ...

  9. centos7 手动安装mysql8.0 并实现双机热备份 2022-1-1

    环境:centos7.9-Minimal mysql:8.0.27 操作权限:root 主目录:/root 由于本人近期yum安装mysql反复报错,现整理出一篇纯手动安装mysql并组建双机热备份教 ...

最新文章

  1. 句法依存分析_[NLP学习笔记]句法分析
  2. h计算机二级基础知识题库,计算机二级考试试题
  3. 构建高可用LVS + keepalived+httpd和双主模型的keepalived方案
  4. Eclipse Theme
  5. System.getProperty()的用途
  6. 关于质量的联想:消费示范效应
  7. 计算机盐城工学院和常熟理工,【选专业】这6所二本院校的专业,就业不输一本学生!...
  8. java String类
  9. 是谁在我的心里打了个结(二十一)托付
  10. 物联网时代下,如何打造智慧新社区?
  11. 12. javacript高级程序设计-DOM2和DOM3
  12. Android BroadcastReceiver示例教程
  13. cdr你的产品已禁用_Coreldraw提示已安装另一版本导致安装失败的解决办法
  14. python import system_[Python Basics]引用系统(The Import System)
  15. 加精!大型互联网应用基于CAS的SSO架构
  16. 网站压力测试工具,不用安装,在线进行【强烈推荐】
  17. 前端人脸识别--两张脸相似度
  18. python里美元怎么表示_说说 Python 正则表达式中的插入字符、美元字符
  19. 2021 最新 Win10 MySQL 安装教程
  20. 【报名有奖】相约2020 RT-Thread 开发者大会RDC

热门文章

  1. 如何利用动态代理IP来做SEO(网络营销)
  2. 四信5G工业智能网关加速5G全连接智慧工厂落地 抢占生产“智”高点
  3. 直接上干货!关于Android开发的面试经验总结,含小米、腾讯、阿里
  4. 屏幕后期处理之:Sobel算子实现边缘检测
  5. rf 遍历列表_RF的变量list在For循环的用法,试错中学习
  6. Adobe Bridge 2021最新中文版来了!!!!
  7. C++ 的成功属于意料之外
  8. 【研发校招专场】云和恩墨2022届春季校招研发岗位持续招聘中!
  9. php 7 current time,PHP检查当前时间(PHP check current time)
  10. ACLR 相邻频道泄漏比