Score:0

How do I fix amdgpu and amdgpu-dkms packages not installing?

tl flag

I'm trying to install the amdgpu package and it throws a bunch of errors:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  dctrl-tools dh-dkms libcfitsio9 libgdal31 libmpdec3 libnginx-mod-http-geoip libnginx-mod-http-image-filter libnginx-mod-http-xslt-filter libnginx-mod-mail libnginx-mod-stream libnginx-mod-stream-geoip
  libpoppler123 libprotobuf23 libpython3.10 libpython3.10-dev libpython3.10-minimal libpython3.10-stdlib libtiff5 libzxingcore1 linux-headers-6.1.0-kali5-common linux-kbuild-6.1 nginx-common nginx-core
  python-pastedeploy-tpl python3-commonmark python3-speaklater python3.10 python3.10-dev python3.10-minimal ruby3.0 ruby3.0-dev ruby3.0-doc
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  amdgpu amdgpu-dkms
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/9,848 kB of archives.
After this operation, 428 MB of additional disk space will be used.
Selecting previously unselected package amdgpu-dkms.
(Reading database ... 503090 files and directories currently installed.)
Preparing to unpack .../amdgpu-dkms_1%3a5.18.13.50403-1538762.22.04_all.deb ...
Unpacking amdgpu-dkms (1:5.18.13.50403-1538762.22.04) ...
Selecting previously unselected package amdgpu.
Preparing to unpack .../amdgpu_1%3a5.4.50403-1538762.22.04_amd64.deb ...
Unpacking amdgpu (1:5.4.50403-1538762.22.04) ...
Setting up amdgpu-dkms (1:5.18.13.50403-1538762.22.04) ...
Loading new amdgpu-5.18.13-1538762.22.04 DKMS files...
Building for 6.0.0-kali6-amd64
Building for architecture amd64
Building initial module for 6.0.0-kali6-amd64
Error! Bad return status for module build on kernel: 6.0.0-kali6-amd64 (amd64)
Consult /var/lib/dkms/amdgpu/5.18.13-1538762.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
dpkg: dependency problems prevent configuration of amdgpu:
 amdgpu depends on amdgpu-dkms; however:
  Package amdgpu-dkms is not configured yet.

dpkg: error processing package amdgpu (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 amdgpu-dkms
 amdgpu
E: Sub-process /usr/bin/dpkg returned an error code (1)

Anyways, I tried reinstalling them and it doesn't work. Not after apt purge, or apt upgrade. I'm kind of lost. I read /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/make.log logs and it looks like the problem is that it's trying to install the packages for 6.0.1-kali5-amd64 instead of 6.0.0-kali6-amd64. I don't know how to fix it tho. This started happening after i updated my system. The new kernel kept throwing 'kernel panic - not syncing' so I uninstalled it. It looks like apt thinks the old kernel is still installed. Here are the logs if this can help:

DKMS make.log for amdgpu-5.18.13-1538762.22.04 for kernel 6.0.0-kali6-amd64 (amd64)
Thu Apr  6 09:08:53 PM CEST 2023
make: Entering directory '/usr/src/linux-headers-6.0.0-kali6-amd64'
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/scheduler/sched_main.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm/ttm_tt.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/main.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdgpu/amdgpu_drv.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/symbols.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_common.o
In file included from /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdgpu/amdgpu.h:69,
                 from /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/backport/include/kcl/kcl_amdgpu_drm_fb_helper.h:35,
                 from /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/backport/backport.h:84,
                 from <command-line>:
/var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdgpu/amdgpu_mode.h:308:32: error: field ‘base’ has incomplete type
  308 |         struct drm_framebuffer base;
      |                                ^~~~
In file included from /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/backport/backport.h:85:
/var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/backport/include/kcl/kcl_amdgpu_drm_gem_framebuffer_helper.h: In function ‘kcl_drm_gem_fb_set_obj’:
/var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/backport/include/kcl/kcl_amdgpu_drm_gem_framebuffer_helper.h:12:19: error: invalid use of undefined type ‘struct drm_framebuffer’
   12 |                 fb->obj[index] = obj;
      |                   ^~
make[2]: *** [/usr/src/linux-headers-6.0.0-kali6-common/scripts/Makefile.build:254: /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdgpu/amdgpu_drv.o] Error 1
make[1]: *** [/usr/src/linux-headers-6.0.0-kali6-common/scripts/Makefile.build:470: /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdgpu] Error 2
make[1]: *** Waiting for unfinished jobs....
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/scheduler/sched_fence.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_kernel_params.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm/ttm_bo.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/dma-buf/dma-resv.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/scheduler/sched_entity.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_backlight.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_ioctl.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm/ttm_bo_util.o
  LD [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/scheduler/amd-sched.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm/ttm_bo_vm.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_kthread.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_io.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_perf_event.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_seq_file.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_suspend.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_pci.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_mm.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm/ttm_module.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm/ttm_execbuf_util.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_memory.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm/ttm_range_manager.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_sched.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_fence.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm/ttm_resource.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_fence_array.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm/ttm_pool.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_reservation.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_drm_cache.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_drm_auth.o
/var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm/ttm_pool.c: In function ‘ttm_pool_mgr_init’:
/var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm/ttm_pool.c:726:16: error: too few arguments to function ‘register_shrinker’
  726 |         return register_shrinker(&mm_shrinker);
      |                ^~~~~~~~~~~~~~~~~
In file included from /usr/src/linux-headers-6.0.0-kali6-common/include/linux/mm.h:20,
                 from /usr/src/linux-headers-6.0.0-kali6-common/include/linux/scatterlist.h:8,
                 from /usr/src/linux-headers-6.0.0-kali6-common/include/linux/dma-mapping.h:10,
                 from /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/include/kcl/kcl_dma_mapping.h:5,
                 from /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm/backport/backport.h:9,
                 from <command-line>:
/usr/src/linux-headers-6.0.0-kali6-common/include/linux/shrinker.h:99:27: note: declared here
   99 | extern int __printf(2, 3) register_shrinker(struct shrinker *shrinker,
      |                           ^~~~~~~~~~~~~~~~~
/var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm/ttm_pool.c:727:1: error: control reaches end of non-void function [-Werror=return-type]
  727 | }
      | ^
cc1: some warnings being treated as errors
make[2]: *** [/usr/src/linux-headers-6.0.0-kali6-common/scripts/Makefile.build:254: /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm/ttm_pool.o] Error 1
make[2]: *** Waiting for unfinished jobs....
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_drm_fb.o
make[1]: *** [/usr/src/linux-headers-6.0.0-kali6-common/scripts/Makefile.build:470: /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/ttm] Error 2
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_drm_print.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_fbmem.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_drm_crtc.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_drm_connector.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_drm_atomic_helper.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_device_cgroup.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_mn.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_drm_modes.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_time.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_ftrace.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_acpi_table.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_page_alloc.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_numa.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_fs_read_write.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_drm_aperture.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_drm_drv.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_drm_simple_kms_helper.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_bitmap.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_vmscan.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_dma_fence_chain.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_mce_amd.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_workqueue.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_cpumask.o
/var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_cpumask.c:6:1: warning: "/*" within comment [-Wcomment]
    6 | /**
      |  
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_drm_dsc_helper.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_debugfs_inode.o
  CC [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/kcl_sysfs_emit.o
  LD [M]  /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build/amd/amdkcl/amdkcl.o
make: *** [/usr/src/linux-headers-6.0.0-kali6-common/Makefile:1876: /var/lib/dkms/amdgpu/5.18.13-1538762.22.04/build] Error 2
make: Leaving directory '/usr/src/linux-headers-6.0.0-kali6-amd64'

Thank you in advance

vidarlo avatar
ar flag
Kali is not intended as a general purpose OS. Do not attempt to use it as one, unless you understand the implications.
Mach avatar
tl flag
@vidarlo yes, i am trying to install amdgpu drivers on it because hashcat doesn't detect my gpu at all. i wouldn't want the gpu to just sit there and collect dust.
Jaromanda X avatar
ru flag
`it's trying to install the packages for 6.0.1-kali5-amd64 instead of 6.0.0-kali6-amd64` - nothing you've posted indicates that is the case - the term `6.0.1-kali5-amd64` appears once in your post where you incorrectly assume the problem, where as `6.0.0-kali6-amd64` appears over a dozen times - I assume `6.0.1-kali5-amd64` is the kernel that panics and was uninstalled?
Ginnungagap avatar
gu flag
Where does the amdgpu package come from? Is this the official AMD package or the one provided by Kali's repositories?
vidarlo avatar
ar flag
@Mach Run hashcat on a distro that is actually intended for general use, e.g. Ubuntu, OpenSUSE, Fedora or similar.
Mach avatar
tl flag
@vidarlo Ok, well i like how kali has everything i need preinstalled, would you recommend dual boot or virtual machine?
vidarlo avatar
ar flag
I'd generally suggest VM.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.