From 2d35d8e272b4d5725c686be5d2b4436a55fe8141 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Sat, 11 Jan 2025 12:40:33 -0500 Subject: Update libvirt configs, laptop theme --- hosts/iroha/libvirt/hooks/arcade.conf | 7 +- hosts/iroha/libvirt/hooks/cpuset.conf | 4 +- hosts/iroha/libvirt/hooks/cpuset_release_common.sh | 1 + .../arcade/prepare/begin/cpuset_prepare_common.sh | 1 - .../qemu.d/arcade/prepare/begin/port_forward.sh | 14 -- .../arcade/release/end/cpuset_release_common.sh | 1 - .../hooks/qemu.d/arcade/release/end/port_close.sh | 14 -- .../hooks/qemu.d/corpa/prepare/begin/bind_vfio.sh | 16 ++ .../hooks/qemu.d/corpa/release/end/unbind_vfio.sh | 16 ++ hosts/iroha/libvirt/qemu/arcade.xml | 90 ++++---- hosts/iroha/libvirt/qemu/corpa-nogpu.xml | 237 +++++++++++++++++++++ hosts/iroha/libvirt/qemu/corpa.xml | 119 +++++------ hosts/iroha/libvirt/qemu/soy.xml | 7 - hosts/iroha/libvirt/qemu/xp.xml | 11 +- 14 files changed, 383 insertions(+), 155 deletions(-) delete mode 120000 hosts/iroha/libvirt/hooks/qemu.d/arcade/prepare/begin/cpuset_prepare_common.sh delete mode 100755 hosts/iroha/libvirt/hooks/qemu.d/arcade/prepare/begin/port_forward.sh delete mode 120000 hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/cpuset_release_common.sh delete mode 100755 hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/port_close.sh create mode 100755 hosts/iroha/libvirt/hooks/qemu.d/corpa/prepare/begin/bind_vfio.sh create mode 100755 hosts/iroha/libvirt/hooks/qemu.d/corpa/release/end/unbind_vfio.sh create mode 100644 hosts/iroha/libvirt/qemu/corpa-nogpu.xml (limited to 'hosts/iroha/libvirt') diff --git a/hosts/iroha/libvirt/hooks/arcade.conf b/hosts/iroha/libvirt/hooks/arcade.conf index 4282629..acbc430 100644 --- a/hosts/iroha/libvirt/hooks/arcade.conf +++ b/hosts/iroha/libvirt/hooks/arcade.conf @@ -1,4 +1,3 @@ -VIRSH_GPU_VIDEO=pci_0000_0f_00_0 -VIRSH_GPU_AUDIO=pci_0000_0f_00_1 -VIRSH_USB=pci_0000_03_00_0 -VIRSH_NVME=pci_0000_0e_00_0 +VIRSH_GPU_VIDEO=pci_0000_10_00_0 +VIRSH_GPU_AUDIO=pci_0000_10_00_1 +VIRSH_USB=pci_0000_12_00_3 diff --git a/hosts/iroha/libvirt/hooks/cpuset.conf b/hosts/iroha/libvirt/hooks/cpuset.conf index d208294..74cb68b 100644 --- a/hosts/iroha/libvirt/hooks/cpuset.conf +++ b/hosts/iroha/libvirt/hooks/cpuset.conf @@ -1,6 +1,6 @@ TOTAL_CORES='0-23' # 3900X: 12-core, 24-thread cpu -HOST_CORES='0-4,12-16' -VIRT_CORES0='5-11,17-23' +HOST_CORES='6-11,18-23' +VIRT_CORES0='0-5,12-17' MEMNODES='0' CPUSET_REFCOUNT=/tmp/cpuset-ref diff --git a/hosts/iroha/libvirt/hooks/cpuset_release_common.sh b/hosts/iroha/libvirt/hooks/cpuset_release_common.sh index 624fa5b..d30a3d6 100755 --- a/hosts/iroha/libvirt/hooks/cpuset_release_common.sh +++ b/hosts/iroha/libvirt/hooks/cpuset_release_common.sh @@ -25,6 +25,7 @@ fi for i in blkio cpu cpuacct cpuset devices freezer memory net_cls perf_event; do rmdir ${CGROUP}/$i/machine/${PARTNAME0}.partition + rmdir ${CGROUP}/$i/machine/${PARTNAME1}.partition done /bin/echo ${TOTAL_CORES} > ${CPUSET}/machine/cpuset.cpus diff --git a/hosts/iroha/libvirt/hooks/qemu.d/arcade/prepare/begin/cpuset_prepare_common.sh b/hosts/iroha/libvirt/hooks/qemu.d/arcade/prepare/begin/cpuset_prepare_common.sh deleted file mode 120000 index fb5a2ab..0000000 --- a/hosts/iroha/libvirt/hooks/qemu.d/arcade/prepare/begin/cpuset_prepare_common.sh +++ /dev/null @@ -1 +0,0 @@ -../../../../cpuset_prepare_common.sh \ No newline at end of file diff --git a/hosts/iroha/libvirt/hooks/qemu.d/arcade/prepare/begin/port_forward.sh b/hosts/iroha/libvirt/hooks/qemu.d/arcade/prepare/begin/port_forward.sh deleted file mode 100755 index 7d5d484..0000000 --- a/hosts/iroha/libvirt/hooks/qemu.d/arcade/prepare/begin/port_forward.sh +++ /dev/null @@ -1,14 +0,0 @@ -#! /usr/bin/env bash - -# kdeconnect -iptables -t nat -C PREROUTING -p tcp -s 192.168.1.0/24 --dport 1714:1764 \ - -j DNAT --to-destination 192.168.122.40:1714-1764 || \ -iptables -t nat -A PREROUTING -p tcp -s 192.168.1.0/24 --dport 1714:1764 \ - -j DNAT --to-destination 192.168.122.40:1714-1764 -iptables -t nat -C PREROUTING -p udp -s 192.168.1.0/24 --dport 1714:1764 \ - -j DNAT --to-destination 192.168.122.40:1714-1764 || \ -iptables -t nat -A PREROUTING -p udp -s 192.168.1.0/24 --dport 1714:1764 \ - -j DNAT --to-destination 192.168.122.40:1714-1764 - -iptables -C FORWARD -m state -d 192.168.122.0/24 --state NEW,RELATED,ESTABLISHED -j ACCEPT || \ -iptables -I FORWARD -m state -d 192.168.122.0/24 --state NEW,RELATED,ESTABLISHED -j ACCEPT diff --git a/hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/cpuset_release_common.sh b/hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/cpuset_release_common.sh deleted file mode 120000 index d823a60..0000000 --- a/hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/cpuset_release_common.sh +++ /dev/null @@ -1 +0,0 @@ -../../../../cpuset_release_common.sh \ No newline at end of file diff --git a/hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/port_close.sh b/hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/port_close.sh deleted file mode 100755 index 0d58fa7..0000000 --- a/hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/port_close.sh +++ /dev/null @@ -1,14 +0,0 @@ -#! /usr/bin/env bash - -# kdeconnect (remove) -iptables -t nat -C PREROUTING -p tcp -s 192.168.1.0/24 --dport 1714:1764 \ - -j DNAT --to-destination 192.168.122.40:1714-1764 || \ -iptables -t nat -D PREROUTING -p tcp -s 192.168.1.0/24 --dport 1714:1764 \ - -j DNAT --to-destination 192.168.122.40:1714-1764 -iptables -t nat -C PREROUTING -p udp -s 192.168.1.0/24 --dport 1714:1764 \ - -j DNAT --to-destination 192.168.122.40:1714-1764 || \ -iptables -t nat -D PREROUTING -p udp -s 192.168.1.0/24 --dport 1714:1764 \ - -j DNAT --to-destination 192.168.122.40:1714-1764 - -iptables -C FORWARD -m state -d 192.168.122.0/24 --state NEW,RELATED,ESTABLISHED -j ACCEPT || \ -iptables -D FORWARD -m state -d 192.168.122.0/24 --state NEW,RELATED,ESTABLISHED -j ACCEPT diff --git a/hosts/iroha/libvirt/hooks/qemu.d/corpa/prepare/begin/bind_vfio.sh b/hosts/iroha/libvirt/hooks/qemu.d/corpa/prepare/begin/bind_vfio.sh new file mode 100755 index 0000000..3c602c5 --- /dev/null +++ b/hosts/iroha/libvirt/hooks/qemu.d/corpa/prepare/begin/bind_vfio.sh @@ -0,0 +1,16 @@ +#! /usr/bin/env bash + +source "/etc/libvirt/hooks/arcade.conf" + +modprobe -r nvidia-drm +modprobe -r nvidia-modeset +modprobe -r nvidia-uvm +modprobe -r nvidia + +modprobe vfio +modprobe vfio_iommu_type1 +modprobe vfio_pci + +virsh nodedev-detach $VIRSH_GPU_VIDEO +virsh nodedev-detach $VIRSH_GPU_AUDIO +virsh nodedev-detach $VIRSH_USB diff --git a/hosts/iroha/libvirt/hooks/qemu.d/corpa/release/end/unbind_vfio.sh b/hosts/iroha/libvirt/hooks/qemu.d/corpa/release/end/unbind_vfio.sh new file mode 100755 index 0000000..e3b1234 --- /dev/null +++ b/hosts/iroha/libvirt/hooks/qemu.d/corpa/release/end/unbind_vfio.sh @@ -0,0 +1,16 @@ +#! /usr/bin/env bash + +source "/etc/libvirt/hooks/arcade.conf" + +virsh nodedev-reattach $VIRSH_GPU_VIDEO +virsh nodedev-reattach $VIRSH_GPU_AUDIO +virsh nodedev-reattach $VIRSH_USB + +modprobe -r vfio_pci +modprobe -r vfio_iommu_type1 +modprobe -r vfio + +modprobe nvidia-drm +modprobe nvidia-modeset +modprobe nvidia-uvm +modprobe nvidia diff --git a/hosts/iroha/libvirt/qemu/arcade.xml b/hosts/iroha/libvirt/qemu/arcade.xml index 79e9216..5280dc9 100644 --- a/hosts/iroha/libvirt/qemu/arcade.xml +++ b/hosts/iroha/libvirt/qemu/arcade.xml @@ -7,7 +7,7 @@ or other application using the libvirt API. arcade - 0ccf2904-b393-41b0-98a6-3c8722efdc94 + ddc28570-735e-0000-0000-000000000000 @@ -15,10 +15,8 @@ or other application using the libvirt API. 16777216 16777216 - - - - 6 + 12 + 1 @@ -26,36 +24,43 @@ or other application using the libvirt API. + + + + + + + + + + + + + + + + + + + + + - hvm + hvm - /usr/share/edk2-ovmf/OVMF_CODE.fd - /var/lib/libvirt/qemu/nvram/arcade_VARS.fd + /usr/share/edk2-ovmf/OVMF_CODE.fd + /var/lib/libvirt/qemu/nvram/arcade_VARS.fd - - - - - - - - - - - - - - - - + + @@ -64,20 +69,21 @@ or other application using the libvirt API. - - + + + - - + + destroy @@ -89,6 +95,14 @@ or other application using the libvirt API. /usr/bin/qemu-system-x86_64 + + + + + WD_BLACK_SN770_1TB_230423802979_1 + +
+ @@ -172,15 +186,12 @@ or other application using the libvirt API.
- -
-
- + - +
@@ -192,26 +203,19 @@ or other application using the libvirt API.