处理时遇到错误:amdgpu-dkms 和警告:编译器与用于构建内核的编译器不同?

处理时遇到错误:amdgpu-dkms 和警告:编译器与用于构建内核的编译器不同?

我尝试通过amdgpu-install脚本为新安装的 Ubuntu 22.04.3 LTS 安装 AMD 显卡驱动程序,但遇到错误:

Error! Bad return status for module build on kernel: 6.2.0-36-generic (x86_64)
Consult /var/lib/dkms/amdgpu/6.2.4-1646729.22.04/build/make.log for more information.
dpkg: error processing package amdgpu-dkms (--configure):
 installed amdgpu-dkms package post-installation script subprocess returned error exit status 10
Setting up libx32gcc-11-dev (11.4.0-1ubuntu1~22.04) ...
Setting up libegl1-amdgpu-mesa-drivers:amd64 (1:23.2.0.50700-1646729.22.04) ...
Setting up libegl1-amdgpu-mesa-drivers:i386 (1:23.2.0.50700-1646729.22.04) ...
Setting up libx32stdc++-11-dev (11.4.0-1ubuntu1~22.04) ...
Setting up lib32gcc-11-dev (11.4.0-1ubuntu1~22.04) ...
Setting up lib32stdc++-11-dev (11.4.0-1ubuntu1~22.04) ...
Setting up amdgpu-lib (1:5.7.50700-1646729.22.04) ...
Setting up rocm-language-runtime (5.7.0.50700-45~22.04) ...
Setting up amdgpu-lib32 (1:5.7.50700-1646729.22.04) ...
Setting up gcc-11-multilib (11.4.0-1ubuntu1~22.04) ...
Setting up gcc-multilib (4:11.2.0-1ubuntu1) ...
Setting up rocm-opencl-runtime (5.7.0.50700-45~22.04) ...
update-alternatives: using /opt/rocm-5.7.0/bin/clinfo to provide /usr/bin/clinfo (clinfo) in auto mode
Setting up g++-11-multilib (11.4.0-1ubuntu1~22.04) ...
Setting up g++-multilib (4:11.2.0-1ubuntu1) ...
Setting up hipcc (1.0.0.50700-45~22.04) ...
Setting up hip-dev (5.7.31921.50700-45~22.04) ...
Setting up hip-runtime-amd (5.7.31921.50700-45~22.04) ...
Setting up rocm-hip-runtime (5.7.0.50700-45~22.04) ...
update-alternatives: using /opt/rocm-5.7.0/bin/rocm_agent_enumerator to provide /usr/bin/rocm_agent_enumerator (rocm_agent_enumerator) in auto mode
update-alternatives: using /opt/rocm-5.7.0/bin/rocminfo to provide /usr/bin/rocminfo (rocminfo) in auto mode
Processing triggers for install-info (6.8-4build1) ...
Processing triggers for libc-bin (2.35-0ubuntu3.4) ...
Processing triggers for man-db (2.10.2-1) ...
Errors were encountered while processing:
 amdgpu-dkms
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)

当我查看时,/var/lib/dkms/amdgpu/6.2.4-1646729.22.04/build/make.log收到一条警告:

DKMS make.log for amdgpu-6.2.4-1646729.22.04 for kernel 6.2.0-36-generic (x86_64)
Prş 02 Kas 2023 19:40:09 +03
make: Entering directory '/usr/src/linux-headers-6.2.0-36-generic'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: x86_64-linux-gnu-gcc-11 (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
  You are using:           gcc-11 (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

我无法解决问题。有什么办法可以解决这个问题吗?

提前致谢。

相关内容