Is there a way to limit the number of CPU cores Bazel uses?

后端 未结 2 789
名媛妹妹
名媛妹妹 2021-02-18 23:47

Is there a way to tell Bazel when building how many CPU cores it can use?

TL;DR

I build TensorFlow on a VMware Workstation and being a virtual machine I can ad

2条回答
  •  梦如初夏
    2021-02-19 00:35

    From Bazel User Manual

    --local_resources availableRAM,availableCPU,availableIO

    This option, which takes three comma-separated floating point arguments, specifies the amount of local resources that Bazel can take into consideration when scheduling build and test activities. Option expects amount of available RAM (in MB), number of CPU cores (with 1.0 representing single full core) and workstation I/O capability (with 1.0 representing average workstation). By default Bazel will estimate amount of RAM and number of CPU cores directly from system configuration and will assume 1.0 I/O resource.

    If this option is used, Bazel will ignore both --ram_utilization_factor.

提交回复
热议问题