Add optimus manager and full GPU power off config
parent
43705a276a
commit
705f307a03
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#case "$1" in
|
||||||
|
# pre)
|
||||||
|
# /home/cole/g14gpu/gpuon.sh ;;
|
||||||
|
# post)
|
||||||
|
# /home/cole/g14gpu/gpuoff.sh ;;
|
||||||
|
#esac
|
||||||
|
|
||||||
|
|
||||||
|
if [ "${1}" == "pre" ]; then
|
||||||
|
bash /home/cole/g14gpu/gpuon.sh
|
||||||
|
elif [ "${1}" == "post" ]; then
|
||||||
|
bash /home/cole/g14gpu/gpuoff.sh
|
||||||
|
fi
|
@ -0,0 +1 @@
|
|||||||
|
sudo sh -c 'echo "\\_SB.PCI0.GPP0.PG00._OFF" > /proc/acpi/call'
|
@ -0,0 +1 @@
|
|||||||
|
sudo sh -c 'echo "\\_SB.PCI0.GPP0.PG00._ON" > /proc/acpi/call'
|
@ -0,0 +1,12 @@
|
|||||||
|
[optimus]
|
||||||
|
switching=none
|
||||||
|
pci_power_control=no
|
||||||
|
pci_remove=no
|
||||||
|
pci_reset=no
|
||||||
|
auto_logout=yes
|
||||||
|
startup_mode=amd
|
||||||
|
|
||||||
|
[nvidia]
|
||||||
|
modeset=yes
|
||||||
|
PAT=yes
|
||||||
|
options=overclocking
|
@ -0,0 +1,9 @@
|
|||||||
|
# You can use this file to add Xorg options which are not covered in the configuration file.
|
||||||
|
#
|
||||||
|
# Everything you put here will go to the "Device" section corresponding
|
||||||
|
# to the AMD GPU in the Xorg configuration.
|
||||||
|
# Lines starting with # are ignored.
|
||||||
|
#
|
||||||
|
# Example :
|
||||||
|
#
|
||||||
|
# Option "Backlight" "amdgpu_bl1"
|
@ -0,0 +1,9 @@
|
|||||||
|
# You can use this file to add Xorg options which are not covered in the configuration file.
|
||||||
|
#
|
||||||
|
# Everything you put here will go to the "Device" section corresponding
|
||||||
|
# to the Intel GPU in the Xorg configuration.
|
||||||
|
# Lines starting with # are ignored.
|
||||||
|
#
|
||||||
|
# Example :
|
||||||
|
#
|
||||||
|
# Option "Backlight" "intel_backlight"
|
@ -0,0 +1,9 @@
|
|||||||
|
# You can use this file to add Xorg options which are not covered in the configuration file.
|
||||||
|
#
|
||||||
|
# Everything you put here will go to the "Device" section corresponding
|
||||||
|
# to the Nvidia GPU in the Xorg configuration.
|
||||||
|
# Lines starting with # are ignored.
|
||||||
|
#
|
||||||
|
# Example :
|
||||||
|
#
|
||||||
|
# Option "ConnectToAcpid" "0"
|
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Everything you write here will be executed by the display manager when setting up the login screen in AMD mode.
|
||||||
|
#sudo sh -c 'echo "\\_SB.PCI0.GPP0.PG00._OFF" > /proc/acpi/call'
|
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Everything you write here will be executed by the display manager when setting up the login screen in Intel mode.
|
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Everything you write here will be executed by the display manager when setting up the login screen in Nvidia mode.
|
||||||
|
# (but before optimus-manager sets up PRIME with xrandr commands).
|
||||||
|
#sudo sh -c 'echo "\\_SB.PCI0.GPP0.PG00._ON" > /proc/acpi/call'
|
@ -1,7 +1,24 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
sudo rmmod nvidia_drm
|
#sudo rmmod nvidia_drm
|
||||||
sudo rmmod nvidia_modeset
|
#sudo rmmod nvidia_modeset
|
||||||
sudo rmmod nvidia
|
#sudo rmmod nvidia
|
||||||
sudo tee /proc/acpi/bbswitch <<<OFF
|
#sudo tee /proc/acpi/bbswitch <<<OFF
|
||||||
echo $(cat /proc/acpi/bbswitch)
|
#echo $(cat /proc/acpi/bbswitch)
|
||||||
#sudo sh -c "echo 1 > /sys/bus/pci/devices/0000:01:00.0/remove; echo '\\_SB.PCI0.PEG0.PEGP._OFF' > /proc/acpi/call"
|
#sudo sh -c "echo 1 > /sys/bus/pci/devices/0000:01:00.0/remove; echo '\\_SB.PCI0.PEG0.PEGP._OFF' > /proc/acpi/call"
|
||||||
|
#output=$(optimus-manager --print-mode)
|
||||||
|
#echo $output
|
||||||
|
if [ $(sudo -u cole xrandr --listproviders | grep NVIDIA) ]; then
|
||||||
|
echo "GPU is in use for PRIME, keeping on"
|
||||||
|
else
|
||||||
|
sudo sh -c 'echo "\\_SB.PCI0.GPP0.PG00._OFF" > /proc/acpi/call'
|
||||||
|
echo $(sudo cat /proc/acpi/call)
|
||||||
|
echo "GPU POWERED OFF"
|
||||||
|
fi
|
||||||
|
#if [ "$(optimus-manager --print-mode)" = "
|
||||||
|
#
|
||||||
|
#Current GPU mode : amd" ]; then
|
||||||
|
# sudo sh -c 'echo "\\_SB.PCI0.GPP0.PG00._OFF" > /proc/acpi/call'
|
||||||
|
# echo $(sudo cat /proc/acpi/call)
|
||||||
|
# echo "GPU POWERED OFF"
|
||||||
|
#fi
|
||||||
|
#echo "script finished"
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
if [ `which-driver-for-gpu` == "nvidia" ]; then
|
#export PATH=/bedrock/cross/pin/bin:/bedrock/bin:/usr/local/bin:/usr/local/sbin:/opt/bin:/opt/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/snap/bin:/bedrock/cross/bin:/home/cole/g14gpu
|
||||||
sudo systemctl stop bumblebeed
|
cd /home/cole/g14gpu
|
||||||
sleep 1
|
#if [ `which-driver-for-gpu` == "nvidia" ]; then
|
||||||
sudo bind 0000:01:00.0 0000:01:00.1 0000:01:00.2 0000:01:00.3
|
sudo sh -c 'echo "\\_SB.PCI0.GPP0.PG00._ON" > /proc/acpi/call'
|
||||||
fi
|
sleep 1
|
||||||
|
sudo binddev 0000:01:00.0 0000:01:00.1 0000:01:00.2 0000:01:00.3
|
||||||
|
#fi
|
||||||
vm
|
vm
|
||||||
#sudo unbind 0000:01:00.0 0000:01:00.1 0000:01:00.2 0000:01:00.3
|
#sudo unbinddev 0000:01:00.0 0000:01:00.1 0000:01:00.2 0000:01:00.3
|
||||||
|
@ -1,18 +1,20 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
#sudo rmmod vfio-pci
|
||||||
for dev in "$@"; do
|
for dev in "$@"; do
|
||||||
vendor=$(cat /sys/bus/pci/devices/$dev/vendor)
|
vendor=$(cat /sys/bus/pci/devices/$dev/vendor)
|
||||||
device=$(cat /sys/bus/pci/devices/$dev/device)
|
device=$(cat /sys/bus/pci/devices/$dev/device)
|
||||||
echo "Removing ${dev} from vfio-pci id list"
|
echo "Removing ${dev} from vfio-pci id list"
|
||||||
echo "${vendor} ${device}" > /sys/bus/pci/drivers/vfio-pci/remove_id
|
echo "${vendor} ${device}" | sudo tee /sys/bus/pci/drivers/vfio-pci/remove_id
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
echo "Remove PCI device"
|
echo "Remove PCI device"
|
||||||
echo 1 > /sys/bus/pci/devices/${dev}/remove
|
echo 1 | sudo tee /sys/bus/pci/devices/${dev}/remove
|
||||||
while [[ -e "/sys/bus/pci/devices/${dev}" ]]; do
|
while [[ -e "/sys/bus/pci/devices/${dev}" ]]; do
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
done
|
done
|
||||||
echo "Rescanning..."
|
echo "Rescanning..."
|
||||||
echo 1 > /sys/bus/pci/rescan
|
echo 1 | sudo tee /sys/bus/pci/rescan
|
||||||
while [[ ! -e "/sys/bus/pci/devices/${dev}" ]]; do
|
while [[ ! -e "/sys/bus/pci/devices/${dev}" ]]; do
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
sudo rmmod vfio-pci
|
Loading…
Reference in New Issue