347 lines
7.0 KiB
Markdown
347 lines
7.0 KiB
Markdown
# Mesa-Git Anleitung
|
||
|
||
Erklärung und Nutzung von Mesa-Git in diesem NixOS-Gaming-Setup.
|
||
|
||
---
|
||
|
||
## Was ist Mesa-Git?
|
||
|
||
**Mesa** ist die Open-Source-Grafikbibliothek für Linux (OpenGL, Vulkan, etc.).
|
||
|
||
**Mesa-Git** ist die **neueste Entwicklungsversion** von Mesa, die über **Chaotic-Nyx** bereitgestellt wird:
|
||
- Jeden Tag neue Commits aus dem Mesa-Repository
|
||
- Neueste GPU-Treiber-Optimierungen
|
||
- Neue Features für aktuelle Spiele
|
||
- **Warnung**: Manchmal instabil, kann Bugs haben
|
||
|
||
---
|
||
|
||
## Warum ist Mesa-Git in dieser Config?
|
||
|
||
Dieses Template fokussiert auf **Gaming mit modernen GPUs**. Mesa-Git bietet:
|
||
|
||
✅ **Vorteile:**
|
||
- Bessere Performance in neuen Spielen
|
||
- Support für neuere GPUs
|
||
- Schnellere Fixes für GPU-Bugs
|
||
- Cutting-Edge Vulkan/OpenGL Features
|
||
|
||
⚠️ **Nachteile:**
|
||
- Manchmal unstabil
|
||
- Kann seltene Crashes verursachen
|
||
- Weniger getestet als stabile Mesa-Versionen
|
||
|
||
---
|
||
|
||
## Wie ist Mesa-Git konfiguriert?
|
||
|
||
Die Aktivierung passiert in zwei Dateien:
|
||
|
||
### 1. `flake.nix` – Chaotic-Nyx einbinden
|
||
|
||
```nix
|
||
inputs = {
|
||
chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
|
||
};
|
||
|
||
nixConfig = {
|
||
extra-substituters = [
|
||
"https://nyx-cache.chaotic.cx/"
|
||
];
|
||
extra-trusted-public-keys = [
|
||
"nyx-cache.chaotic.cx:dJxTrgMC3V3cFfyIiBQDQorG6k1LsqurH/srpMSq7qk="
|
||
];
|
||
};
|
||
```
|
||
|
||
**Was das macht:**
|
||
- Lädt Chaotic-Nyx als Input
|
||
- Nutzt Chaotic-Nyx Cache (schnellere Builds)
|
||
- Trusted key für Binär-Cache
|
||
|
||
### 2. `modules/chaotic-nyx.nix` – Mesa-Git aktivieren
|
||
|
||
```nix
|
||
{ pkgs, ... }:
|
||
|
||
{
|
||
nixpkgs.config.allowUnfree = true;
|
||
|
||
chaotic = {
|
||
mesa-git = {
|
||
enable = true;
|
||
fallbackSpecialisation = true;
|
||
};
|
||
};
|
||
|
||
environment.systemPackages = with pkgs; [
|
||
mesa_git
|
||
];
|
||
}
|
||
```
|
||
|
||
**Was das macht:**
|
||
- `enable = true` – Aktiviert Mesa-Git
|
||
- `fallbackSpecialisation = true` – **Wichtig!** Falls Mesa-Git crasht, bootet automatisch auf stabile Mesa zurück
|
||
- `allowUnfree = true` – Erlaubt Pakete, die nicht frei sind (oft nötig für Gaming)
|
||
- `mesa_git` wird als Systempaket installiert
|
||
|
||
---
|
||
|
||
## Mesa-Git ein/ausschalten
|
||
|
||
### Mesa-Git aktivieren (Standard)
|
||
|
||
Die Config ist bereits aktiviert. Falls du es deaktiviert hattest:
|
||
|
||
**In `modules/chaotic-nyx.nix`:**
|
||
```nix
|
||
chaotic = {
|
||
mesa-git = {
|
||
enable = true; # ← Mesa-Git an
|
||
fallbackSpecialisation = true;
|
||
};
|
||
};
|
||
```
|
||
|
||
**Rebuild:**
|
||
```bash
|
||
sudo nixos-rebuild switch --flake .#template
|
||
```
|
||
|
||
### Mesa-Git deaktivieren (Fallback auf stabile Mesa)
|
||
|
||
Wenn Mesa-Git Probleme macht:
|
||
|
||
**In `modules/chaotic-nyx.nix`:**
|
||
```nix
|
||
chaotic = {
|
||
mesa-git = {
|
||
enable = false; # ← Mesa-Git aus
|
||
fallbackSpecialisation = true;
|
||
};
|
||
};
|
||
```
|
||
|
||
**Rebuild:**
|
||
```bash
|
||
sudo nixos-rebuild switch --flake .#template
|
||
```
|
||
|
||
---
|
||
|
||
## Fallback-Specialisation
|
||
|
||
**Was ist das?**
|
||
|
||
`fallbackSpecialisation = true` bedeutet:
|
||
- NixOS erstellt zwei Kernel-Boot-Optionen
|
||
- Option 1: **Deine aktuelle Config** (mit Mesa-Git)
|
||
- Option 2: **Fallback** (ohne Mesa-Git, stabile Mesa)
|
||
|
||
**Wenn Mesa-Git crasht:**
|
||
1. Du siehst beim Boot das Grub-Menü
|
||
2. Wähle die Fallback-Specialisation (normalerweise unten)
|
||
3. System bootet mit stabiler Mesa
|
||
|
||
**Danach:**
|
||
```bash
|
||
# Deaktiviere Mesa-Git in der Config
|
||
nano modules/chaotic-nyx.nix
|
||
# enable = false;
|
||
sudo nixos-rebuild switch --flake .#template
|
||
```
|
||
|
||
---
|
||
|
||
## Welche GPU braucht Mesa-Git?
|
||
|
||
### ✅ AMD-GPUs (empfohlen für Mesa-Git)
|
||
|
||
Mesa-Git funktioniert sehr gut mit:
|
||
- RDNA (RX 5000er, 6000er, 7000er)
|
||
- RDNA2 (RX 6000er)
|
||
- RDNA3 (RX 7000er)
|
||
|
||
**Empfehlung:** `mesa-amd.nix` + `mesa-git.enable = true` = perfekt für AMD Gaming
|
||
|
||
### ⚠️ Intel iGPU
|
||
|
||
Mesa-Git unterstützt Intel-GPUs, kann aber:
|
||
- Manchmal unstabil sein
|
||
- Performance-Probleme haben
|
||
- Nicht empfohlen für Gaming
|
||
|
||
### ❌ NVIDIA-GPUs
|
||
|
||
**NVIDIA nutzt NICHT Mesa!** NVIDIA nutzt proprietäre Treiber:
|
||
- `nvidia.nix` – proprietäre Treiber (unabhängig von Mesa)
|
||
- `nvidia-open.nix` – Open-Source Treiber (auch nicht Mesa)
|
||
|
||
Mesa-Git ist bei NVIDIA irrelevant.
|
||
|
||
---
|
||
|
||
## Performance-Unterschiede
|
||
|
||
### Mit Mesa-Git
|
||
|
||
```bash
|
||
# Glmark2 Score (höher = besser):
|
||
# RX 6700 XT: ~3500 (mit Mesa-Git)
|
||
```
|
||
|
||
**Vorteile:**
|
||
- 5-15% bessere Performance in neuen Spielen
|
||
- Support für neuere Spiele-Features
|
||
- Bessere Vulkan-Optimierungen
|
||
|
||
### Ohne Mesa-Git (stabile Mesa)
|
||
|
||
```bash
|
||
# Glmark2 Score:
|
||
# RX 6700 XT: ~3200 (ohne Mesa-Git)
|
||
```
|
||
|
||
**Vorteile:**
|
||
- Stabiler
|
||
- Weniger Crashes
|
||
- Langfristig unterstützt
|
||
|
||
---
|
||
|
||
## Troubleshooting
|
||
|
||
### Problem: System bootet nicht nach Mesa-Git Aktivierung
|
||
|
||
**Lösung:**
|
||
1. Beim Boot Grub-Menü öffnen (normalerweise nicht sichtbar, mehrmals ESC drücken)
|
||
2. Wähle die Specialisation mit "fallback" oder älterem Kernel
|
||
3. Nach erfolgreicher Boot:
|
||
```bash
|
||
# Deaktiviere Mesa-Git
|
||
sudo nano /root/nixos-config/modules/chaotic-nyx.nix
|
||
# enable = false;
|
||
sudo nixos-rebuild switch --flake .#template
|
||
```
|
||
|
||
### Problem: Mesa-Git crasht in Spielen
|
||
|
||
**Schritt 1: Fallback-Boot**
|
||
- Grub-Menü → Fallback-Specialisation wählen
|
||
|
||
**Schritt 2: Deaktiviere Mesa-Git**
|
||
```bash
|
||
# In modules/chaotic-nyx.nix
|
||
enable = false;
|
||
sudo nixos-rebuild switch --flake .#template
|
||
```
|
||
|
||
**Schritt 3: Überprüfe GPU-Treiber**
|
||
```bash
|
||
glxinfo | grep "OpenGL version"
|
||
```
|
||
|
||
### Problem: Chaotic-Nyx Cache funktioniert nicht
|
||
|
||
**Lösung:**
|
||
Flake neu bauen (ignoriert Cache):
|
||
```bash
|
||
cd ~/nixos-config
|
||
nix flake update
|
||
sudo nixos-rebuild switch --flake .#template --no-substitute
|
||
```
|
||
|
||
---
|
||
|
||
## Performance testen
|
||
|
||
### Mit Mesa-Git testen
|
||
|
||
Aktiviere Mesa-Git und teste die Performance:
|
||
|
||
```bash
|
||
# Benchmark starten
|
||
glmark2
|
||
|
||
# Spiel-Test
|
||
steam # Starte ein 3D-Spiel
|
||
# In Steam Launch Options: mangohud %command%
|
||
# Schau dir die FPS an
|
||
```
|
||
|
||
### Vergleich: Mit/ohne Mesa-Git
|
||
|
||
**Schritt 1: Mit Mesa-Git**
|
||
```bash
|
||
# modules/chaotic-nyx.nix: enable = true
|
||
sudo nixos-rebuild switch --flake .#template
|
||
glmark2 # Score notieren
|
||
```
|
||
|
||
**Schritt 2: Ohne Mesa-Git**
|
||
```bash
|
||
# modules/chaotic-nyx.nix: enable = false
|
||
sudo nixos-rebuild switch --flake .#template
|
||
glmark2 # Score notieren
|
||
```
|
||
|
||
**Vergleich:** Unterschied ~5-15%
|
||
|
||
---
|
||
|
||
## Chaotic-Nyx Update-Frequenz
|
||
|
||
Mesa-Git wird täglich aktualisiert:
|
||
|
||
```bash
|
||
# Aktualisiere auf neueste Mesa-Git Version
|
||
nix flake update
|
||
sudo nixos-rebuild switch --flake .#template
|
||
```
|
||
|
||
**Häufigkeit:**
|
||
- Täglich neue Commits
|
||
- Wöchentlich getestet
|
||
- Monatlich "major releases"
|
||
|
||
---
|
||
|
||
## Weitere Optionen in Chaotic-Nyx
|
||
|
||
`modules/chaotic-nyx.nix` kann auch enthalten:
|
||
|
||
```nix
|
||
chaotic = {
|
||
mesa-git = {
|
||
enable = true;
|
||
fallbackSpecialisation = true;
|
||
};
|
||
|
||
# Optional: Andere Chaotic-Pakete
|
||
# linux-hardened.enable = true;
|
||
# gamescope.enable = true;
|
||
};
|
||
```
|
||
|
||
Mehr Infos: https://github.com/chaotic-cx/nyx
|
||
|
||
---
|
||
|
||
## Empfehlung
|
||
|
||
| Situation | Empfehlung |
|
||
|-----------|-----------|
|
||
| **Neue AMD-GPU + Gaming** | Mesa-Git aktivieren ✅ |
|
||
| **Alte/Legacy Hardware** | Mesa-Git deaktivieren |
|
||
| **NVIDIA** | Ignorieren (braucht nicht Mesa) |
|
||
| **Stabilität wichtiger als Perf** | Mesa-Git deaktivieren |
|
||
| **Cutting-Edge Gaming** | Mesa-Git aktivieren |
|
||
| **Production/Workstation** | Mesa-Git deaktivieren |
|
||
|
||
---
|
||
|
||
**Kurz:** Mesa-Git = Neueste AMD-GPU-Treiber für Gaming. Gut für Gaming, fallback hilft bei Problemen.
|
||
|
||
Alles klar? 🚀
|