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

后端 未结 2 773
名媛妹妹
名媛妹妹 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:13

    some examples for your .bazelrc

    build --local_ram_resources=HOST_RAM*.5 --local_cpu_resources=HOST_CPUS-1 (leave one core free)
    

    or

    build --local_cpu_resources=1 (use a single core)
    

    See https://docs.bazel.build/versions/master/command-line-reference.html#flag--local_cpu_resources

    The currently accepted answer is deprecated.

提交回复
热议问题