From 3d3840d46bcb0b8d71544e928b387c2bdf96fd5b Mon Sep 17 00:00:00 2001 From: Gustavo Romero Date: Tue, 3 Aug 2021 16:31:50 -0300 Subject: [PATCH] [microTVM][RVM] Set the number of cores based on the VM sizing (#8624) Set the number of cores for scripts and builds that run inside the RVM based on the specified number of cores for the VM. Currently Vagrant doesn't set env. variable TVM_CI_NUM_CORES with the number of cores available in the VM created by Vagrant, as a consequence the scripts and builds (like the ones used to build TVM and QEMU) that run inside the VM after it is created will use the default number of only 2 CPUs, so not using the full CPU resources available in the VM, in case there are more than 2 cores available. This commit sets TVM_CI_NUM_CORES equal to the number of cores available in the VM created by Vagrant so the builds (which use that environment variable to find out the number of CPUs that must be used for the builds) can use all the CPUs available, speeding up the builds. Signed-off-by: Gustavo Romero --- apps/microtvm/reference-vm/zephyr/Vagrantfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/microtvm/reference-vm/zephyr/Vagrantfile b/apps/microtvm/reference-vm/zephyr/Vagrantfile index bd0094fcec66..28339dc0a6d9 100644 --- a/apps/microtvm/reference-vm/zephyr/Vagrantfile +++ b/apps/microtvm/reference-vm/zephyr/Vagrantfile @@ -46,7 +46,12 @@ Vagrant.configure("2") do |config| end end - config.vm.provision "shell", path: "provision_setup.sh", env: {"TVM_HOME": dirs_to_mount[0]}, privileged: false + config.vm.provision "shell", + path: "provision_setup.sh", + env: {"TVM_HOME": dirs_to_mount[0], + "TVM_CI_NUM_CORES": num_cores + }, + privileged: false # Enable USB Controller on VirtualBox vm_name = "microtvm-#{Time.now.tv_sec}"