Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion install/config/hardware/nvidia.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ if [ -n "$NVIDIA" ]; then

omarchy-pkg-add "$KERNEL_HEADERS" "${PACKAGES[@]}"

# Configure modprobe for early KMS
# Configure modprobe for early KMS and suspend/resume support
sudo tee /etc/modprobe.d/nvidia.conf <<EOF >/dev/null
options nvidia_drm modeset=1
options nvidia NVreg_PreserveVideoMemoryAllocations=1
EOF

# Configure mkinitcpio for early loading
Expand Down
30 changes: 30 additions & 0 deletions migrations/1768012038.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
echo "Add NVIDIA suspend/resume video memory preservation"

# Only apply to systems with NVIDIA GPU
NVIDIA="$(lspci | grep -i 'nvidia')"
if [ -z "$NVIDIA" ]; then
exit 0
fi

NVIDIA_CONF="/etc/modprobe.d/nvidia.conf"

# Check if the config already has the preserve setting
if [ -f "$NVIDIA_CONF" ] && grep -q "NVreg_PreserveVideoMemoryAllocations=1" "$NVIDIA_CONF"; then
echo "NVIDIA video memory preservation already configured"
exit 0
fi

# Add or update the nvidia.conf file
sudo tee "$NVIDIA_CONF" <<EOF >/dev/null
options nvidia_drm modeset=1
options nvidia NVreg_PreserveVideoMemoryAllocations=1
EOF

echo "Regenerating initramfs..."
if omarchy-cmd-present limine-update; then
sudo limine-update
elif command -v mkinitcpio &>/dev/null; then
sudo mkinitcpio -P
fi

omarchy-state set reboot-required