blue-build / modules

BlueBuild standard modules used for building your Atomic Images
Apache License 2.0
22 stars 26 forks source link

feat(akmods): Add support for installing Nvidia akmod on regular images #138

Open fiftydinar opened 4 months ago

fiftydinar commented 4 months ago

Took from ublue-os/nvidia repo's install.sh & post-install.sh, adapted it a little bit in terms of variables & that's it.

Thanks to the new nvidia-version yaml entry, users can specify that entry with driver version & akmods module will now install nvidia driver automatically. If it detects that Nvidia driver already exist, it doesn't install those drivers.

Advantages:

Only occasional maintenance would be checking when new Nvidia driver releases, to update installation check. Also when install or post-install.sh is updated in ublue-os/nvidia repo (last update affecting us is 4-5 months ago).

Related work: https://github.com/blue-build/cli/pull/71

Needs testing, since I don't have Nvidia hardware.

xynydev commented 4 months ago

Looks great! Is required testing the reason this is marked as draft? I approved the cli PR now as per your previous conversation the logic seems sound. This PR also needs minor docs changes, but I'll do the testing first, I have Nvidia hardware. Gotta first add some inputs to the GitHub Action that make it possible to use nightly builds.

fiftydinar commented 4 months ago

Looks great! Is required testing the reason this is marked as draft? I approved the cli PR now as per your previous conversation the logic seems sound. This PR also needs minor docs changes, but I'll do the testing first, I have Nvidia hardware. Gotta first add some inputs to the GitHub Action that make it possible to use nightly builds.

Yeah, draft is because of needed testing & needed fix for supergfxctl extension + sway simlink thing.

fiftydinar commented 4 months ago

I fixed supergfxctl extension install & Sway workaround.

I determine the name of DE by using /usr/lib/os-release file & fetching VERSION_ID tag.

I think that Sway variant has "sericea" VERSION_ID codename still, but this needs to be seen.

The only thing which remains now is testing.

fiftydinar commented 4 months ago

In the meantime, new Nvidia driver is released as v550:

https://www.nvidia.com/Download/driverResults.aspx/218826/en-us/

We are waiting for RPMFusion & then Universal Blue to update to this driver before commiting v550 update to this PR

fiftydinar commented 4 months ago

For Nvidia driver, we might need to additionally include some udev rules, modprobe files or kernel arguments.

This will be hard to do automatically imo, so we would maybe inform the user that he needs to do that for successful Nvidia driver function.

xynydev commented 4 months ago

I tried to run builds with this module with configuration based on the one in module.yml. Got this error each time:

You provided unsupported Nvidia akmod version in nvidia-version recipe entry, only v550 & v470 are supported.

https://github.com/xynydev/linuXYZ/actions/runs/8083616996/job/22087065329 https://github.com/xynydev/linuXYZ/actions/runs/8083702091/job/22087336641

fiftydinar commented 4 months ago

I tried to run builds with this module with configuration based on the one in module.yml. Got this error each time:

You provided unsupported Nvidia akmod version in nvidia-version recipe entry, only v550 & v470 are supported.

https://github.com/xynydev/linuXYZ/actions/runs/8083616996/job/22087065329 https://github.com/xynydev/linuXYZ/actions/runs/8083702091/job/22087336641

This is because I future-proofed this PR to support v550 Nvidia driver version, which is very-near, but not yet available.

To currently test it, please manually change that check to 545, along with your nvidia-version recipe entry.

xynydev commented 4 months ago

Finally a working run. That was pain. I recommend now-proofing PRs that are supposed to be tested or reviewed, updating them when necessary shouldn't be hard.

https://github.com/xynydev/linuXYZ/actions/runs/8084566526/job/22090114866

fiftydinar commented 4 months ago

Finally a working run. That was pain. I recommend now-proofing PRs that are supposed to be tested or reviewed, updating them when necessary shouldn't be hard.

https://github.com/xynydev/linuXYZ/actions/runs/8084566526/job/22090114866

Looking at logs, it seems that akmods module just echoed

Installing akmods
Installing: openrgb

And nothing else happened.

Maybe parsing of nvidia-version entry is somehow not correct?

I'll need to check what is wrong.

Running script with set -euxo pipefail would make that process easier.

I will temporarily set my repo too for testing things in build-time, but you or someone else with Nvidia card would be still needed to test this PR in post-install.

xynydev commented 4 months ago

If you can make a working version of the module I can just use in my builds to test and notify me about it, that'll be great.

xynydev commented 4 months ago

156 should make testing easier in the future.