Fedora-OSTree-Setup-dev / Fedora-OSTree-Setup

Glorified scipt that automates the setup of Fedora Silverblue/Kinoite based on given config file.
GNU General Public License v3.0
7 stars 3 forks source link

gpu driver installation #5

Open iaacornus opened 1 year ago

iaacornus commented 1 year ago

installation of appropriate/corresponding gpu driver upon detection based on user's discretion

john-ghatas commented 1 year ago

This can be automated or being left as a choice to the user. To get the vendor of the graphics card you can do something like maybe?

❯ lspci | grep -E -i "VGA|3D controller" | sed "s/.*controller: //g"
Intel Corporation CoffeeLake-H GT2 [UHD Graphics 630]
NVIDIA Corporation TU117M [GeForce GTX 1650 Mobile / Max-Q] (rev a1)
❯ lspci | grep -E -i "VGA|3D controller" | sed "s/.*controller: //g" | cut -f 1 -d " "
Intel
NVIDIA

I am sure there is an easier way to do this. Maybe you can only grep on the 3d controller as well as intergrated graphics are not what we are looking for.

boredsquirrel commented 1 year ago

Some NVIDIA stuff, using rpmfusion rpms and akmods.

Not sure if this is a good idea without installing the rpmfusion repo too.

rpm-ostree install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm && reboot
sudo rpm-ostree kargs --append=rd.driver.blacklist=nouveau --append=modprobe.blacklist=nouveau --append=nvidia-drm.modeset=1

rpm-ostree update --install xorg-x11-drv-nvidia akmod-nvidia

I dont use NVIDIA, does it work on Wayland?

In the Nvidia segment we should include more. This also should be optional, I dont know how bad the noveau drivers are but proprietary drivers are not that nice.

Also what about the universioned rpmfusion?

john-ghatas commented 1 year ago

Yes NVIDIA works with wayland. I documented the steps to install the nvidia packages here.

# Add RPM Fusion
rpm-ostree install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

# Install the driver packages
rpm-ostree install akmod-nvidia xorg-x11-drv-nvidia
rpm-ostree install akmod-nvidia xorg-x11-drv-nvidia-cuda xorg-x11-drv-nvidia-cuda-libs
rpm-ostree kargs --append=rd.driver.blacklist=nouveau --append=modprobe.blacklist=nouveau --append=nvidia-drm.modeset=1 initcall_blacklist=simpledrm_platform_driver_init

# Permanantly fix RPM Fusion, we could place this somewhere else?
rpm-ostree update --uninstall rpmfusion-free-release --uninstall rpmfusion-nonfree-release --install rpmfusion-free-release --install rpmfusion-nonfree-release

I do this after the the installation of the rpm-fusion (as they are only available in their repositories), which would likely require a reboot.

This step could be best placed after updating the system and adding the rpmfusion repositories

References:

boredsquirrel commented 1 year ago

Okay nice! So you install the rpm itself and that deals with the updates!