Skip to content

DKMS removal of an old kernel deletes shared amd-smi and libamdsmi #30

Open

Description

@clint-hotaisle

Problem

Removing an old kernel triggers GIM's DKMS POST_REMOVE hook, which unconditionally deletes the shared AMD SMI userspace files even when GIM remains installed for another kernel.

This can leave an otherwise installed GIM driver without /usr/local/bin/amd-smi and /usr/local/lib/libamdsmi.so after routine kernel cleanup.

Affected versions

  • Observed with GIM 9.2.0.K.
  • The same deletion is present in the 9.3.0.K Debian package (confirmed by package inspection).
  • It is also present on upstream staging at 78ffbb3468394dd1f3d90bf56334101c8b124598.

Cause

gim/dkms/post-remove.sh runs:

make -C ./smi-lib clean
make -C ./smi-lib/cli/cpp clean
rm -f /usr/local/include/amdsmi.h /usr/local/bin/amd-smi /usr/local/lib/libamdsmi.*

DKMS invokes this hook when removing an individual kernel's module installation, but these userspace files are shared across all kernels.

The post-install script installs those files. Consequently, installing a new kernel and then removing an old one can install the tools and immediately delete them again.

Reproduction

  1. Install the GIM DKMS package for at least two kernels.
  2. Confirm the CLI and library exist under /usr/local.
  3. Remove one unused kernel through the distribution's normal package manager.
  4. Check that GIM remains installed for the retained kernel, then check the CLI and library paths.

Expected: Removing one kernel's modules preserves the shared userspace tools required by the remaining installation.

Actual: The shared CLI, library, and header are deleted.

Suggested fix

Manage shared userspace files independently of per-kernel DKMS removal, or otherwise prevent removal of one kernel's modules from deleting files needed by retained installations. Full package removal and upgrades between GIM versions also need correct ownership handling.

A regression test should cover installing GIM for two kernels, removing one kernel, and verifying that the shared tools remain available.

Activity

  1. yunxiali commented on Nov 9, 2026

    @yunxiali
    Collaborator

    Hi @clint-hotaisle thank you for the detailed report! We have reproduced this internally and the fix is going to be included in the next release.

  2. yunxiali commented on Nov 18, 2026

    @yunxiali
    Collaborator

    Should be fixed in the 9.4.0.K release, please let me know if you still see the issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions