Skip to content

Instantly share code, notes, and snippets.

@minlaxz
Last active May 23, 2021 19:40
Show Gist options
  • Save minlaxz/43e07a218456099cf85501332f9ce5fe to your computer and use it in GitHub Desktop.
Save minlaxz/43e07a218456099cf85501332f9ce5fe to your computer and use it in GitHub Desktop.
reCompiling TensorFlow

in your host --

cd ~ && mkdir tf && cd $_
curl -fsSL https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/dockerfiles/dockerfiles/devel-gpu-jupyter.Dockerfile -o ./Dockerfile
git clone tensorflow
curl -fsSL https://raw.githubusercontent.com/minlaxz/scripts/master/laxz.bashrc -o ./bash.bashrc
docker build -f ./Dockerfile -t yourRepo/repo:tag .

this Dockerfile will download a bunch of cuda11.0 and cudnn8 libs includes jupyter

In your host --

docker run --name tf --volume $HOME:/tf --gpus all --detach yourBuildImage
docker exec -it tf bash

In Docker Host --

root@docker-host/tf #  `curl -fsSL https://raw.githubusercontent.com/minlaxz/scripts/master/dklaxz -o /usr/bin/dklaxz
root@docker-host/tf # -> make executable /usr/bin/dklaxz
root@docker-host/tf # -> cd mounted/volume/tensorflow
root@docker-host/tf # `bazel build --config=cuda //tensorflow/tools/pip_package:build_pip_package
root@docker-host/tf # `./bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
root@docker-host/tf # `pip install /tmp/tensorflow_pkg/***********.whl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment