centos安装cuda时报错You appear to be running an X server; please exit X before installing

在centos上安装cuda时,从官网上下载.run文件,然后运行,但是安装失败,如下图所示。

打开日志文件后,内容如下

[INFO]: Driver not installed.
[INFO]: Checking compiler version...
[INFO]: gcc location: /usr/bin/gcc

[INFO]: gcc version: gcc 版本 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) 

[INFO]: Initializing menu
[INFO]: nvidia-fs.setKOVersion(2.12.8)
[INFO]: Setup complete
[INFO]: Components to install: 
[INFO]: Driver
[INFO]: 515.65.01
[INFO]: Executing NVIDIA-Linux-x86_64-515.65.01.run --ui=none --no-questions --accept-license --disable-nouveau --no-cc-version-check --install-libglvnd  2>&1
[INFO]: Finished with code: 256
[ERROR]: Install of driver component failed. Consult the driver log at /var/log/nvidia-installer.log for more details.
[ERROR]: Install of 515.65.01 failed, quitting

从上面的信息可以看出,是安装显卡驱动时失败,打开日志,如下图所示。

nvidia-installer log file '/var/log/nvidia-installer.log'
creation time: Mon Sep  9 20:48:07 2024
installer version: 515.65.01

PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin

nvidia-installer command line:
    ./nvidia-installer
    --ui=none
    --no-questions
    --accept-license
    --disable-nouveau
    --no-cc-version-check
    --install-libglvnd

Using built-in stream user interface
-> Detected 40 CPUs online; setting concurrency level to 32.
-> Tagging shared libraries with chcon -t textrel_shlib_t.
-> The file '/tmp/.X0-lock' exists and appears to contain the process ID '1833' of a running X server.
ERROR: You appear to be running an X server; please exit X before installing.  For further details, please see the section INSTALLING THE NVIDIA DRIVER in the README available on the Linux driver download page at www.nvidia.com.
ERROR: Installation has failed.  Please see the file '/var/log/nvidia-installer.log' for details.  You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com.

报错的原因是启动了图形界面 Xserver.

解决方法:

输入init 3关闭图像界面

按照提示安装cuda

输入init 5开启图像界面

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值