summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2026-07-14 17:39:42 +0200
committerAhmed Abdelhalim <[email protected]>2026-07-14 17:39:42 +0200
commit108ecc5cfc1d40899c8eb559f0f6600770a73f0c (patch)
treede08c4d0e16684b658ad0243b1589abf65ce9654 /roles
parent4f29b6dd05b4826f7a1df57d70537f2dc8d1d8f8 (diff)
Re-implement gt750 role to just increase performance of nouveau driver
Co-Authored-By: Claude.ai
Diffstat (limited to 'roles')
-rw-r--r--roles/gpu_driver/vars/main.yml4
-rw-r--r--roles/nvidia_gt750m/meta/argument_specs.yml4
-rw-r--r--roles/nvidia_gt750m/meta/main.yml14
-rw-r--r--roles/nvidia_gt750m/tasks/main.yml22
-rw-r--r--roles/nvidia_gt750m/templates/99-nouveau-pstate-gt750m.rules.j214
5 files changed, 56 insertions, 2 deletions
diff --git a/roles/gpu_driver/vars/main.yml b/roles/gpu_driver/vars/main.yml
index 1b6c3993..cf52494e 100644
--- a/roles/gpu_driver/vars/main.yml
+++ b/roles/gpu_driver/vars/main.yml
@@ -2,7 +2,7 @@
gpu_driver_map:
- match: "GeForce GTX 1060"
role: "nvidia_gtx1060"
- # - match: "GeForce GT 750M"
- # role: "nvidia_gt750m"
+ - match: "GeForce GT 750M"
+ role: "nvidia_gt750m"
- match: "VGA compatible controller: Intel"
role: "intel_graphics"
diff --git a/roles/nvidia_gt750m/meta/argument_specs.yml b/roles/nvidia_gt750m/meta/argument_specs.yml
new file mode 100644
index 00000000..5af49897
--- /dev/null
+++ b/roles/nvidia_gt750m/meta/argument_specs.yml
@@ -0,0 +1,4 @@
+---
+argument_specs:
+ main:
+ options: {}
diff --git a/roles/nvidia_gt750m/meta/main.yml b/roles/nvidia_gt750m/meta/main.yml
new file mode 100644
index 00000000..91cb28e7
--- /dev/null
+++ b/roles/nvidia_gt750m/meta/main.yml
@@ -0,0 +1,14 @@
+---
+dependencies: []
+galaxy_info:
+ author: "a14m"
+ description: "Configure NVIDIA GT 750M Mac Edition for optimal performance under nouveau"
+ license: "MIT"
+ min_ansible_version: "2.18"
+ platforms:
+ - name: "ArchLinux"
+ versions:
+ - "all"
+ - name: "Debian"
+ versions:
+ - "all"
diff --git a/roles/nvidia_gt750m/tasks/main.yml b/roles/nvidia_gt750m/tasks/main.yml
new file mode 100644
index 00000000..1a78f985
--- /dev/null
+++ b/roles/nvidia_gt750m/tasks/main.yml
@@ -0,0 +1,22 @@
+---
+# The GT 750M (GK107M, Kepler) runs under the nouveau open-source driver on Linux.
+# Nouveau does not perform automatic GPU reclocking on Kepler — it boots at the
+# lowest power state (AC: ~405 MHz core / ~680 MHz memory) and stays there.
+# This causes severe lag under Wayland compositors (Hyprland) even on simple
+# tasks like switching windows, because the GPU is starved of bandwidth.
+#
+# The fix is to force the highest performance state (0f: 925 MHz core / 5016 MHz
+# memory) via the nouveau DRM pstate sysfs interface. We do this with a udev rule
+# that fires the moment nouveau initializes the GPU's DRM device.
+#
+# We intentionally do NOT install the proprietary nvidia-470xx-dkms driver because:
+# - nvidia-470xx + Wayland/Hyprland on Kepler has documented upstream instability
+# - External monitors are wired to NVIDIA outputs; without a working Wayland stack
+# the setup is unusable
+# - nouveau with forced pstate provides acceptable performance for desktop use
+- name: "Force nouveau pstate to maximum on GT 750M"
+ become: true
+ ansible.builtin.template:
+ src: "99-nouveau-pstate-gt750m.rules.j2"
+ dest: "/etc/udev/rules.d/99-nouveau-pstate-gt750m.rules"
+ mode: "0644"
diff --git a/roles/nvidia_gt750m/templates/99-nouveau-pstate-gt750m.rules.j2 b/roles/nvidia_gt750m/templates/99-nouveau-pstate-gt750m.rules.j2
new file mode 100644
index 00000000..14241a70
--- /dev/null
+++ b/roles/nvidia_gt750m/templates/99-nouveau-pstate-gt750m.rules.j2
@@ -0,0 +1,14 @@
+# Force nouveau GPU performance state to maximum on GT 750M Mac Edition.
+#
+# Nouveau does not reclock Kepler GPUs automatically — the card boots at minimum
+# frequency (~405 MHz core / 680 MHz memory) and stays there, causing severe lag
+# under Wayland compositors. This rule forces pstate 0f (925 MHz core / 5016 MHz
+# memory) the moment nouveau initializes the DRM device.
+#
+# Match is on PCI vendor/device ID (10de:0fe9 = GT 750M Mac Edition) rather than
+# card number, which is not stable across reboots.
+#
+# %k expands to the kernel DRM name (e.g. card0) at rule execution time.
+# The write is deferred via sleep because the sysfs debug interface is not
+# immediately available at the ADD udev event.
+ACTION=="add", SUBSYSTEM=="drm", KERNEL=="card*", ATTR{device/vendor}=="0x10de", ATTR{device/device}=="0x0fe9", RUN+="/bin/sh -c 'sleep 2 && echo 0f > /sys/kernel/debug/dri/%k/pstate'"