So, one of the porpuses of docker is to easily deploy an environment to test software right? Can anybody tell me how to compile a Tensorflow binary to use: SSE4.1, SSE4.2 on a docker file?. Can anybody point me to a docker file that does that? if it is possible at all?
In summary, two questions:
"The purpose of this question is to avoid the following scenario: Where the host setup work but the docker set up doesn't work because Tensorflow was not compiled in a particular way." Like the image below.
The working example of such Dockerfile that can be used as a starting point is there: https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tools/docker (see README.md
for details).
More accurately, it is a set of parameterized Docker files, the build is started with parameterized_docker_build.sh
. An example of a command that successfully compiles TensorFlow inside Docker is:
export TF_DOCKER_BUILD_IS_DEVEL=YES
export TF_DOCKER_BUILD_TYPE=CPU
export TF_DOCKER_BUILD_PYTHON_VERSION=PYTHON3
export TF_DOCKER_BUILD_DEVEL_BRANCH=master
tensorflow/tools/docker/parameterized_docker_build.sh
For the purpose of building TensorFlow with custom flags use TF_DOCKER_BUILD_IS_DEVEL=YES
as non-devel Docker files just downloads precompiled Docker binaries from the server.
TensorFlow team just started to build development Docker images with AVX recently.
For SSE see this question. You can modify bazel command line in your local copy of https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/docker/Dockerfile.devel.
PS. For non-devel TensorFlow build with custom options you could look at https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tools/ci_build.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With