update config

This commit is contained in:
2021-04-02 14:35:35 -05:00
parent 829d5ab694
commit 50783d144f
2 changed files with 51 additions and 51 deletions

20
startvm
View File

@ -15,15 +15,19 @@ sudo mount -o remount /var/lib/libvirt/images/ # remove this if you're not me
echo "Reserving hugepages and some other shit"
echo $HUGEPAGES_MB | sudo tee /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
echo 1 | sudo tee /sys/bus/pci/devices/$MAIN_GPU/rescan
#echo 1 | sudo tee /sys/bus/pci/devices/$MAIN_GPU/rescan
sleep 1
sudo ./binddev $ALL_PARTS
#sudo ./binddev $ALL_PARTS
asusctl graphics -m vfio
#fi
#!/bin/bash
echo 3 | sudo tee /proc/sys/vm/drop_caches
echo 1 | sudo tee /proc/sys/vm/compact_memory
echo 0-15 | sudo tee /sys/fs/cgroup/cpuset/machine.slice/cpuset.cpus
#echo 0-15 | sudo tee /sys/fs/cgroup/cpuset/machine.slice/cpuset.cpus
sudo vfio-isolate cpuset-delete /host.slice cpuset-delete /machine.slice
echo "ERROR ABOVE IS OK"
sudo vfio-isolate cpuset-create --cpus C0-1 /host.slice cpuset-create --cpus C0-15 -nlb /machine.slice move-tasks / /host.slice
echo "Starting Network"
virsh --connect=qemu:///system net-start default
sudo systemctl start smb nmb # comment out if you dont have smb share for linux
@ -33,14 +37,14 @@ virsh --connect=qemu:///system start $VMNAME
echo "Starting Scream"
scream -o pulse -i virbr0 & # scream audio
echo "Starting Looking Glass"
looking-glass-client -d -g egl -a -K $LOOKING_GLASS_FPS -j -m $LOOKING_GLASS_ESCAPE -S &
looking-glass-client -d -g egl -a -j -m $LOOKING_GLASS_ESCAPE -S &
# if looking glass crashes, press enter to restart it. if you want to stop VM, type "stop" (then enter)
while [ "$command" != "stop" ]; do
if jobs | grep looking | grep Running; then
read command
else
looking-glass-client -d -g egl -a -K $LOOKING_GLASS_FPS -j -m $LOOKING_GLASS_ESCAPE -S &
looking-glass-client -d -g egl -a -j -m $LOOKING_GLASS_ESCAPE -S &
fi
done
sudo whoami # regain root access
@ -57,9 +61,11 @@ while [ "$vmstate" != "shut off" ]; do
done
sleep 1
echo "VM is off"
echo "Freeing up memory"
echo "Freeing up memory and CPU"
sudo vfio-isolate cpuset-delete /host.slice cpuset-delete /machine.slice
echo 0 | sudo tee /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
echo "Unbinding from vfio-pci and removing devices"
sudo ./unbinddev $ALL_PARTS
asusctl graphics -m integrated
#sudo ./unbinddev $ALL_PARTS
sudo systemctl stop smb nmb # stop SMB if in use