Skip to content
16 changes: 8 additions & 8 deletions archinstall/lib/global_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ def _get_menu_options(self) -> list[MenuItem]:
preview_action=self._prev_bootloader_config,
key='bootloader_config',
),
MenuItem(
text=tr('Kernels'),
value=['linux'],
action=select_kernel,
preview_action=self._prev_kernel,
mandatory=True,
key='kernels',
),
MenuItem(
text=tr('Hostname'),
value='archlinux',
Expand All @@ -118,14 +126,6 @@ def _get_menu_options(self) -> list[MenuItem]:
preview_action=self._prev_applications,
key='app_config',
),
MenuItem(
text=tr('Kernels'),
value=['linux'],
action=select_kernel,
preview_action=self._prev_kernel,
mandatory=True,
key='kernels',
),
MenuItem(
text=tr('Network configuration'),
action=ask_to_configure_network,
Expand Down
22 changes: 7 additions & 15 deletions archinstall/lib/hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class GfxPackage(Enum):
LibvaMesaDriver = 'libva-mesa-driver'
LibvaNvidiaDriver = 'libva-nvidia-driver'
Mesa = 'mesa'
NvidiaDkms = 'nvidia-dkms'
NvidiaOpenDkms = 'nvidia-open-dkms'
Nvidia = 'nvidia-open'
NvidiaDkms = 'nvidia-open-dkms'
VulkanIntel = 'vulkan-intel'
VulkanRadeon = 'vulkan-radeon'
VulkanNouveau = 'vulkan-nouveau'
Expand All @@ -59,14 +59,13 @@ class GfxDriver(Enum):
AllOpenSource = 'All open-source'
AmdOpenSource = 'AMD / ATI (open-source)'
IntelOpenSource = 'Intel (open-source)'
NvidiaOpenKernel = 'Nvidia (open kernel module for newer GPUs, Turing+)'
Nvidia = 'Nvidia (official open kernel module, for newer GPUs, Turing+)'
NvidiaOpenSource = 'Nvidia (open-source nouveau driver)'
NvidiaProprietary = 'Nvidia (proprietary)'
VMOpenSource = 'VirtualBox (open-source)'

def is_nvidia(self) -> bool:
def has_dkms_variant(self) -> bool:
match self:
case GfxDriver.NvidiaProprietary | GfxDriver.NvidiaOpenSource | GfxDriver.NvidiaOpenKernel:
case GfxDriver.Nvidia:
return True
case _:
return False
Expand Down Expand Up @@ -112,10 +111,9 @@ def gfx_packages(self) -> list[GfxPackage]:
GfxPackage.IntelMediaDriver,
GfxPackage.VulkanIntel,
]
case GfxDriver.NvidiaOpenKernel:
case GfxDriver.Nvidia:
packages += [
GfxPackage.NvidiaOpenDkms,
GfxPackage.Dkms,
GfxPackage.Nvidia,
GfxPackage.LibvaNvidiaDriver,
]
case GfxDriver.NvidiaOpenSource:
Expand All @@ -125,12 +123,6 @@ def gfx_packages(self) -> list[GfxPackage]:
GfxPackage.LibvaMesaDriver,
GfxPackage.VulkanNouveau,
]
case GfxDriver.NvidiaProprietary:
packages += [
GfxPackage.NvidiaDkms,
GfxPackage.Dkms,
GfxPackage.LibvaNvidiaDriver,
]
case GfxDriver.VMOpenSource:
packages += [
GfxPackage.Mesa,
Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/interactions/system_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def select_driver(options: list[GfxDriver] = [], preset: GfxDriver | None = None
if SysInfo.has_intel_graphics():
header += tr('For the best compatibility with your Intel hardware, you may want to use either the all open-source or Intel options.\n')
if SysInfo.has_nvidia_graphics():
header += tr('For the best compatibility with your Nvidia hardware, you may want to use the Nvidia proprietary driver.\n')
header += tr('For the best compatibility with your NVIDIA hardware, you may want to use the official NVIDIA driver.\n')

result = SelectMenu[GfxDriver](
group,
Expand Down
38 changes: 34 additions & 4 deletions archinstall/lib/models/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,40 @@ def json(self) -> _ProfileConfigurationSerialization:

return {
'profile': profile_handler.to_json(self.profile),
'gfx_driver': self.gfx_driver.value if self.gfx_driver else None,
'greeter': self.greeter.value if self.greeter else None,
'gfx_driver': self.gfx_driver.name if self.gfx_driver else None,
'greeter': self.greeter.name if self.greeter else None,
}

@staticmethod
def _parse_gfx_driver(value: str) -> GfxDriver:
"""Parse graphics driver with backwards compatibility for old configs."""
# Mapping for deprecated driver values to new enum members
deprecated_map = {
'Nvidia (proprietary)': GfxDriver.Nvidia,
'Nvidia (open kernel module for newer GPUs, Turing+)': GfxDriver.Nvidia,
}

# Try deprecated value mapping first
if value in deprecated_map:
return deprecated_map[value]

# Try parsing as enum name (new format)
try:
return GfxDriver[value]
except KeyError:
# Fall back to enum value (old format)
return GfxDriver(value)

@staticmethod
def _parse_greeter(value: str) -> GreeterType:
"""Parse greeter with backwards compatibility for old configs."""
# Try parsing as enum name (new format)
try:
return GreeterType[value]
except KeyError:
# Fall back to enum value (old format)
return GreeterType(value)

@classmethod
def parse_arg(cls, arg: _ProfileConfigurationSerialization) -> 'ProfileConfiguration':
from ..profile.profiles_handler import profile_handler
Expand All @@ -42,6 +72,6 @@ def parse_arg(cls, arg: _ProfileConfigurationSerialization) -> 'ProfileConfigura

return ProfileConfiguration(
profile,
GfxDriver(gfx_driver) if gfx_driver else None,
GreeterType(greeter) if greeter else None,
cls._parse_gfx_driver(gfx_driver) if gfx_driver else None,
cls._parse_greeter(greeter) if greeter else None,
)
6 changes: 4 additions & 2 deletions archinstall/lib/profile/profile_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ def _select_gfx_driver(self, preset: GfxDriver | None = None) -> GfxDriver | Non
driver = select_driver(preset=preset)

if driver and 'Sway' in profile.current_selection_names():
if driver.is_nvidia():
header = tr('The proprietary Nvidia driver is not supported by Sway.') + '\n'
# Sway only cares about the official NVIDIA driver in this situation
# see: https://github.com/swaywm/sway/blob/238f0d4a8b399f0df6791c47eb54c8636722d5a9/sway/server.c#L165
if driver == GfxDriver.Nvidia:
header = tr('The official NVIDIA driver is not supported by Sway.') + '\n'
header += tr('It is likely that you will run into issues, are you okay with that?') + '\n'

group = MenuItemGroup.yes_no()
Expand Down
20 changes: 16 additions & 4 deletions archinstall/lib/profile/profiles_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from archinstall.lib.translationhandler import tr

from ...default_profiles.profile import GreeterType, Profile
from ..hardware import GfxDriver
from ..hardware import GfxDriver, GfxPackage
from ..models.profile import ProfileConfiguration
from ..networking import fetch_data_from_url, list_interfaces
from ..output import debug, error, info
Expand Down Expand Up @@ -229,12 +229,24 @@ def install_greeter(self, install_session: 'Installer', greeter: GreeterType) ->
def install_gfx_driver(self, install_session: 'Installer', driver: GfxDriver) -> None:
debug(f'Installing GFX driver: {driver.value}')

if driver in [GfxDriver.NvidiaOpenKernel, GfxDriver.NvidiaProprietary]:
driver_pkgs = driver.gfx_packages()
# All non-standard kernel packages have a '-' in their name.
# ex: 'linux-zen' and 'linux-lts'
is_dkms_needed = any('-' in s for s in install_session.kernels)

if driver.has_dkms_variant() and is_dkms_needed:
debug(f'A non-standard kernel was selected, installing DKMS variant of {driver.value}')

headers = [f'{kernel}-headers' for kernel in install_session.kernels]
# Fixes https://github.com/archlinux/archinstall/issues/585
install_session.add_additional_packages(headers)

driver_pkgs = driver.gfx_packages()
driver_pkgs.append(GfxPackage.Dkms)

match driver:
case GfxDriver.Nvidia:
driver_pkgs.remove(GfxPackage.Nvidia)
driver_pkgs.append(GfxPackage.NvidiaDkms)

pkg_names = [p.value for p in driver_pkgs]
install_session.add_additional_packages(pkg_names)

Expand Down
8 changes: 4 additions & 4 deletions archinstall/locales/base.pot
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ msgid ""
msgstr ""

msgid ""
"For the best compatibility with your Nvidia hardware, you may want to use "
"the Nvidia proprietary driver.\n"
"For the best compatibility with your NVIDIA hardware, you may want to use "
"the official NVIDIA driver.\n"
msgstr ""

msgid ""
Expand Down Expand Up @@ -1054,7 +1054,7 @@ msgid "Environment type: {}"
msgstr ""

msgid ""
"The proprietary Nvidia driver is not supported by Sway. It is likely that "
"The official NVIDIA driver is not supported by Sway. It is likely that "
"you will run into issues, are you okay with that?"
msgstr ""

Expand Down Expand Up @@ -1491,7 +1491,7 @@ msgstr ""
msgid "Info"
msgstr ""

msgid "The proprietary Nvidia driver is not supported by Sway."
msgid "The official NVIDIA driver is not supported by Sway."
msgstr ""

msgid "It is likely that you will run into issues, are you okay with that?"
Expand Down
4 changes: 2 additions & 2 deletions tests/data/test_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@
],
"parallel_downloads": 66,
"profile_config": {
"gfx_driver": "All open-source",
"greeter": "lightdm-gtk-greeter",
"gfx_driver": "AllOpenSource",
"greeter": "Lightdm",
"profile": {
"custom_settings": {
"Hyprland": {
Expand Down