文档首页/ 云容器引擎 CCE/ 常见问题/ 模板插件/ EulerOS 2.9系统安装NVIDIA驱动失败
更新时间:2025-05-21 GMT+08:00

EulerOS 2.9系统安装NVIDIA驱动失败

问题现象

在EulerOS 2.9系统中,手动安装GPU驱动时,即未通过CCE AI套件(NVIDIA GPU)插件安装驱动,出现错误,且错误提示如下:

ERROR: Unable to find the kernel source tree for the currently running kernel. Please make sure you have installed the kernel source files for your kernel and that they are properly configured; on Red Hat Linux systems, for example, be sure you have the 'kernel-source' or 'kernel-devel' RPM installed. If you know the correct kernel source files are installed, you may specify the kernel source path with the '--kernel-source-path' command line option.
 ...

问题定位

当安装GPU驱动出错时,可以通过以下命令查询驱动日志,从而确定报错原因。

cat /var/log/nvidia-installer.log

若回显中存在以下内容,则说明未安装GPU驱动的相关依赖项。

...
Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel
...

解决方法

您可以采取两种方式解决上述问题:

  • 通过CCE AI套件(NVIDIA GPU)插件重新安装GPU驱动,具体请参见安装CCE AI套件(NVIDIA GPU)插件
  • 先手动安装缺少的依赖项,后重新安装GPU驱动,具体步骤如下:
    1. 执行以下命令,安装问题定位中缺少的依赖项。
      yum install -y gcc gcc-c++ perl make elfutils-libelf-devel libX11 libXext binutils

      回显结果如下,则说明依赖项安装成功。

      ...
      Complete!
    2. 执行以下命令,重新安装驱动。
      ./NVIDIA-Linux-x86_64-535.54.03.run --silent --accept-license
      • 若回显结果中无ERROR,则说明驱动成功。例如:
        Verifying archive integrity... OK
        ...
        WARNING: This NVIDIA driver package includes Vulkan components, but no Vulkan ICD loader was detected on this system. The NVIDIA Vulkan ICD will not function without the loader. Most distributions package the Vulkan loader; try instal1ling the "vulkan-loader", "vulkan-icd-1oaderor,""libvulkanl" package.
      • 若回显中出现如下错误,则需要在安装命令中加入“--no-drm”。
        ERROR: Unable to load the kernel module 'nvidia-drm ko'. ...
        ERROR: The nvidia-drm kernel module failed to load. This kernel module is required for the proper operation of DRM-KMS. If you do not need to use DRM-KMS, you can try to install this driver package again with the '--no-drm' option.
        ...

        请执行以下命令,重新安装驱动。

        ./NVIDIA-Linux-x86_64-535.54.03.run --silent --accept-license --no-drm
    3. 执行以下命令,验证驱动nvidia-smi是否可以正常使用。
      nvidia-smi

      回显结果如下,则说明nvidia-smi可以正常使用。

      图1 回显结果