Skip to content

Commit

Permalink
[microTVM][RVM] Set the number of cores based on the VM sizing (apach…
Browse files Browse the repository at this point in the history
…e#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 <gustavo.romero@linaro.org>
  • Loading branch information
gromero authored and ylc committed Sep 29, 2021
1 parent 22ac497 commit 3d3840d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion apps/microtvm/reference-vm/zephyr/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 3d3840d

Please sign in to comment.