Installs correct dkms package for nvidia and nvidia-open (#1847)

This commit is contained in:
Himadri Bhattacharjee 2023-06-08 08:54:52 +00:00 committed by GitHub
parent de9b8d4f0e
commit 701d1e4ec3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -194,14 +194,18 @@ class ProfileHandler:
additional_pkg = ' '.join(['xorg-server', 'xorg-xinit'] + driver_pkgs)
if driver is not None:
if 'nvidia' in driver:
if "linux-zen" in install_session.base_packages or "linux-lts" in install_session.base_packages:
# Find the intersection between the set of known nvidia drivers
# and the selected driver packages. Since valid intesections can
# only have one element or none, we iterate and try to take the
# first element.
if driver_pkg := next(iter({'nvidia','nvidia-open'} & set(driver_pkgs)), None):
if any(kernel in install_session.base_packages for kernel in ("linux-lts", "linux-zen")):
for kernel in install_session.kernels:
# Fixes https://github.com/archlinux/archinstall/issues/585
install_session.add_additional_packages(f"{kernel}-headers")
# I've had kernel regen fail if it wasn't installed before nvidia-dkms
install_session.add_additional_packages(['dkms', 'xorg-server', 'xorg-xinit', 'nvidia-dkms'])
install_session.add_additional_packages(['dkms', 'xorg-server', 'xorg-xinit', f'{driver_pkg}-dkms'])
return
elif 'amdgpu' in driver_pkgs:
# The order of these two are important if amdgpu is installed #808