mirror of
https://github.com/furyhawk/home_stack.git
synced 2026-07-21 02:06:47 +00:00
This script allows users to easily enable or disable NVIDIA persistence mode and adjust the performance state of the GPU. It includes options to set the clock speeds and reload the NVIDIA Unified Memory kernel module. Usage instructions are provided for clarity.
18 lines
601 B
Bash
Executable File
18 lines
601 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ "$1" == "on" ]; then
|
|
echo "Turning persistence mode ON and setting performance state..."
|
|
sudo nvidia-smi -pm 1
|
|
sudo nvidia-smi -lgc 1000,2100 # you can adjust clock speed here
|
|
sudo modprobe -r nvidia_uvm && sudo modprobe nvidia_uvm
|
|
echo "Persistence mode is ON."
|
|
elif [ "$1" == "off" ]; then
|
|
echo "Turning persistence mode OFF and resetting performance state..."
|
|
sudo nvidia-smi -pm 0
|
|
sudo nvidia-smi -rgc
|
|
sudo modprobe -r nvidia_uvm && sudo modprobe nvidia_uvm
|
|
echo "Persistence mode is OFF."
|
|
else
|
|
echo "Usage: $0 {on|off}"
|
|
exit 1
|
|
fi |