Skip to content

Commit d30e4ef

Browse files
authored
[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 <[email protected]>
1 parent 4b9d43e commit d30e4ef

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

apps/microtvm/reference-vm/zephyr/Vagrantfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@ Vagrant.configure("2") do |config|
4646
end
4747
end
4848

49-
config.vm.provision "shell", path: "provision_setup.sh", env: {"TVM_HOME": dirs_to_mount[0]}, privileged: false
49+
config.vm.provision "shell",
50+
path: "provision_setup.sh",
51+
env: {"TVM_HOME": dirs_to_mount[0],
52+
"TVM_CI_NUM_CORES": num_cores
53+
},
54+
privileged: false
5055

5156
# Enable USB Controller on VirtualBox
5257
vm_name = "microtvm-#{Time.now.tv_sec}"

0 commit comments

Comments
 (0)