运行 Ubuntu 20.04,尝试安装 amdgpu 驱动程序

运行 Ubuntu 20.04,尝试安装 amdgpu 驱动程序

与讨论的问题类似这里,我在配置 amdgpu-dkms 时遇到了问题。可选 amdgpu 驱动程序的安装在该步骤上挂起。以下是dpkg --configure amdgpu-dkms


    Setting up amdgpu-dkms (1:5.4.7.53-1048554) ...
Removing old amdgpu-5.4.7.53-1048554 DKMS files...


Deleting module version: 5.4.7.53-1048554
completely from the DKMS tree.

Done.
Loading new amdgpu-5.4.7.53-1048554 DKMS files...
Building for 5.4.0-96-generic
Building for architecture x86_64
Building initial module for 5.4.0-96-generic
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/amdgpu-dkms-firmware.0.crash'
Error! Bad return status for module build on kernel: 5.4.0-96-generic (x86_64)
Consult /var/lib/dkms/amdgpu/5.4.7.53-1048554/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
Errors were encountered while processing:
 amdgpu-dkms

引用的日志文件包含以下文本:

DKMS make.log for amdgpu-5.4.7.53-1048554 for kernel 5.4.0-96-generic (x86_64)
Sat 29 Jan 2022 06:43:23 AM CST
make: Entering directory '/usr/src/linux-headers-5.4.0-96-generic'
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdkcl/symbols.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdkcl/kcl_mn.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/amdgpu_drv.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdkcl/main.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdkcl/kcl_device_cgroup.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/amdgpu_device.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdkcl/kcl_drm_cache.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdkcl/kcl_drm.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/amdgpu_kms.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdkcl/kcl_fence_array.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdkcl/kcl_fence.o
/var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdkcl/kcl_fence.c:29:1: warning: ‘dma_fence_test_signaled_any’ defined but not used [-Wunused-function]
   29 | dma_fence_test_signaled_any(struct dma_fence **fences, uint32_t count,
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdkcl/kcl_io.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/amdgpu_atombios.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdkcl/kcl_kthread.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdkcl/kcl_mm.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/atombios_crtc.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdkcl/kcl_pci.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/amdgpu_connectors.o
/var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdkcl/kcl_pci.c: In function ‘amdkcl_pci_init’:
/var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdkcl/kcl_pci.c:102:84: warning: passing argument 2 of ‘amdkcl_fp_setup’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  102 |  _kcl_pcie_link_speed = (const unsigned char *) amdkcl_fp_setup("pcie_link_speed", _kcl_pcie_link_speed_stub);
      |                                                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdkcl/kcl_pci.c:3:
/var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdkcl/kcl_common.h:23:63: note: expected ‘void *’ but argument is of type ‘const unsigned char *’
   23 | static inline void *amdkcl_fp_setup(const char *symbol, void *fp_stup)
      |                                                         ~~~~~~^~~~~~~
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdkcl/kcl_perf_event.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdkcl/kcl_reservation.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/atom.o
/var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdkcl/kcl_reservation.c: In function ‘amdkcl_reservation_init’:
/var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdkcl/kcl_reservation.c:58:10: warning: passing argument 2 of ‘amdkcl_fp_setup’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-array-qualifiers]
   58 |          &_kcl_reservation_seqcount_string_stub);
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdkcl/kcl_reservation.c:32:
/var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdkcl/kcl_common.h:23:63: note: expected ‘void *’ but argument is of type ‘const char (*)[21]’
   23 | static inline void *amdkcl_fp_setup(const char *symbol, void *fp_stup)
      |                                                         ~~~~~~^~~~~~~
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdkcl/dma-resv.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdkcl/kcl_suspend.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/amdgpu_fence.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdkcl/kcl_workqueue.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdkcl/kcl_seq_file.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdkcl/kcl_connector.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/amdgpu_ttm.o
  LD [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdkcl/amdkcl.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/scheduler/sched_main.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/amdgpu_object.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/scheduler/sched_fence.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/amdgpu_gart.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/scheduler/sched_entity.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/amdgpu_encoders.o
  LD [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/scheduler/amd-sched.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/ttm/ttm_memory.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/amdgpu_display.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/ttm/ttm_tt.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/amdgpu_i2c.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/amdgpu_fb.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/ttm/ttm_bo.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/amdgpu_gem.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/ttm/ttm_bo_util.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/amdgpu_ring.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/amdgpu_cs.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/ttm/ttm_bo_vm.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/amdgpu_bios.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/ttm/ttm_module.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/ttm/ttm_execbuf_util.o
/var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/amdgpu_bios.c: In function ‘amdgpu_read_platform_bios’:
/var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/amdgpu_bios.c:200:9: error: implicit declaration of function ‘pci_platform_rom’ [-Werror=implicit-function-declaration]
  200 |  bios = pci_platform_rom(adev->pdev, &size);
      |         ^~~~~~~~~~~~~~~~
/var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/amdgpu_bios.c:200:7: warning: assignment to ‘uint8_t *’ {aka ‘unsigned char *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  200 |  bios = pci_platform_rom(adev->pdev, &size);
      |       ^
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:270: /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu/amdgpu_bios.o] Error 1
make[1]: *** [scripts/Makefile.build:519: /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/amd/amdgpu] Error 2
make[1]: *** Waiting for unfinished jobs....
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/ttm/ttm_page_alloc.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/ttm/ttm_bo_manager.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/ttm/ttm_agp_backend.o
  CC [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/ttm/ttm_page_alloc_dma.o
  LD [M]  /var/lib/dkms/amdgpu/5.4.7.53-1048554/build/ttm/amdttm.o
make: *** [Makefile:1762: /var/lib/dkms/amdgpu/5.4.7.53-1048554/build] Error 2
make: Leaving directory '/usr/src/linux-headers-5.4.0-96-generic'

尝试安装和配置 amdgpu 后,默认驱动程序 Radeon 似乎已损坏。它仍安装,但不再控制我的 gpu Systemctl status gpu-manager.service

Gpu-manager.service - detect the available gpus and deal with any system changes
   Loaded: loaded (/lib/system/gpu-manager.service; enabled; vender preset: enabled)
   Active: inactive (dead)

根据这篇文章和其他研究(只需谷歌一下这个问题)似乎 amdgpu 仅与某些内核兼容。我已经尝试使用 清除软件包apt purge amdgpu。我不知道如何修复默认驱动程序“radeon”。我是否应该放弃尝试使用这个较新的驱动程序并专注于恢复默认驱动程序?理想情况下,我希望将两个驱动程序都作为选项提供,以便在 amdgpu 出现故障时我可以恢复默认驱动程序。

这是我的硬件规格。我会根据需要编辑以添加其他信息。

处理器:Intel(R) Pentium(R) CPU G3258 @ 3.20GHz 内存:8041MB(已使用 1523MB) 显卡:Radeon R7 240 (2GB) 机器类型:台式机 操作系统:Ubuntu 20.04.3 LTS

-SCSI 磁盘- ATA KINGSTON SA400S3 (SSD,启动驱动器) ATA Samsung SSD 860 (SSD) WDC WD25 00BEVT-60A23T0 (HDD)

答案1

太长不看...举报吧!链接如下。

从你的输出来看:

Building for 5.4.0-96-generic

假设您有现成的 20.04.4,则 5.4 内核不是您正在使用的。该模块无法正确检测内核版本。

它会删除旧版本,然后重建完全相同的版本。

输出中的内核与 Ubuntu 20.04.1 发布的第一个版本完全相同,或者至少非常接近。

这肯定是一个错误。这似乎是模块的 dkms 实现存在的问题。应该报告这里。

报告此类错误非常重要。通过链接的问题跟踪器获得的用户反馈是开发人员查找错误的主要信息来源。在大多数情况下,尤其是在开源软件中,开发人员查找极端错误的唯一工具是问题跟踪器和测试期间的运气。

换句话说,如果您还没有报告,就不要指望它很快就会得到修复。它显然从 20.04.1 开始就存在了,而且我在网上看到的所有内容都表明 AMDGPU 的开发周期相对较快(即大量修复、大量版本升级),所以他们很可能没有看到它。它可能特定于您的显卡。

答案2

如果你在 20.04.4 上尝试这个,适用于 amdgpu 21.40.2 的最新版本是 Ubuntu 20.04.3,所以你要么需要 21.40.2 和 Ubuntu 20.04.3,要么再等一段时间才能得到 20.04.4 的驱动程序

答案3

在将内核版本从 5.11.0-44 升级到 5.13.0-27 后,我遇到了非常类似的问题。我降级到内核版本 5.11.0-44,它继续正常构建和安装。

为了消除 dkms 构建错误,我必须删除所有与驱动程序构建相关的内核版本。

也许您可以尝试内核 5.11.0?

答案4

您的里程可能会有所不同,但对于amd 安装程序明智地创建了:

/etc/modprobe.d/blacklist-amdgpu.conf包含:

blacklist amdgpu

这就是为什么该模块在重启后没有被加载,进而导致gdm(和 Xorg)无法启动。我删除了该文件,一切又恢复正常了。

相关内容