mirror of
https://github.com/furyhawk/home_stack.git
synced 2026-07-21 02:06:47 +00:00
Add toggle_nvidia.sh script for managing NVIDIA persistence mode and performance state
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.
This commit is contained in:
@@ -9,3 +9,4 @@ frontend/.env
|
||||
# Ignore Python cache files
|
||||
__pycache__/
|
||||
unsloth_compiled_cache/
|
||||
notebooks/lora_model/
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user