Skip to content

Commit 203d171

Browse files
Add limit ram for bazel
1 parent 2ecea45 commit 203d171

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compile_tensorflow_cpp.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Let's compile using bazel `build` rule:
7575
```bash
7676
export CC=gcc
7777
export CXX=g++
78-
bazel build --jobs=4 --local_ram_resources="HOST_MEM*.50" \
78+
bazel build --jobs=4 --local_ram_resources="HOST_RAM*.50" \
7979
--cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0" -c opt \
8080
//tensorflow:libtensorflow.so \
8181
//tensorflow:libtensorflow_cc.so \
@@ -92,7 +92,7 @@ bazel query ...
9292
Note:
9393

9494
1. Building TensorFlow uses a lot of memory, I prefer a small number of CPUs (`--jobs`)
95-
2. Limit RAM requested by bazel with `--local_ram_resources`. The value is either integer, .e.g., `4096` or % of total memory, e.g., 50% `"HOST_MEM*.50"`
95+
2. Limit RAM requested by bazel with `--local_ram_resources`. The value is either integer, .e.g., `4096` or % of total memory, e.g., 50% use `"HOST_RAM*.50"`
9696
3. The whole process can take several hours
9797
4. Add `-D_GLIBCXX_USE_CXX11_ABI=0` if you use GCC 5 or higher
9898
5. Flags for optimization: `--copt="-O3"`

0 commit comments

Comments
 (0)