🐜 fix(runner): Improve NVIDIA driver handling, switch to gamescope (#279)

## Description
- Made it so failed NVIDIA driver install won't quit entrypoint script
if other GPU vendors are present (fixes mixed GPU cases).
- Switch to gamescope as compositor, with optional SYS_NICE cap handling
for higher priority.
- Use mangohud preset 2 for stats, which is more compact.
- Fixes to nestri-server lspci regex, to deal with AMD naming scheme.
- Added missing radeon vulkan driver packages.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
	- Added support for additional AMD Vulkan drivers.
- Integrated Steam launch directly within the gamescope compositor for a
streamlined startup.

- **Bug Fixes**
- Improved GPU driver fallback handling to ensure smoother operation on
systems without NVIDIA GPUs.
	- Enhanced PCI device parsing for more accurate GPU detection.

- **Chores**
- Updated environment configuration to use X11 session type and set
MangoHud preset.
- Removed unused packages and legacy compositor/resolution management
logic.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: DatCaptainHorse <DatCaptainHorse@users.noreply.github.com>
This commit is contained in:
Kristian Ollikainen
2025-05-17 04:19:00 +03:00
committed by GitHub
parent 80deb82d25
commit baf178afc5
5 changed files with 64 additions and 93 deletions

View File

@@ -141,26 +141,60 @@ main() {
if [[ -z "$nvidia_driver_version" ]]; then
log "Error: Failed to determine NVIDIA driver version."
exit 1
# Check for other GPU vendors before exiting
if [[ -n "${vendor_devices[amd]:-}" || -n "${vendor_devices[intel]:-}" ]]; then
log "Other GPUs (AMD or Intel) detected, continuing without NVIDIA driver."
else
log "No other GPUs detected, exiting due to NVIDIA driver version failure."
exit 1
fi
else
log "Detected NVIDIA driver version: $nvidia_driver_version"
# Set up cache and get installer
setup_cache
local arch=$(uname -m)
local filename="NVIDIA-Linux-${arch}-${nvidia_driver_version}.run"
cd "$NVIDIA_INSTALLER_DIR" || {
log "Error: Failed to change to $NVIDIA_INSTALLER_DIR."
exit 1
}
get_nvidia_installer "$nvidia_driver_version" "$arch" || {
# Check for other GPU vendors before exiting
if [[ -n "${vendor_devices[amd]:-}" || -n "${vendor_devices[intel]:-}" ]]; then
log "Other GPUs (AMD or Intel) detected, continuing without NVIDIA driver."
else
log "No other GPUs detected, exiting due to NVIDIA installer failure."
exit 1
fi
}
# Install driver
install_nvidia_driver "$filename" || {
# Check for other GPU vendors before exiting
if [[ -n "${vendor_devices[amd]:-}" || -n "${vendor_devices[intel]:-}" ]]; then
log "Other GPUs (AMD or Intel) detected, continuing without NVIDIA driver."
else
log "No other GPUs detected, exiting due to NVIDIA driver installation failure."
exit 1
fi
}
fi
log "Detected NVIDIA driver version: $nvidia_driver_version"
# Set up cache and get installer
setup_cache
local arch=$(uname -m)
local filename="NVIDIA-Linux-${arch}-${nvidia_driver_version}.run"
cd "$NVIDIA_INSTALLER_DIR" || {
log "Error: Failed to change to $NVIDIA_INSTALLER_DIR."
exit 1
}
get_nvidia_installer "$nvidia_driver_version" "$arch" || exit 1
# Install driver
install_nvidia_driver "$filename" || exit 1
else
log "No NVIDIA GPU detected, skipping driver fix."
fi
# Make sure gamescope has CAP_SYS_NICE capabilities if available
log "Checking for CAP_SYS_NICE availability..."
if capsh --print | grep -q "Current:.*cap_sys_nice"; then
log "Giving gamescope compositor CAP_SYS_NICE permissions..."
setcap 'CAP_SYS_NICE+eip' /usr/bin/gamescope 2>/dev/null || {
log "Warning: Failed to set CAP_SYS_NICE on gamescope, continuing without it..."
}
else
log "Skipping CAP_SYS_NICE for gamescope, capability not available..."
fi
# Switch to nestri user
log "Switching to nestri user for application startup..."
if [[ ! -x /etc/nestri/entrypoint_nestri.sh ]]; then