Hi,
I’m using AMD’s amdgpu-pro driver package on Leap 15.3 (currently, it’s version 21.20 for SLE 15.3). This installs a kernel module via DKMS. This works fine after initially installing the driver package or updating it. But whenever the Leap/SLE kernel receives an update, I have to manually either reinstall the amdgpu-package or run
sudo dkms install -m amdgpu -v "$(sudo rpm -q --qf '%{VERSION}-%{RELEASE}' amdgpu-dkms)" -k "$(uname -r)"
to get the kernel module installed for the latest kernel package as well.
I know the SLE/Leap aims to provide a stable kernel ABI, so recompilation of kernel modules shouldn’t be necessary. However, after each kernel update, Leap simply goes back to using the module version which was shipped with the kernel package, until I manually apply one of the two solutions described above.
How can I install a module via DKMS so it automatically gets carried over to the latest kernel package (or rebuilt)? Or are there any users of the amdgpu-pro package that can provide any details how they work with the driver package without reinstalling the package or the module manually after each kernel upgrade?
Or is there any other way, how I can automatically run a command/script after each kernel update to take care of this?
Btw. this issue isn’t new to Leap 15.3. It has bugged me on 15.2 as well. But I’m not quite sure about how it was on 15.1 or 15.0.
Thanks and regards,
Timo
I’ve done that before. The reason I like to use AMD’s kernel module is that this is based on a more recent kernel (5.11 at the moment) with the latest hardware support and features. For my GPU this means, for example, that power and fan management is improved and the fan finally stays off when there’s little load which is not the case with the default kernel.
**Nevertheless, I did find the solution to my problem in the meantime. It’s quite simple. You need to enable the dkms service. **This will then automatically rebuild any dkms modules that were installed for older kernel versions upon boot if they haven’t been built for the latest (running) kernel. I’ve tried that before and it didn’t work on Leap 15.2. But back then I was also experimenting with automatic module signing for modules built via DKMS so that might have messed this up (I think I even know why). In any case, on Leap 15.3 it seems to work now.
Now I can look at module signing again seperately.
If module is installed in updates or extra subdirectory, kernel postinstall script should check if modules in these locations for older kernel versions are kABI compatible and simply link them under weak-updates.
So the first question is - in which location DKMS installs these modules.
P.S. Oh, I just realized that it does not actually work this way now. The script only works for KMP (Kernel Module Packages) - it no more looks under predefined locations, but queries KMP file list. So it will no more work for DKMS build.
The amdgpu module is installed in the updates subdirectory. But as you mentioned, it doesn’t work automatically. If you enable the dkms service (which isn’t by default, even if you install the dkms package) then the module gets rebuilt after a kernel update after the reboot.
I also got it working now with automatic module signing so Secure Boot can stay enabled. The reason it didn’t work before in conjunction with the dkms service is that I was previously trying to use a signing key protected by a passphrase, so the signing script asked for that during the rebuild of the module which worked while manually invoking dkms or during the reinstallation of the amdgpu-pro driver package (i.e. when the module is built immediately and I would see the password prompt in my terminal window). But when the module is rebuild during the boot process that failed. After replacing the signing key with one that didn’t have a password and works non-interactively, the dkms service actually does it’s job just fine and the module signing works, too.
Anyway, the only issue I have left is that when I install my signing key using mokutil, I can see the key registered afterwards, but the kernel doesn’t load or trust it. I had to manually import the key from a flash drive via the UEFI setup and now the kernel trusts it. I will investigate this further, and if there is still an issue, I’ll open another topic.
But as for the initial question, how to keep dkms modules working after a kernel update or how to use the amdgpu-pro driver package, the answer is simple (as mentioned before): enable the dkms service and you’re good to go.