Browse Source

various improvements

master
Cole Deck 1 year ago
parent
commit
c36a1b9f0e
  1. 5
      ac.sh
  2. 5
      battery.sh
  3. 6
      binddev
  4. 5
      startvm
  5. 5
      startvmrdp
  6. 10
      unbinddev
  7. 8
      vm
  8. 2
      vmrdp

5
ac.sh

@ -9,6 +9,7 @@ echo 1 | sudo tee /sys/devices/system/cpu/cpu12/online
echo 1 | sudo tee /sys/devices/system/cpu/cpu13/online
echo 1 | sudo tee /sys/devices/system/cpu/cpu14/online
echo 1 | sudo tee /sys/devices/system/cpu/cpu15/online
asusctl profile normal
sudo systemctl restart auto-cpufreq
sleep 0.5
sudo tlp start
#sudo tlp start
asusctl profile normal

5
battery.sh

@ -9,8 +9,9 @@ echo 0 | sudo tee /sys/devices/system/cpu/cpu13/online
echo 0 | sudo tee /sys/devices/system/cpu/cpu14/online
echo 0 | sudo tee /sys/devices/system/cpu/cpu15/online
xrandr --output eDP --mode 1920x1080 --rate 60
sudo ryzenadj --max-gfxclk=800 --stapm-limit=5000
#sudo ryzenadj --max-gfxclk=800 --stapm-limit=5000
#sudo tlp start
#sudo sh -c 'echo "\\_SB.PCI0.GPP0.PG00._OFF" > /proc/acpi/call'
#./gpuoff.sh
sleep 0.5; echo "ON" | sudo tee /proc/acpi/bbswitch; sleep 1; echo "OFF" | sudo tee /proc/acpi/bbswitch
#sleep 0.5; echo "ON" | sudo tee /proc/acpi/bbswitch; sleep 1; echo "OFF" | sudo tee /proc/acpi/bbswitch
sudo systemctl restart auto-cpufreq

6
binddev

@ -6,9 +6,9 @@ for dev in "$@"; do
echo $vendor $device > /sys/bus/pci/drivers/vfio-pci/new_id
if [ -e /sys/bus/pci/devices/$dev/driver ]; then
#echo $dev > /sys/bus/pci/devices/$dev/driver/unbind
#rmmod nvidia_drm
#rmmod nvidia_modeset
#rmmod nvidia
rmmod nvidia_drm
rmmod nvidia_modeset
rmmod nvidia
echo $dev > /sys/bus/pci/devices/$dev/driver/unbind
echo "Unbound old driver"
fi

5
startvm

@ -2,9 +2,10 @@
#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
cd /home/cole/g14gpu
#if [ `which-driver-for-gpu` == "nvidia" ]; then
sudo sh -c 'echo "ON" > /proc/acpi/bbswitch'
#sudo sh -c 'echo "ON" > /proc/acpi/bbswitch'
echo 1 | sudo tee /sys/bus/pci/devices/0000:00:01.0/rescan
sleep 1
sudo binddev 0000:01:00.0
sudo binddev 0000:01:00.0 0000:01:00.1 0000:01:00.2 0000:01:00.3
#fi
vm
#sudo unbinddev 0000:01:00.0 0000:01:00.1 0000:01:00.2 0000:01:00.3

5
startvmrdp

@ -2,9 +2,10 @@
#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
cd /home/cole/g14gpu
#if [ `which-driver-for-gpu` == "nvidia" ]; then
sudo sh -c 'echo "ON" > /proc/acpi/bbswitch'
#sudo sh -c 'echo "ON" > /proc/acpi/bbswitch'
echo 1 | sudo tee /sys/bus/pci/rescan
sleep 1
sudo binddev 0000:01:00.0
sudo binddev 0000:01:00.0 0000:01:00.1 0000:01:00.2 0000:01:00.3
#fi
vmrdp
#sudo unbinddev 0000:01:00.0 0000:01:00.1 0000:01:00.2 0000:01:00.3

10
unbinddev

@ -11,10 +11,10 @@ for dev in "$@"; do
while [[ -e "/sys/bus/pci/devices/${dev}" ]]; do
sleep 0.1
done
echo "Rescanning..."
echo 1 | sudo tee /sys/bus/pci/rescan
while [[ ! -e "/sys/bus/pci/devices/${dev}" ]]; do
sleep 0.1
done
#echo "Rescanning..."
#echo 1 | sudo tee /sys/bus/pci/rescan
#while [[ ! -e "/sys/bus/pci/devices/${dev}" ]]; do
# sleep 0.1
#done
done
sudo rmmod vfio-pci

8
vm

@ -13,8 +13,8 @@ echo "Starting Scream"
scream -o pulse -i virbr0 &
echo "Starting Looking Glass"
#looking-glass-client -s no -d yes -g egl -a -M no egl:vsync yes &
#looking-glass-client -s -d -g egl -a -M -K 120 &
looking-glass-client -g egl -j -m 283 -S egl:vsync &
looking-glass-client -d -g egl -a -K 120 -j -m 69 -S &
#looking-glass-client -g egl -j -m 283 -S egl:vsync &
while [ "$command" != "stop" ]; do
if jobs | grep looking | grep Running; then
read command
@ -39,11 +39,11 @@ echo "VM is off"
echo "Freeing up memory"
echo 0 | sudo tee /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
echo "Unbinding from vfio-pci"
unbinddev 0000:01:00.0
unbinddev 0000:01:00.0 0000:01:00.1 0000:01:00.2 0000:01:00.3
sleep 1
echo "Enabling GPU power management"
#sudo modprobe nvidia NVreg_DynamicPowerManagement=0x02
sudo sh -c 'echo "OFF" > /proc/acpi/bbswitch'
#sudo sh -c 'echo "OFF" > /proc/acpi/bbswitch'
sleep 2
#sudo systemctl start bumblebeed
sudo systemctl stop smb nmb

2
vmrdp

@ -17,7 +17,7 @@ remmina &
#looking-glass-client -s -d -g egl -a -M -K 120 &
#looking-glass-client -g egl -j -m 283 -S egl:vsync &
while [ "$command" != "stop" ]; do
if jobs | grep looking | grep Running; then
if jobs | grep remmina | grep Running; then
read command
else
#looking-glass-client -d -g egl -a -K 120 -j -m 69 -S &

Loading…
Cancel
Save

Proudly self-hosted by Cole Deck. Fast loading powered by Turbo.