FloopCZ / tensorflow_cc

Build and install TensorFlow C++ API library.
MIT License
761 stars 183 forks source link

make problem : Out of memory #265

Closed hakan6710 closed 3 years ago

hakan6710 commented 3 years ago

Hello,

i would like to suggest a warning in the readme file. I had following output while compiling and the problem that my system ran out of memory:

INFO: Analyzed 2 targets (231 packages loaded, 25551 targets configured). INFO: Found 2 targets... ERROR: /home/fze2/tensorflow_cc/tensorflow_cc/build/tensorflow/tensorflow/compiler/mlir/ tensorflow/BUILD:523:11: C++ compilation of rule '//tensorflow/compiler/mlir/tensorflow:tensorflow_ops' failed (Exit 4): crosstool_wrapper_driver_is_not_gcc failed: error executing command external/local_config_cuda/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -MD -MF bazel-out/host/bin/tensorflow/compiler/mlir/tensorflow/_objs/tensorflow_ops/tf_ops.d ... (remaining 196 argument(s) skipped) x86_64-linux-gnu-gcc-7: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions. INFO: Elapsed time: 1145.477s, Critical Path: 138.38s INFO: 7897 processes: 2456 internal, 5441 local. FAILED: Build did NOT complete successfully CMakeFiles/tensorflow_base.dir/build.make:117: recipe for target 'tensorflow-stamp/tensorflow_base-build' failed make[2]: *** [tensorflow-stamp/tensorflow_base-build] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/tensorflow_base.dir/all' failed make[1]: *** [CMakeFiles/tensorflow_base.dir/all] Error 2 Makefile:129: recipe for target 'all' failed make: *** [all] Error 2

The command ,,dmesg" showed me that cc1plus was killed because the system ran out of memory.

I was able to fix the problem by adding swap memory, which is described here :https://stackoverflow.com/questions/30887143/make-j-8-g-internal-compiler-error-killed-program-cc1plus

Could you add a Warning in your read file, that this problem can exist, so others do not have to find the solution by their own, because it took me a while?

hakan6710 commented 3 years ago

I also tried https://github.com/FloopCZ/tensorflow_cc/pull/256 this. I did not effect the usage of memory. My system has 12 threads and 16gb. The process needed around 26gb of ram.

A description how to configure the cmake or whatever, so that maybe only half of the thread count are used, would maybe be also nice.