Skip to content

Commit 5ea38d2

Browse files
committed
Reduce memory and cpu for vms
1 parent baded15 commit 5ea38d2

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

scripts/start_vm.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ SCRIPTS_DIR=$(realpath $(dirname ${BASH_SOURCE[0]}))
66
ROOT_DIR=$(realpath $SCRIPTS_DIR/..)
77
ARTIFACTS_DIR=$ROOT_DIR/artifacts
88
VM_NAME=${VM_NAME:-secretai-vm}
9-
MEM_SIZE=128G
9+
MEM_SIZE=2G
1010
MAC_ADDRESS=9c:93:4c:b8:fc:e5
1111

1212
qemu-system-x86_64 -D ${VM_NAME}.log \
@@ -19,7 +19,7 @@ qemu-system-x86_64 -D ${VM_NAME}.log \
1919
-bios $ARTIFACTS_DIR/ovmf.fd \
2020
-cdrom $ARTIFACTS_DIR/rootfs.iso \
2121
-drive file=$ARTIFACTS_DIR/encryptedfs.qcow2,if=virtio \
22-
-smp cores=16,threads=2,sockets=2 \
22+
-smp cores=1,threads=1,sockets=1 \
2323
-m ${MEM_SIZE} \
2424
-cpu host \
2525
-object '{"qom-type":"tdx-guest","id":"tdx","quote-generation-socket":{"type": "vsock", "cid":"2","port":"4050"}}' \
@@ -29,7 +29,6 @@ qemu-system-x86_64 -D ${VM_NAME}.log \
2929
-object memory-backend-ram,id=mem0,size=${MEM_SIZE} \
3030
-machine q35,kernel-irqchip=split,confidential-guest-support=tdx,hpet=off,memory-backend=mem0 \
3131
-nodefaults \
32-
-object iommufd,id=iommufd0 \
3332
-device pcie-root-port,id=pci.1,bus=pcie.0 \
3433
-device vhost-vsock-pci,guest-cid=10 \
3534
-fw_cfg name=opt/ovmf/X-PciMmio64,string=262144 \

scripts/start_vm_gpu.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ROOT_DIR=$(realpath $SCRIPTS_DIR/..)
77
ARTIFACTS_DIR=$ROOT_DIR/artifacts
88
VM_NAME=${VM_NAME:-secretai-vm}
99
NVIDIA_DEV_ID=44:00.0
10-
MEM_SIZE=128G
10+
MEM_SIZE=2G
1111
MAC_ADDRESS=9c:93:4c:b8:fc:e5
1212

1313
qemu-system-x86_64 -D ${VM_NAME}.log \
@@ -20,7 +20,7 @@ qemu-system-x86_64 -D ${VM_NAME}.log \
2020
-bios $ARTIFACTS_DIR/ovmf.fd \
2121
-cdrom $ARTIFACTS_DIR/rootfs-gpu.iso \
2222
-drive file=$ARTIFACTS_DIR/encryptedfs.qcow2,if=virtio \
23-
-smp cores=16,threads=2,sockets=2 \
23+
-smp cores=1,threads=1,sockets=1 \
2424
-m ${MEM_SIZE} \
2525
-cpu host \
2626
-object '{"qom-type":"tdx-guest","id":"tdx","quote-generation-socket":{"type": "vsock", "cid":"2","port":"4050"}}' \

0 commit comments

Comments
 (0)