├── .github
└── workflows
│ └── test.yml
├── CITATION.cff
├── LICENSE
├── Makefile
├── README.md
├── docker
├── .Dockerfiles
│ ├── .gitignore
│ ├── 2.11.0
│ │ ├── bashrc
│ │ └── dockerfiles
│ │ │ ├── arm64v8
│ │ │ ├── devel-cpu-arm64v8.Dockerfile
│ │ │ └── devel-gpu-arm64v8.Dockerfile
│ │ │ ├── devel-cpu-ubuntu20.Dockerfile
│ │ │ ├── devel-cpu-ubuntu22.Dockerfile
│ │ │ ├── devel-gpu+cu118-ubuntu20.Dockerfile
│ │ │ └── devel-gpu+cu118-ubuntu22.Dockerfile
│ ├── 2.11.1
│ │ ├── bashrc
│ │ └── dockerfiles
│ │ │ ├── arm64v8
│ │ │ └── devel-cpu-arm64v8.Dockerfile
│ │ │ ├── devel-cpu.Dockerfile
│ │ │ └── devel-gpu.Dockerfile
│ ├── 2.12.0
│ │ ├── bashrc
│ │ └── dockerfiles
│ │ │ ├── arm64v8
│ │ │ └── devel-cpu-arm64v8.Dockerfile
│ │ │ ├── devel-cpu.Dockerfile
│ │ │ └── devel-gpu.Dockerfile
│ ├── 2.12.1
│ │ ├── bashrc
│ │ └── dockerfiles
│ │ │ ├── arm64v8
│ │ │ └── devel-cpu-arm64v8.Dockerfile
│ │ │ ├── devel-cpu.Dockerfile
│ │ │ └── devel-gpu.Dockerfile
│ └── 2.13.0
│ │ ├── bashrc
│ │ └── dockerfiles
│ │ ├── arm64v8
│ │ └── devel-cpu-arm64v8.Dockerfile
│ │ ├── devel-cpu.Dockerfile
│ │ └── devel-gpu.Dockerfile
├── .gitignore
├── DEBIAN
│ └── control
├── Dockerfile
├── cmake
│ └── TensorFlowConfig.cmake
└── patch
│ ├── 2.11.1
│ └── workspace2.bzl.patch
│ ├── 2.12.0
│ └── workspace2.bzl.patch
│ ├── 2.12.1
│ └── workspace2.bzl.patch
│ └── 2.13.0
│ └── workspace2.bzl.patch
├── example
├── .gitignore
├── build-and-run-monolithic.sh
├── build-and-run.sh
└── hello_tensorflow.cpp
├── libtensorflow-cc
└── .gitignore
├── scripts
├── .common.sh
├── .versions.devel.sh
├── .versions.run.sh
├── 0-download-official-dockerfiles.sh
├── 1-build-official-devel-image.sh
├── 2-build-cpp-image.sh
├── 3-export-libtensorflow-cc.sh
├── 4-test-libtensorflow-cc.sh
├── 5-print-versions.sh
└── 6-push-image.sh
└── tensorflow-wheel
└── .gitignore
/.github/workflows/test.yml:
--------------------------------------------------------------------------------
1 | name: Test
2 |
3 | on:
4 | push:
5 |
6 | jobs:
7 | build-and-run:
8 | runs-on: ubuntu-latest
9 | container: rwthika/tensorflow-cc:latest
10 | steps:
11 | - name: Checkout repository
12 | uses: actions/checkout@v3
13 | - name: Build & Run
14 | run: |
15 | cd example
16 | ./build-and-run.sh
17 |
--------------------------------------------------------------------------------
/CITATION.cff:
--------------------------------------------------------------------------------
1 | cff-version: 1.2.0
2 |
3 | title: ika-rwth-aachen/libtensorflow_cc
4 | doi: 10.5281/zenodo.7225836
5 | type: software
6 | repository-code: "https://github.com/ika-rwth-aachen/libtensorflow_cc.git"
7 | authors:
8 | - given-names: Lennart
9 | family-names: Reiher
10 | email: "lennart.reiher@rwth-aachen.de"
11 | affiliation: "Institute for Automotive Engineering (ika), RWTH Aachen University"
12 | orcid: 0000-0002-7309-164X
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 Institute for Automotive Engineering of RWTH Aachen University
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | # ==============================================================================
2 | # MIT License
3 | # Copyright 2022 Institute for Automotive Engineering of RWTH Aachen University.
4 | # Permission is hereby granted, free of charge, to any person obtaining a copy
5 | # of this software and associated documentation files (the "Software"), to deal
6 | # in the Software without restriction, including without limitation the rights
7 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | # copies of the Software, and to permit persons to whom the Software is
9 | # furnished to do so, subject to the following conditions:
10 | # The above copyright notice and this permission notice shall be included in all
11 | # copies or substantial portions of the Software.
12 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18 | # SOFTWARE.
19 | # ==============================================================================
20 |
21 | # === VARIABLES ================================================================
22 |
23 | MAKEFLAGS += --no-print-directory
24 | MAKEFILE_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
25 |
26 | # build architecture
27 | DEFAULT_ARCH := $(shell dpkg --print-architecture 2> /dev/null || uname -m)
28 | ARCH := $(if $(ARCH),$(ARCH),$(DEFAULT_ARCH))
29 |
30 | # defaults
31 | DEFAULT_TF_VERSION := 2.13.0
32 | TF_VERSIONS := 2.13.0 2.12.1 2.12.0 2.11.1 2.11.0 2.10.1 2.10.0 2.9.3 2.9.2 2.9.1 2.9.0 2.8.4 2.8.3 2.8.2 2.8.1 2.8.0 2.7.4 2.7.3 2.7.2 2.7.1 2.7.0 2.6.5 2.6.4 2.6.3 2.6.2 2.6.1 2.6.0 2.5.3 2.5.2 2.5.1 2.5.0 2.4.4 2.4.3 2.4.2 2.4.1 2.4.0 2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.3 2.2.2 2.2.1 2.2.0 2.1.4 2.1.3 2.1.2 2.1.1 2.1.0 2.0.4 2.0.3 2.0.2 2.0.1 2.0.0
33 | DEFAULT_JOBS := $(shell nproc 2> /dev/null || sysctl -n hw.ncpu)
34 | DEFAULT_GPU := 1
35 | ifeq ($(ARCH), arm64)
36 | DEFAULT_TF_CUDA_COMPUTE_CAPABILITIES := 5.3,6.2,7.2,8.7
37 | else
38 | DEFAULT_TF_CUDA_COMPUTE_CAPABILITIES := 6.0,6.1,7.0,7.5,8.0,8.6,8.9,9.0
39 | endif
40 | DEFAULT_BUILD_PIP_PACKAGE := 0
41 |
42 | # arguments
43 | TF_VERSION := $(if $(TF_VERSION),$(TF_VERSION),$(DEFAULT_TF_VERSION))
44 | JOBS := $(if $(JOBS),$(JOBS),$(DEFAULT_JOBS))
45 | GPU := $(if $(GPU),$(GPU),$(DEFAULT_GPU))
46 | TF_CUDA_COMPUTE_CAPABILITIES := $(if $(TF_CUDA_COMPUTE_CAPABILITIES),$(TF_CUDA_COMPUTE_CAPABILITIES),$(DEFAULT_TF_CUDA_COMPUTE_CAPABILITIES))
47 | BUILD_PIP_PACKAGE := $(if $(BUILD_PIP_PACKAGE),$(BUILD_PIP_PACKAGE),$(DEFAULT_BUILD_PIP_PACKAGE))
48 |
49 | # variables
50 | ifeq ($(GPU), 1)
51 | GPU_POSTFIX := -gpu
52 | else
53 | GPU_POSTFIX :=
54 | endif
55 | OFFICIAL_DEVEL_IMAGE := tensorflow/tensorflow:$(TF_VERSION)-devel$(GPU_POSTFIX)
56 | OFFICIAL_DEVEL_IMAGES := tensorflow/tensorflow:*-devel$(GPU_POSTFIX)
57 | CPP_IMAGE := rwthika/tensorflow-cc:$(TF_VERSION)$(GPU_POSTFIX)-$(ARCH)
58 | CPP_IMAGES := rwthika/tensorflow-cc:*
59 | LIBTENSORFLOW_CC_IMAGE := rwthika/tensorflow-cc:$(TF_VERSION)-libtensorflow_cc*
60 | LIBTENSORFLOW_CC_IMAGES := rwthika/tensorflow-cc:*-libtensorflow_cc*
61 |
62 | # === HELPER RULES =============================================================
63 |
64 | .PHONY: help
65 | help:
66 | @LC_ALL=C $(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/(^|\n)# Files(\n|$$)/,/(^|\n)# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'
67 |
68 | # ----- LIST IMAGES ------------------------------------------------------------
69 |
70 | .PHONY: list-official-devel-images
71 | list-official-devel-images:
72 | @docker images --format "{{.Repository}}:{{.Tag}}" --filter=reference="$(OFFICIAL_DEVEL_IMAGES)"
73 |
74 | .PHONY: list-cpp-images
75 | list-cpp-images:
76 | @docker images --format "{{.Repository}}:{{.Tag}}" --filter=reference="$(CPP_IMAGES)"
77 |
78 | .PHONY: list-libtensorflow-cc-images
79 | list-libtensorflow-cc-images:
80 | @docker images --format "{{.Repository}}:{{.Tag}}" --filter=reference="$(LIBTENSORFLOW_CC_IMAGES)"
81 |
82 | .PHONY: list-images
83 | list-images: list-official-devel-images list-cpp-images list-libtensorflow-cc-images
84 |
85 | # ----- CLEAN IMAGES -----------------------------------------------------------
86 |
87 | .PHONY: clean-official-devel-image
88 | clean-official-devel-image:
89 | @docker rmi -f $(shell docker images --format "{{.Repository}}:{{.Tag}}" --filter=reference="$(OFFICIAL_DEVEL_IMAGE)") 2> /dev/null || true
90 |
91 | .PHONY: clean-cpp-image
92 | clean-cpp-image:
93 | @docker rmi -f $(shell docker images --format "{{.Repository}}:{{.Tag}}" --filter=reference="$(CPP_IMAGE)") 2> /dev/null || true
94 |
95 | .PHONY: clean-libtensorflow-cc-image
96 | clean-libtensorflow-cc-image:
97 | @docker rmi -f $(shell docker images --format "{{.Repository}}:{{.Tag}}" --filter=reference="$(LIBTENSORFLOW_CC_IMAGE)") 2> /dev/null || true
98 |
99 | .PHONY: clean-official-devel-images
100 | clean-official-devel-images:
101 | $(foreach TF_VERSION,$(TF_VERSIONS),TF_VERSION=$(TF_VERSION) $(MAKE) clean-official-devel-image;)
102 |
103 | .PHONY: clean-cpp-images
104 | clean-cpp-images:
105 | $(foreach TF_VERSION,$(TF_VERSIONS),TF_VERSION=$(TF_VERSION) $(MAKE) clean-cpp-image;)
106 |
107 | .PHONY: clean-libtensorflow-cc-images
108 | clean-libtensorflow-cc-images:
109 | $(foreach TF_VERSION,$(TF_VERSIONS),TF_VERSION=$(TF_VERSION) $(MAKE) clean-libtensorflow-cc-image;)
110 |
111 | .PHONY: clean-images
112 | clean-images: clean-official-devel-images clean-cpp-images clean-libtensorflow-cc-images
113 |
114 | # === RULES ====================================================================
115 |
116 | # ----- SINGLE VERSION RULES ---------------------------------------------------
117 |
118 | .PHONY: 0-download-official-dockerfiles
119 | 0-download-official-dockerfiles:
120 | $(MAKEFILE_DIR)/scripts/$@.sh
121 |
122 | .PHONY: 1-build-official-devel-image
123 | 1-build-official-devel-image:
124 | $(MAKEFILE_DIR)/scripts/$@.sh
125 |
126 | .PHONY: 2-build-cpp-image
127 | 2-build-cpp-image:
128 | $(MAKEFILE_DIR)/scripts/$@.sh
129 |
130 | .PHONY: 3-export-libtensorflow-cc
131 | 3-export-libtensorflow-cc:
132 | $(MAKEFILE_DIR)/scripts/$@.sh
133 |
134 | .PHONY: 4-test-libtensorflow-cc
135 | 4-test-libtensorflow-cc:
136 | $(MAKEFILE_DIR)/scripts/$@.sh
137 |
138 | .PHONY: 5-print-versions
139 | 5-print-versions:
140 | $(MAKEFILE_DIR)/scripts/$@.sh
141 |
142 | .PHONY: 6-push-image
143 | 6-push-image:
144 | $(MAKEFILE_DIR)/scripts/$@.sh
145 |
146 | # ----- MULTI VERSION RULES ----------------------------------------------------
147 |
148 | .PHONY: 0-download-official-dockerfiles-all
149 | 0-download-official-dockerfiles-all:
150 | $(foreach TF_VERSION,$(TF_VERSIONS),TF_VERSION=$(TF_VERSION) $(MAKE) 0-download-official-dockerfiles;)
151 |
152 | .PHONY: 1-build-official-devel-image-all
153 | 1-build-official-devel-image-all:
154 | $(foreach TF_VERSION,$(TF_VERSIONS),TF_VERSION=$(TF_VERSION) $(MAKE) 1-build-official-devel-image;)
155 |
156 | .PHONY: 2-build-cpp-image-all
157 | 2-build-cpp-image-all:
158 | $(foreach TF_VERSION,$(TF_VERSIONS),TF_VERSION=$(TF_VERSION) $(MAKE) 2-build-cpp-image;)
159 |
160 | .PHONY: 3-export-libtensorflow-cc-all
161 | 3-export-libtensorflow-cc-all:
162 | $(foreach TF_VERSION,$(TF_VERSIONS),TF_VERSION=$(TF_VERSION) $(MAKE) 3-export-libtensorflow-cc;)
163 |
164 | .PHONY: 4-test-libtensorflow-cc-all
165 | 4-test-libtensorflow-cc-all:
166 | $(foreach TF_VERSION,$(TF_VERSIONS),TF_VERSION=$(TF_VERSION) $(MAKE) 4-test-libtensorflow-cc;)
167 |
168 | .PHONY: 5-print-versions-all
169 | 5-print-versions-all:
170 | $(foreach TF_VERSION,$(TF_VERSIONS),TF_VERSION=$(TF_VERSION) $(MAKE) 5-print-versions;)
171 |
172 | .PHONY: 6-push-image-all
173 | 6-push-image-all:
174 | $(foreach TF_VERSION,$(TF_VERSIONS),TF_VERSION=$(TF_VERSION) $(MAKE) 6-push-image;)
175 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # libtensorflow_cc
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | We provide a **pre-built library and a Docker image** for easy installation and usage of the [TensorFlow C++ API](https://www.tensorflow.org/api_docs/cc).
13 |
14 | In order to, e.g., run TensorFlow models from C++ source code, one usually needs to build the C++ API in the form of the `libtensorflow_cc.so` library from source. There is no official release of the library and the build from source is only sparsely documented.
15 |
16 | We try to remedy this current situation by providing two main components:
17 | 1. We provide the pre-built `libtensorflow_cc.so` including accompanying headers as a one-command-install deb-package. The package is available for both x86_64/amd64 and arm64 machines running Ubuntu. See [Installation](#installation).
18 | 2. We provide a pre-built Docker image based on the official TensorFlow Docker image. Our Docker image has both TensorFlow Python and TensorFlow C++ installed. The Docker images support both x86_64/amd64 and arm64 architectures. The arm64 version is specifically targeted at [NVIDIA Jetson Orin](https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/). See [Docker Images](#docker-images).
19 |
20 | > [!IMPORTANT]
21 | > This repository is open-sourced and maintained by the [**Institute for Automotive Engineering (ika) at RWTH Aachen University**](https://www.ika.rwth-aachen.de/).
22 | > **Deep Learning** is one of many research topics within our [*Vehicle Intelligence & Automated Driving*](https://www.ika.rwth-aachen.de/en/competences/fields-of-research/vehicle-intelligence-automated-driving.html) domain.
23 | > If you would like to learn more about how we can support your deep learning or automated driving efforts, feel free to reach out to us!
24 | > *Timo Woopen - Manager Research Area Vehicle Intelligence & Automated Driving*
25 | > *+49 241 80 23549*
26 | > *timo.woopen@ika.rwth-aachen.de*
27 |
28 | If you want to use the TensorFlow C++ API to load, inspect, and run saved models and frozen graphs in C++, we suggest that you also check out our helper library [*tensorflow_cpp*](https://github.com/ika-rwth-aachen/tensorflow_cpp).
29 |
30 | ---
31 |
32 | - [Demo](#demo)
33 | - [Installation](#installation)
34 | - [CMake Integration](#cmake-integration)
35 | - [Docker Images](#docker-images)
36 | - [Build](#build)
37 | - [Supported TensorFlow Versions](#supported-tensorflow-versions)
38 | - [Version Matrix](#version-matrix)
39 |
40 |
41 | ## Demo
42 |
43 | Run the following from the Git repository root to mount, build and run the [example application](example/) in the pre-built Docker container.
44 |
45 | ```bash
46 | # libtensorflow_cc$
47 | docker run --rm \
48 | --volume $(pwd)/example:/example \
49 | --workdir /example \
50 | rwthika/tensorflow-cc:latest \
51 | ./build-and-run.sh
52 |
53 | # Hello from TensorFlow C++ 2.13.0!
54 | #
55 | # A =
56 | # 1 2
57 | # 3 4
58 | #
59 | # x =
60 | # 1
61 | # 2
62 | #
63 | # A * x =
64 | # 5
65 | # 11
66 | ```
67 |
68 |
69 | ## Installation
70 |
71 | The pre-built `libtensorflow_cc.so` library and accompanying headers are packaged as a deb-package that can be installed as shown below. The deb-package can also be downloaded manually from the [Releases page](https://github.com/ika-rwth-aachen/libtensorflow_cc/releases). We provide versions with and without GPU support for x86_64/amd64 and arm64 architectures.
72 |
73 | #### GPU
74 |
75 | ```bash
76 | wget https://github.com/ika-rwth-aachen/libtensorflow_cc/releases/download/v2.13.0/libtensorflow-cc_2.13.0-gpu_$(dpkg --print-architecture).deb
77 | sudo dpkg -i libtensorflow-cc_2.13.0-gpu_$(dpkg --print-architecture).deb
78 | ldconfig
79 | ```
80 |
81 | #### CPU
82 |
83 | ```bash
84 | wget https://github.com/ika-rwth-aachen/libtensorflow_cc/releases/download/v2.13.0/libtensorflow-cc_2.13.0_$(dpkg --print-architecture).deb
85 | sudo dpkg -i libtensorflow-cc_2.13.0_$(dpkg --print-architecture).deb
86 | ldconfig
87 | ```
88 |
89 | ### CMake Integration
90 |
91 | Use `find_package()` to locate and integrate the TensorFlow C++ API into your CMake project.
92 |
93 | ```cmake
94 | # CMakeLists.txt
95 | find_package(TensorFlow REQUIRED)
96 | # ...
97 | add_executable(foo ...) # / add_library(foo ...)
98 | # ...
99 | target_include_directories(foo PRIVATE ${TensorFlow_INCLUDE_DIRS})
100 | target_link_libraries(foo PRIVATE ${TensorFlow_LIBRARIES})
101 | ```
102 |
103 |
104 | ## Docker Images
105 |
106 | Instead of installing the TensorFlow C++ API using our deb-package, you can also run or build on top the pre-built Docker images in our [Docker Hub repository](https://hub.docker.com/r/rwthika/tensorflow-cc). If supported, we offer CPU-only and GPU-supporting images. Starting with TensorFlow 2.9.2, we offer multi-arch images, supporting x86_64/amd64 and arm64 architectures.
107 |
108 | The amd64 images are based on the [official TensorFlow Docker images](https://hub.docker.com/r/tensorflow/tensorflow). The arm64 images are based on [NVIDIA's official L4T TensorFlow images for Jetson](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/l4t-tensorflow), targeted at [NVIDIA Jetson Orin](https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/). Our provided images only install the TensorFlow C++ API on top of those. The resulting images therefore enable you to run TensorFlow in both Python and C++.
109 |
110 | | TensorFlow Version | CPU/GPU | Architecture | Image:Tag |
111 | | :---: | :---: | :---: | --- |
112 | | 2.13.0 | GPU | amd64 | `rwthika/tensorflow-cc:latest-gpu` |
113 | | 2.13.0 | CPU | amd64, arm64 | `rwthika/tensorflow-cc:latest` |
114 |
115 |
116 | All TensorFlow Versions (GPU)
117 |
118 | | TensorFlow Version | Architecture | Image:Tag |
119 | | :---: | :---: | --- |
120 | | latest | amd64 | `rwthika/tensorflow-cc:latest-gpu` |
121 | | 2.13.0 | amd64 | `rwthika/tensorflow-cc:2.13.0-gpu` |
122 | | 2.12.0 | amd64 | `rwthika/tensorflow-cc:2.12.0-gpu` |
123 | | 2.11.1 | amd64 | `rwthika/tensorflow-cc:2.11.0-gpu` |
124 | | 2.11.0 | amd64, arm64 | `rwthika/tensorflow-cc:2.11.0-gpu` |
125 | | 2.10.1 | amd64, arm64 | `rwthika/tensorflow-cc:2.10.1-gpu` |
126 | | 2.10.0 | amd64, arm64 | `rwthika/tensorflow-cc:2.10.0-gpu` |
127 | | 2.9.3 | amd64, arm64 | `rwthika/tensorflow-cc:2.9.3-gpu` |
128 | | 2.9.2 | amd64, arm64 | `rwthika/tensorflow-cc:2.9.2-gpu` |
129 | | 2.9.1 | amd64 | `rwthika/tensorflow-cc:2.9.1-gpu` |
130 | | 2.9.0 | amd64 | `rwthika/tensorflow-cc:2.9.0-gpu` |
131 | | 2.8.4 | amd64, arm64 | `rwthika/tensorflow-cc:2.8.4-gpu` |
132 | | 2.8.3 | amd64 | `rwthika/tensorflow-cc:2.8.3-gpu` |
133 | | 2.8.2 | amd64 | `rwthika/tensorflow-cc:2.8.2-gpu` |
134 | | 2.8.1 | amd64 | `rwthika/tensorflow-cc:2.8.1-gpu` |
135 | | 2.8.0 | amd64 | `rwthika/tensorflow-cc:2.8.0-gpu` |
136 | | 2.7.4 | amd64 | `rwthika/tensorflow-cc:2.7.4-gpu` |
137 | | 2.7.3 | amd64 | `rwthika/tensorflow-cc:2.7.3-gpu` |
138 | | 2.7.2 | amd64 | `rwthika/tensorflow-cc:2.7.2-gpu` |
139 | | 2.7.1 | amd64 | `rwthika/tensorflow-cc:2.7.1-gpu` |
140 | | 2.7.0 | amd64 | `rwthika/tensorflow-cc:2.7.0-gpu` |
141 |
142 |
143 |
144 |
145 | All TensorFlow Versions (CPU)
146 |
147 | | TensorFlow Version | Architecture | Image:Tag |
148 | | :---: | :---: | --- |
149 | | latest | amd64, arm64 | `rwthika/tensorflow-cc:latest` |
150 | | 2.13.0 | amd64, arm64 | `rwthika/tensorflow-cc:2.13.0` |
151 | | 2.12.1 | arm64 | `rwthika/tensorflow-cc:2.12.1` |
152 | | 2.12.0 | amd64, arm64 | `rwthika/tensorflow-cc:2.12.0` |
153 | | 2.11.1 | amd64, arm64 | `rwthika/tensorflow-cc:2.11.1` |
154 | | 2.11.0 | amd64, arm64 | `rwthika/tensorflow-cc:2.11.0` |
155 | | 2.10.1 | amd64, arm64 | `rwthika/tensorflow-cc:2.10.1` |
156 | | 2.10.0 | amd64, arm64 | `rwthika/tensorflow-cc:2.10.0` |
157 | | 2.9.3 | amd64, arm64 | `rwthika/tensorflow-cc:2.9.3` |
158 | | 2.9.2 | amd64, arm64 | `rwthika/tensorflow-cc:2.9.2` |
159 | | 2.9.1 | amd64 | `rwthika/tensorflow-cc:2.9.1` |
160 | | 2.9.0 | amd64 | `rwthika/tensorflow-cc:2.9.0` |
161 | | 2.8.4 | amd64, arm64 | `rwthika/tensorflow-cc:2.8.4` |
162 | | 2.8.3 | amd64 | `rwthika/tensorflow-cc:2.8.3` |
163 | | 2.8.2 | amd64 | `rwthika/tensorflow-cc:2.8.2` |
164 | | 2.8.1 | amd64 | `rwthika/tensorflow-cc:2.8.1` |
165 | | 2.8.0 | amd64 | `rwthika/tensorflow-cc:2.8.0` |
166 | | 2.7.4 | amd64 | `rwthika/tensorflow-cc:2.7.4` |
167 | | 2.7.3 | amd64 | `rwthika/tensorflow-cc:2.7.3` |
168 | | 2.7.2 | amd64 | `rwthika/tensorflow-cc:2.7.2` |
169 | | 2.7.1 | amd64 | `rwthika/tensorflow-cc:2.7.1` |
170 | | 2.7.0 | amd64 | `rwthika/tensorflow-cc:2.7.0` |
171 | | 2.6.1 | amd64 | `rwthika/tensorflow-cc:2.6.1` |
172 | | 2.6.0 | amd64 | `rwthika/tensorflow-cc:2.6.0` |
173 | | 2.5.1 | amd64 | `rwthika/tensorflow-cc:2.5.1` |
174 | | 2.5.0 | amd64 | `rwthika/tensorflow-cc:2.5.0` |
175 | | 2.4.3 | amd64 | `rwthika/tensorflow-cc:2.4.3` |
176 | | 2.4.2 | amd64 | `rwthika/tensorflow-cc:2.4.2` |
177 | | 2.4.1 | amd64 | `rwthika/tensorflow-cc:2.4.1` |
178 | | 2.4.0 | amd64 | `rwthika/tensorflow-cc:2.4.0` |
179 | | 2.3.4 | amd64 | `rwthika/tensorflow-cc:2.3.4` |
180 | | 2.3.3 | amd64 | `rwthika/tensorflow-cc:2.3.3` |
181 | | 2.3.2 | amd64 | `rwthika/tensorflow-cc:2.3.2` |
182 | | 2.3.1 | amd64 | `rwthika/tensorflow-cc:2.3.1` |
183 | | 2.3.0 | amd64 | `rwthika/tensorflow-cc:2.3.0` |
184 | | 2.0.4 | amd64 | `rwthika/tensorflow-cc:2.0.4` |
185 | | 2.0.3 | amd64 | `rwthika/tensorflow-cc:2.0.3` |
186 | | 2.0.1 | amd64 | `rwthika/tensorflow-cc:2.0.1` |
187 | | 2.0.0 | amd64 | `rwthika/tensorflow-cc:2.0.0` |
188 |
189 |
190 |
191 |
192 | ## Build
193 |
194 | If you would like to build the deb-package and Docker images yourself, use the [`Makefile`](Makefile) as instructed below.
195 |
196 | All `make` targets support the flags `TF_VERSION` (defaults to `2.13.0`), `GPU` (defaults to `1`), and `ARCH` (defaults to host architecture) in order to build a specific TensorFlow version in CPU/GPU mode for a specific architecture. The flag `BUILD_PIP_PACKAGE` (defaults to `0`) enables you to also build the pip-package alongside.
197 |
198 | All `make` targets listed below also have a counterpart named `-all`, which can be used to build multiple TensorFlow versions one after the other using the `TF_VERSIONS` flag like so:
199 |
200 | ```shell
201 | make 0-download-official-dockerfiles-all TF_VERSIONS="2.9.0 2.8.0 2.7.0"
202 | ```
203 |
204 | #### 0. Download Dockerfiles from TensorFlow repository
205 |
206 | This downloads the directory [`tensorflow/tools/dockerfiles/` from the TensorFlow repository](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tools/dockerfiles).
207 |
208 | ```shell
209 | make 0-download-official-dockerfiles
210 | ```
211 |
212 | #### 1. Build TensorFlow Development Image
213 |
214 | This builds a TensorFlow development image `tensorflow/tensorflow:X.Y.Z-devel[-gpu]` based on the Dockerfile downloaded from the TensorFlow repository.
215 |
216 | ```shell
217 | make 1-build-official-devel-image
218 | ```
219 |
220 | #### 2. Build TensorFlow C++ Image
221 |
222 | Based on the development image, this builds the TensorFlow C++ library `libtensorflow_cc.so` and installs it in a runtime image `rwthika/tensorflow-cc:X.Y.Z[-gpu]`, including both Python and C++ TensorFlow. In an intermediate Docker build stage, a deb-package `libtensorflow-cc_X.Y.Z[-gpu].deb` is created.
223 |
224 | ```shell
225 | make 2-build-cpp-image
226 | ```
227 |
228 | #### 3. Export TensorFlow C++ Library Installation Package
229 |
230 | This exports the deb-package `libtensorflow-cc_X.Y.Z[-gpu].deb` to the [`libtensorflow-cc`](libtensorflow-cc/) output folder.
231 |
232 | ```shell
233 | make 3-export-libtensorflow-cc
234 | ```
235 |
236 | #### 4. Test TensorFlow C++
237 |
238 | This installs builds and runs the [example application](example/) inside a container of the runtime image.
239 |
240 | ```shell
241 | make 4-test-libtensorflow-cc
242 | ```
243 |
244 | #### 5. Print Versions of Build Tools
245 |
246 | This prints the exact version numbers of all tools involved in the build process.
247 |
248 | ```shell
249 | make 5-print-versions
250 | ```
251 |
252 |
253 | ## Supported TensorFlow Versions
254 |
255 |
256 | Show Table
257 |
258 | | Version | Architecture | Step 1 (CPU) | Step 2 (CPU) | Step 4 (CPU) | Step 1 (GPU) | Step 2 (GPU) | Step 4 (GPU) | Notes |
259 | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | --- |
260 | | 2.13.0 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
261 | | 2.13.0 | arm64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | - | linker error at the end of building `libtensorflow_cc.so`; CPU image without Python TensorFlow |
262 | | 2.12.1 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | missing image `tensorflow/tensorflow:2.12.1` |
263 | | 2.12.1 | arm64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | - | linker error at the end of building `libtensorflow_cc.so`; CPU image without Python TensorFlow |
264 | | 2.12.0 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
265 | | 2.12.0 | arm64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | - | linker error at the end of building `libtensorflow_cc.so`; CPU image without Python TensorFlow |
266 | | 2.11.1 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
267 | | 2.11.1 | arm64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | - | linker error at the end of building `libtensorflow_cc.so`; CPU image without Python TensorFlow |
268 | | 2.11.0 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
269 | | 2.11.0 | arm64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
270 | | 2.10.1 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
271 | | 2.10.1 | arm64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
272 | | 2.10.0 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
273 | | 2.10.0 | arm64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
274 | | 2.9.3 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
275 | | 2.9.3 | arm64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
276 | | 2.9.2 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
277 | | 2.9.2 | arm64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
278 | | 2.9.1 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
279 | | 2.9.0 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
280 | | 2.8.4 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
281 | | 2.8.4 | arm64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
282 | | 2.8.3 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
283 | | 2.8.2 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
284 | | 2.8.1 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
285 | | 2.8.0 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
286 | | 2.7.4 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
287 | | 2.7.3 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
288 | | 2.7.2 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
289 | | 2.7.1 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
290 | | 2.7.0 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
291 | | 2.6.5 | amd64 | :white_check_mark: | :x: | - | :x: | - | - | missing image `tensorflow/tensorflow:2.6.5`; unable to locate `libcudnn7=8.1.0.77-1+cuda11.2` |
292 | | 2.6.4 | amd64 | :white_check_mark: | :x: | - | :x: | - | - | missing image `tensorflow/tensorflow:2.6.4`; unable to locate `libcudnn7=8.1.0.77-1+cuda11.2` |
293 | | 2.6.3 | amd64 | :white_check_mark: | :x: | - | :x: | - | - | missing image `tensorflow/tensorflow:2.6.3`; unable to locate `libcudnn7=8.1.0.77-1+cuda11.2` |
294 | | 2.6.2 | amd64 | :white_check_mark: | :x: | - | :x: | - | - | missing image `tensorflow/tensorflow:2.6.2`; unable to locate `libcudnn7=8.1.0.77-1+cuda11.2` |
295 | | 2.6.1 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | - | - | unable to locate `libcudnn7=8.1.0.77-1+cuda11.2` |
296 | | 2.6.0 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | - | - | unable to locate `libcudnn7=8.1.0.77-1+cuda11.2` |
297 | | 2.5.3 | amd64 | :white_check_mark: | :x: | - | :x: | - | - | missing image `tensorflow/tensorflow:2.5.3`; unable to locate `libcudnn7=8.1.0.77-1+cuda11.2` |
298 | | 2.5.2 | amd64 | :white_check_mark: | :x: | - | :x: | - | - | missing image `tensorflow/tensorflow:2.5.2`; unable to locate `libcudnn7=8.1.0.77-1+cuda11.2` |
299 | | 2.5.1 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | - | - | unable to locate `libcudnn7=8.1.0.77-1+cuda11.2` |
300 | | 2.5.0 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | - | - | unable to locate `libcudnn7=8.1.0.77-1+cuda11.2` |
301 | | 2.4.4 | amd64 | :white_check_mark: | :x: | - | :x: | - | - | missing image `tensorflow/tensorflow:2.4.4`; unable to locate `libcudnn7=8.0.4.30-1+cuda11.0` |
302 | | 2.4.3 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | - | - | unable to locate `libcudnn7=8.0.4.30-1+cuda11.0` |
303 | | 2.4.2 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | - | - | unable to locate `libcudnn7=8.0.4.30-1+cuda11.0` |
304 | | 2.4.1 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | - | - | unable to locate `libcudnn7=8.0.4.30-1+cuda11.0` |
305 | | 2.4.0 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | - | - | unable to locate `libcudnn7=8.0.4.30-1+cuda11.0` |
306 | | 2.3.4 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | - | - | unable to locate `libcudnn7=7.6.4.38-1+cuda10.1` |
307 | | 2.3.3 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | - | - | unable to locate `libcudnn7=7.6.4.38-1+cuda10.1` |
308 | | 2.3.2 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | - | - | unable to locate `libcudnn7=7.6.4.38-1+cuda10.1` |
309 | | 2.3.1 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | - | - | unable to locate `libcudnn7=7.6.4.38-1+cuda10.1` |
310 | | 2.3.0 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | - | - | unable to locate `libcudnn7=7.6.4.38-1+cuda10.1` |
311 | | 2.2.3 | amd64 | :white_check_mark: | :x: | - | :x: | - | - | no module named `numpy`; unable to locate `libcudnn7=7.6.4.38-1+cuda10.1` |
312 | | 2.2.2 | amd64 | :white_check_mark: | :x: | - | :x: | - | - | no module named `numpy`; unable to locate `libcudnn7=7.6.4.38-1+cuda10.1` |
313 | | 2.2.1 | amd64 | :white_check_mark: | :x: | - | :x: | - | - | no module named `numpy`; unable to locate `libcudnn7=7.6.4.38-1+cuda10.1` |
314 | | 2.2.0 | amd64 | :white_check_mark: | :x: | - | :x: | - | - | no module named `numpy`; unable to locate `libcudnn7=7.6.4.38-1+cuda10.1` |
315 | | 2.1.4 | amd64 | :white_check_mark: | :x: | - | :x: | - | - | no module named `numpy`; unable to locate `libcudnn7=7.6.2.24-1+cuda10.0` |
316 | | 2.1.3 | amd64 | :white_check_mark: | :x: | - | :x: | - | - | no module named `numpy`; unable to locate `libcudnn7=7.6.2.24-1+cuda10.0` |
317 | | 2.1.2 | amd64 | :white_check_mark: | :x: | - | :x: | - | - | no module named `numpy`; unable to locate `libcudnn7=7.6.2.24-1+cuda10.0` |
318 | | 2.1.1 | amd64 | :white_check_mark: | :x: | - | :x: | - | - | no module named `numpy`; unable to locate `libcudnn7=7.6.2.24-1+cuda10.0` |
319 | | 2.1.0 | amd64 | :white_check_mark: | :x: | - | :x: | - | - | no module named `numpy`; unable to locate `libcudnn7=7.6.2.24-1+cuda10.0` |
320 | | 2.0.4 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | - | - | unable to locate `libcudnn7=7.6.2.24-1+cuda10.0` |
321 | | 2.0.3 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | - | - | unable to locate `libcudnn7=7.6.2.24-1+cuda10.0` |
322 | | 2.0.2 | amd64 | :white_check_mark: | :x: | - | :x: | - | - | missing image `tensorflow/tensorflow:2.0.2`; unable to locate `libcudnn7=7.6.2.24-1+cuda10.0` |
323 | | 2.0.1 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | - | - | unable to locate `libcudnn7=7.6.2.24-1+cuda10.0` |
324 | | 2.0.0 | amd64 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | - | - | unable to locate `libcudnn7=7.6.2.24-1+cuda10.0` |
325 |
326 |
327 |
328 |
329 | ### Version Matrix
330 |
331 |
332 | Show Table
333 |
334 | | TensorFlow | Architecture | Ubuntu | GCC | Bazel | Python | protobuf | CUDA | cuDNN | TensorRT | GPU Compute Capability |
335 | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
336 | | 2.13.0 | amd64 | 20.04 | 9.4.0/11.4.0 | 6.3.2 | 3.8.10 | 3.21.9 | 11.8.89 | 8.6.0 | 8.5.3 | 9.0, 8.9, 8.6, 8.0, 7.5, 7.0, 6.1, 6.0 |
337 | | 2.13.0 | arm64 | 20.04 | 9.4.0/11.4.0 | 6.3.2 | 3.8.10 | 3.21.9 | - | - | - | - |
338 | | 2.12.1 | amd64 | 20.04 | 9.4.0/11.4.0 | 6.3.2 | 3.8.10 | 3.21.9 | 11.8.89 | 8.6.0 | 8.5.3 | 9.0, 8.9, 8.6, 8.0, 7.5, 7.0, 6.1, 6.0 |
339 | | 2.12.1 | arm64 | 20.04 | 9.4.0/11.4.0 | 6.3.2 | 3.8.10 | 3.21.9 | - | - | - | - |
340 | | 2.12.0 | amd64 | 20.04 | 9.4.0/11.4.0 | 6.3.2 | 3.8.10 | 3.21.9 | 11.8.89 | 8.6.0 | 8.5.3 | 9.0, 8.9, 8.6, 8.0, 7.5, 7.0, 6.1, 6.0 |
341 | | 2.12.0 | arm64 | 20.04 | 9.4.0/11.4.0 | 6.3.2 | 3.8.10 | 3.21.9 | - | - | - | - |
342 | | 2.11.1 | amd64 | 20.04 | 9.4.0 | 6.3.2 | 3.8.10 | 3.9.2 | 11.2.152 | 8.1.0 | 7.2.2 | 8.6, 8.0, 7.5, 7.0, 6.1, 6.0 |
343 | | 2.11.1 | arm64 | 20.04 | 9.4.0 | 6.3.2 | 3.8.10 | 3.9.2 | - | - | - | - |
344 | | 2.11.0 | amd64 | 20.04 | 9.4.0 | 6.0.0 | 3.8.10 | 3.9.2 | 11.2.152 | 8.1.0 | 7.2.2 | 8.6, 8.0, 7.5, 7.2, 7.0, 6.1, 6.0, 5.3 |
345 | | 2.11.0 | arm64 | 20.04 | 9.4.0 | 6.0.0 | 3.8.10 | 3.9.2 | 11.4.239 | 8.4.1 | 8.4.1 | 8.7, 8.6, 8.0, 7.5, 7.2, 7.0, 6.1, 6.0, 5.3 |
346 | | 2.10.1 | amd64 | 20.04 | 9.4.0 | 6.0.0 | 3.8.10 | 3.9.2 | 11.2.152 | 8.1.0 | 7.2.2 | 8.6, 8.0, 7.5, 7.2, 7.0, 6.1, 6.0, 5.3 |
347 | | 2.10.1 | arm64 | 20.04 | 9.4.0 | 6.0.0 | 3.8.10 | 3.9.2 | 11.4.239 | 8.4.1 | 8.4.1 | 8.7, 8.6, 8.0, 7.5, 7.2, 7.0, 6.1, 6.0, 5.3 |
348 | | 2.10.0 | amd64 | 20.04 | 9.4.0 | 6.0.0 | 3.8.10 | 3.9.2 | 11.2.152 | 8.1.0 | 7.2.2 | 8.6, 8.0, 7.5, 7.2, 7.0, 6.1, 6.0, 5.3 |
349 | | 2.10.0 | arm64 | 20.04 | 9.4.0 | 6.0.0 | 3.8.10 | 3.9.2 | 11.4.239 | 8.4.1 | 8.4.1 | 8.7, 8.6, 8.0, 7.5, 7.2, 7.0, 6.1, 6.0, 5.3 |
350 | | 2.9.3 | amd64 | 20.04 | 9.4.0 | 6.0.0 | 3.8.10 | 3.9.2 | 11.2.152 | 8.1.0 | 7.2.2 | 8.6, 8.0, 7.5, 7.2, 7.0, 6.1, 6.0, 5.3 |
351 | | 2.9.3 | arm64 | 20.04 | 9.4.0 | 6.0.0 | 3.8.10 | 3.9.2 | 11.4.239 | 8.4.1 | 8.4.1 | 8.7, 8.6, 8.0, 7.5, 7.2, 7.0, 6.1, 6.0, 5.3 |
352 | | 2.9.2 | amd64 | 20.04 | 9.4.0 | 5.3.1 | 3.8.10 | 3.9.2 | 11.2.152 | 8.1.0 | 7.2.2 | 8.6, 8.0, 7.5, 7.2, 7.0, 6.1, 6.0, 5.3 |
353 | | 2.9.2 | arm64 | 20.04 | 9.4.0 | 5.3.2 | 3.8.10 | 3.9.2 | 11.4.239 | 8.4.1 | 8.4.1 | 8.7, 8.6, 8.0, 7.5, 7.2, 7.0, 6.1, 6.0, 5.3 |
354 | | 2.9.1 | amd64 | 20.04 | 9.4.0 | 5.3.0 | 3.8.10 | 3.9.2 | 11.2.152 | 8.1.0 | 7.2.2 | 8.6, 8.0, 7.5, 7.2, 7.0, 6.1, 6.0, 5.3 |
355 | | 2.9.0 | amd64 | 20.04 | 9.4.0 | 5.3.0 | 3.8.10 | 3.9.2 | 11.2.152 | 8.1.0 | 7.2.2 | 8.6, 8.0, 7.5, 7.2, 7.0, 6.1, 6.0, 5.3 |
356 | | 2.8.4 | amd64 | 20.04 | 9.4.0 | 4.2.1 | 3.8.10 | 3.9.2 | 11.2.152 | 8.1.0 | 7.2.2 | 8.6, 8.0, 7.5, 7.2, 7.0, 6.1, 6.0, 5.3 |
357 | | 2.8.4 | arm64 | 20.04 | 9.4.0 | 4.2.1 | 3.8.10 | 3.9.2 | 11.4.166 | 8.3.2 | 8.4.0 | 8.7, 8.6, 8.0, 7.5, 7.2, 7.0, 6.1, 6.0, 5.3 |
358 | | 2.8.3 | amd64 | 20.04 | 9.4.0 | 4.2.1 | 3.8.10 | 3.9.2 | 11.2.152 | 8.1.0 | 7.2.2 | 8.6, 8.0, 7.5, 7.2, 7.0, 6.1, 6.0, 5.3 |
359 | | 2.8.2 | amd64 | 20.04 | 9.4.0 | 4.2.1 | 3.8.10 | 3.9.2 | 11.2.152 | 8.1.0 | 7.2.2 | 8.6, 8.0, 7.5, 7.2, 7.0, 6.1, 6.0, 5.3 |
360 | | 2.8.1 | amd64 | 20.04 | 9.4.0 | 4.2.1 | 3.8.10 | 3.9.2 | 11.2.152 | 8.1.0 | 7.2.2 | 8.6, 8.0, 7.5, 7.2, 7.0, 6.1, 6.0, 5.3 |
361 | | 2.8.0 | amd64 | 20.04 | 9.4.0 | 4.2.1 | 3.8.10 | 3.9.2 | 11.2.152 | 8.1.0 | 7.2.2 | 8.6, 8.0, 7.5, 7.2, 7.0, 6.1, 6.0, 5.3 |
362 | | 2.7.4 | amd64 | 20.04 | 9.4.0 | 3.7.2 | 3.8.10 | 3.9.2 | 11.2.152 | 8.1.0 | 8.0.0 | 8.6, 8.0, 7.5, 7.2, 7.0, 6.1, 6.0, 5.3 |
363 | | 2.7.3 | amd64 | 20.04 | 9.4.0 | 3.7.2 | 3.8.10 | 3.9.2 | 11.2.152 | 8.1.0 | 8.0.0 | 8.6, 8.0, 7.5, 7.2, 7.0, 6.1, 6.0, 5.3 |
364 | | 2.7.2 | amd64 | 20.04 | 9.4.0 | 3.7.2 | 3.8.10 | 3.9.2 | 11.2.152 | 8.1.0 | 8.0.0 | 8.6, 8.0, 7.5, 7.2, 7.0, 6.1, 6.0, 5.3 |
365 | | 2.7.1 | amd64 | 20.04 | 9.4.0 | 3.7.2 | 3.8.10 | 3.9.2 | 11.2.152 | 8.1.0 | 8.0.0 | 8.6, 8.0, 7.5, 7.2, 7.0, 6.1, 6.0, 5.3 |
366 | | 2.7.0 | amd64 | 20.04 | 9.4.0 | 3.7.2 | 3.8.10 | 3.9.2 | 11.2.152 | 8.1.0 | 8.0.0 | 8.6, 8.0, 7.5, 7.2, 7.0, 6.1, 6.0, 5.3 |
367 | | 2.6.5 | amd64 | 18.04 | 7.5.0 | 3.7.2 | 3.6.9 | 3.9.2 | - | - | - | - |
368 | | 2.6.4 | amd64 | 18.04 | 7.5.0 | 3.7.2 | 3.6.9 | 3.9.2 | - | - | - | - |
369 | | 2.6.3 | amd64 | 18.04 | 7.5.0 | 3.7.2 | 3.6.9 | 3.9.2 | - | - | - | - |
370 | | 2.6.2 | amd64 | 18.04 | 7.5.0 | 3.7.2 | 3.6.9 | 3.9.2 | - | - | - | - |
371 | | 2.6.1 | amd64 | 18.04 | 7.5.0 | 3.7.2 | 3.6.9 | 3.9.2 | - | - | - | - |
372 | | 2.6.0 | amd64 | 18.04 | 7.5.0 | 3.7.2 | 3.6.9 | 3.9.2 | - | - | - | - |
373 | | 2.5.3 | amd64 | 18.04 | 7.5.0 | 3.7.2 | 3.6.9 | 3.9.2 | - | - | - | - |
374 | | 2.5.2 | amd64 | 18.04 | 7.5.0 | 3.7.2 | 3.6.9 | 3.9.2 | - | - | - | - |
375 | | 2.5.1 | amd64 | 18.04 | 7.5.0 | 3.7.2 | 3.6.9 | 3.9.2 | - | - | - | - |
376 | | 2.5.0 | amd64 | 18.04 | 7.5.0 | 3.7.2 | 3.6.9 | 3.9.2 | - | - | - | - |
377 | | 2.4.4 | amd64 | 18.04 | 7.5.0 | 3.1.0 | 3.6.9 | 3.9.2 | - | - | - | - |
378 | | 2.4.3 | amd64 | 18.04 | 7.5.0 | 3.1.0 | 3.6.9 | 3.9.2 | - | - | - | - |
379 | | 2.4.2 | amd64 | 18.04 | 7.5.0 | 3.1.0 | 3.6.9 | 3.9.2 | - | - | - | - |
380 | | 2.4.1 | amd64 | 18.04 | 7.5.0 | 3.1.0 | 3.6.9 | 3.9.2 | - | - | - | - |
381 | | 2.4.0 | amd64 | 18.04 | 7.5.0 | 3.1.0 | 3.6.9 | 3.9.2 | - | - | - | - |
382 | | 2.3.4 | amd64 | 18.04 | 7.5.0 | 3.1.0 | 3.6.9 | 3.9.2 | - | - | - | - |
383 | | 2.3.3 | amd64 | 18.04 | 7.5.0 | 3.1.0 | 3.6.9 | 3.9.2 | - | - | - | - |
384 | | 2.3.2 | amd64 | 18.04 | 7.5.0 | 3.1.0 | 3.6.9 | 3.9.2 | - | - | - | - |
385 | | 2.3.1 | amd64 | 18.04 | 7.5.0 | 3.1.0 | 3.6.9 | 3.9.2 | - | - | - | - |
386 | | 2.3.0 | amd64 | 18.04 | 7.5.0 | 3.1.0 | 3.6.9 | 3.9.2 | - | - | - | - |
387 | | 2.2.3 | amd64 | 18.04 | 7.5.0 | 2.0.0 | 2.7.17 | 3.8.0 | - | - | - | - |
388 | | 2.2.2 | amd64 | 18.04 | 7.5.0 | 2.0.0 | 2.7.17 | 3.8.0 | - | - | - | - |
389 | | 2.2.1 | amd64 | 18.04 | 7.5.0 | 2.0.0 | 2.7.17 | 3.8.0 | - | - | - | - |
390 | | 2.2.0 | amd64 | 18.04 | 7.5.0 | 2.0.0 | 2.7.17 | 3.8.0 | - | - | - | - |
391 | | 2.1.4 | amd64 | 18.04 | 7.5.0 | 0.29.1 | 2.7.17 | 3.8.0 | - | - | - | - |
392 | | 2.1.3 | amd64 | 18.04 | 7.5.0 | 0.29.1 | 2.7.17 | 3.8.0 | - | - | - | - |
393 | | 2.1.2 | amd64 | 18.04 | 7.5.0 | 0.29.1 | 2.7.17 | 3.8.0 | - | - | - | - |
394 | | 2.1.1 | amd64 | 18.04 | 7.5.0 | 0.29.1 | 2.7.17 | 3.8.0 | - | - | - | - |
395 | | 2.1.0 | amd64 | 18.04 | 7.5.0 | 0.29.1 | 2.7.17 | 3.8.0 | - | - | - | - |
396 | | 2.0.4 | amd64 | 18.04 | 7.5.0 | 0.26.1 | 2.7.17 | 3.8.0 | - | - | - | - |
397 | | 2.0.3 | amd64 | 18.04 | 7.5.0 | 0.26.1 | 2.7.17 | 3.8.0 | - | - | - | - |
398 | | 2.0.2 | amd64 | 18.04 | 7.5.0 | 0.26.1 | 2.7.17 | 3.8.0 | - | - | - | - |
399 | | 2.0.1 | amd64 | 18.04 | 7.5.0 | 0.26.1 | 2.7.17 | 3.8.0 | - | - | - | - |
400 | | 2.0.0 | amd64 | 18.04 | 7.5.0 | 0.26.1 | 2.7.17 | 3.8.0 | - | - | - | - |
401 |
402 |
403 |
404 |
405 | ## Acknowledgements
406 |
407 | This work is accomplished within the projects [6GEM](https://6gem.de/) (FKZ 16KISK038) and [UNICAR*agil*](https://www.unicaragil.de/) (FKZ 16EMO0284K). We acknowledge the financial support for the projects by the Federal Ministry of Education and Research of Germany (BMBF).
408 |
409 |
410 | ## Notice
411 |
412 | This repository is not endorsed by or otherwise affiliated with [TensorFlow](https://www.tensorflow.org) or Google. TensorFlow, the TensorFlow logo and any related marks are trademarks of Google Inc. [TensorFlow](https://github.com/tensorflow/tensorflow) is released under the [Apache License 2.0](https://github.com/tensorflow/tensorflow/blob/master/LICENSE).
413 |
--------------------------------------------------------------------------------
/docker/.Dockerfiles/.gitignore:
--------------------------------------------------------------------------------
1 | /*
2 | !.gitignore
3 | !/2.11.0/
4 | !/2.11.1/
5 | !/2.12.0/
6 | !/2.12.1/
7 | !/2.13.0/
8 |
--------------------------------------------------------------------------------
/docker/.Dockerfiles/2.11.0/bashrc:
--------------------------------------------------------------------------------
1 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | #
15 | # ==============================================================================
16 |
17 | # If not running interactively, don't do anything
18 | [ -z "$PS1" ] && return
19 |
20 | export PS1="\[\e[31m\]tf-docker\[\e[m\] \[\e[33m\]\w\[\e[m\] > "
21 | export TERM=xterm-256color
22 | alias grep="grep --color=auto"
23 | alias ls="ls --color=auto"
24 |
25 | echo -e "\e[1;31m"
26 | cat< /etc/ld.so.conf.d/z-cuda-stubs.conf \
111 | && ldconfig
112 |
113 | # Installs bazelisk
114 | RUN mkdir /bazel && \
115 | curl -fSsL -o /bazel/LICENSE.txt "https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE" && \
116 | mkdir /bazelisk && \
117 | curl -fSsL -o /bazelisk/LICENSE.txt "https://raw.githubusercontent.com/bazelbuild/bazelisk/master/LICENSE" && \
118 | curl -fSsL -o /usr/bin/bazel "https://github.com/bazelbuild/bazelisk/releases/download/v1.11.0/bazelisk-linux-arm64" && \
119 | chmod +x /usr/bin/bazel
120 |
121 | COPY bashrc /etc/bash.bashrc
122 | RUN chmod a+rwx /etc/bash.bashrc
123 |
--------------------------------------------------------------------------------
/docker/.Dockerfiles/2.11.0/dockerfiles/devel-cpu-ubuntu20.Dockerfile:
--------------------------------------------------------------------------------
1 | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | # ============================================================================
15 | #
16 | # THIS IS A GENERATED DOCKERFILE.
17 | #
18 | # This file was assembled from multiple pieces, whose use is documented
19 | # throughout. Please refer to the TensorFlow dockerfiles documentation
20 | # for more information.
21 |
22 | ARG UBUNTU_VERSION=20.04
23 |
24 | FROM ubuntu:${UBUNTU_VERSION} AS base
25 |
26 | ENV DEBIAN_FRONTEND=noninteractive
27 | RUN apt-get update && apt-get install -y --no-install-recommends \
28 | build-essential \
29 | clang-format \
30 | curl \
31 | git \
32 | libcurl3-dev \
33 | libfreetype6-dev \
34 | libhdf5-serial-dev \
35 | libzmq3-dev \
36 | pkg-config \
37 | rsync \
38 | software-properties-common \
39 | sudo \
40 | unzip \
41 | zip \
42 | zlib1g-dev \
43 | openjdk-8-jdk \
44 | openjdk-8-jre-headless \
45 | && \
46 | apt-get clean && \
47 | rm -rf /var/lib/apt/lists/*
48 |
49 | ENV CI_BUILD_PYTHON python
50 |
51 | # CACHE_STOP is used to rerun future commands, otherwise cloning tensorflow will be cached and will not pull the most recent version
52 | ARG CACHE_STOP=1
53 | # Check out TensorFlow source code if --build-arg CHECKOUT_TF_SRC=1
54 | ARG CHECKOUT_TF_SRC=0
55 | # In case of Python 2.7+ we need to add passwd entries for user and group id
56 | RUN chmod a+w /etc/passwd /etc/group
57 | RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone --depth=1 https://github.com/tensorflow/tensorflow.git /tensorflow_src || true
58 |
59 | # See http://bugs.python.org/issue19846
60 | ENV LANG C.UTF-8
61 |
62 | RUN apt-get update && apt-get install -y \
63 | python3 \
64 | python3-pip
65 |
66 | RUN python3 -m pip --no-cache-dir install --upgrade \
67 | "pip<20.3" \
68 | setuptools
69 |
70 | # Some TF tools expect a "python" binary
71 | RUN ln -s $(which python3) /usr/local/bin/python
72 |
73 | RUN apt-get update && apt-get install -y \
74 | build-essential \
75 | curl \
76 | git \
77 | wget \
78 | openjdk-8-jdk \
79 | python3-dev \
80 | virtualenv \
81 | swig
82 |
83 | RUN python3 -m pip install --upgrade pip && \
84 | python3 -m pip --no-cache-dir install \
85 | Pillow \
86 | h5py \
87 | tb-nightly \
88 | matplotlib \
89 | mock \
90 | numpy \
91 | scipy \
92 | scikit-learn \
93 | pandas \
94 | future \
95 | portpicker \
96 | enum34 \
97 | 'protobuf < 4'
98 |
99 | # Installs bazelisk
100 | RUN mkdir /bazel && \
101 | curl -fSsL -o /bazel/LICENSE.txt "https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE" && \
102 | mkdir /bazelisk && \
103 | curl -fSsL -o /bazelisk/LICENSE.txt "https://raw.githubusercontent.com/bazelbuild/bazelisk/master/LICENSE" && \
104 | curl -fSsL -o /usr/bin/bazel "https://github.com/bazelbuild/bazelisk/releases/download/v1.11.0/bazelisk-linux-amd64" && \
105 | chmod +x /usr/bin/bazel
106 |
107 | COPY bashrc /etc/bash.bashrc
108 | RUN chmod a+rwx /etc/bash.bashrc
109 |
--------------------------------------------------------------------------------
/docker/.Dockerfiles/2.11.0/dockerfiles/devel-cpu-ubuntu22.Dockerfile:
--------------------------------------------------------------------------------
1 | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | # ============================================================================
15 | #
16 | # THIS IS A GENERATED DOCKERFILE.
17 | #
18 | # This file was assembled from multiple pieces, whose use is documented
19 | # throughout. Please refer to the TensorFlow dockerfiles documentation
20 | # for more information.
21 |
22 | ARG UBUNTU_VERSION=22.04
23 |
24 | FROM ubuntu:${UBUNTU_VERSION} AS base
25 |
26 | ENV DEBIAN_FRONTEND=noninteractive
27 | RUN apt-get update && apt-get install -y --no-install-recommends \
28 | build-essential \
29 | clang-format \
30 | curl \
31 | git \
32 | libcurl3-dev \
33 | libfreetype6-dev \
34 | libhdf5-serial-dev \
35 | libzmq3-dev \
36 | pkg-config \
37 | rsync \
38 | software-properties-common \
39 | sudo \
40 | unzip \
41 | zip \
42 | zlib1g-dev \
43 | openjdk-8-jdk \
44 | openjdk-8-jre-headless \
45 | && \
46 | apt-get clean && \
47 | rm -rf /var/lib/apt/lists/*
48 |
49 | ENV CI_BUILD_PYTHON python
50 |
51 | # CACHE_STOP is used to rerun future commands, otherwise cloning tensorflow will be cached and will not pull the most recent version
52 | ARG CACHE_STOP=1
53 | # Check out TensorFlow source code if --build-arg CHECKOUT_TF_SRC=1
54 | ARG CHECKOUT_TF_SRC=0
55 | # In case of Python 2.7+ we need to add passwd entries for user and group id
56 | RUN chmod a+w /etc/passwd /etc/group
57 | RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone --depth=1 https://github.com/tensorflow/tensorflow.git /tensorflow_src || true
58 |
59 | # See http://bugs.python.org/issue19846
60 | ENV LANG C.UTF-8
61 |
62 | RUN apt-get update && apt-get install -y \
63 | python3 \
64 | python3-pip
65 |
66 | RUN python3 -m pip --no-cache-dir install --upgrade \
67 | "pip<20.3" \
68 | setuptools
69 |
70 | # Some TF tools expect a "python" binary
71 | RUN ln -s $(which python3) /usr/local/bin/python
72 |
73 | RUN apt-get update && apt-get install -y \
74 | build-essential \
75 | curl \
76 | git \
77 | wget \
78 | openjdk-8-jdk \
79 | python3-dev \
80 | virtualenv \
81 | swig
82 |
83 | RUN python3 -m pip install --upgrade pip && \
84 | python3 -m pip --no-cache-dir install \
85 | Pillow \
86 | h5py \
87 | tb-nightly \
88 | matplotlib \
89 | mock \
90 | numpy \
91 | scipy \
92 | scikit-learn \
93 | pandas \
94 | future \
95 | portpicker \
96 | enum34 \
97 | 'protobuf < 4'
98 |
99 | # Installs bazelisk
100 | RUN mkdir /bazel && \
101 | curl -fSsL -o /bazel/LICENSE.txt "https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE" && \
102 | mkdir /bazelisk && \
103 | curl -fSsL -o /bazelisk/LICENSE.txt "https://raw.githubusercontent.com/bazelbuild/bazelisk/master/LICENSE" && \
104 | curl -fSsL -o /usr/bin/bazel "https://github.com/bazelbuild/bazelisk/releases/download/v1.11.0/bazelisk-linux-amd64" && \
105 | chmod +x /usr/bin/bazel
106 |
107 | COPY bashrc /etc/bash.bashrc
108 | RUN chmod a+rwx /etc/bash.bashrc
109 |
--------------------------------------------------------------------------------
/docker/.Dockerfiles/2.11.0/dockerfiles/devel-gpu+cu118-ubuntu20.Dockerfile:
--------------------------------------------------------------------------------
1 | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | # ============================================================================
15 | #
16 | # THIS IS A GENERATED DOCKERFILE.
17 | #
18 | # This file was assembled from multiple pieces, whose use is documented
19 | # throughout. Please refer to the TensorFlow dockerfiles documentation
20 | # for more information.
21 |
22 | ARG UBUNTU_VERSION=20.04
23 |
24 | ARG ARCH=
25 | ARG CUDA=11.8
26 | FROM nvidia/cuda${ARCH:+-$ARCH}:${CUDA}.0-devel-ubuntu${UBUNTU_VERSION} as base
27 | # ARCH and CUDA are specified again because the FROM directive resets ARGs
28 | # (but their default value is retained if set previously)
29 | ARG ARCH
30 | ARG CUDA
31 | ARG CUDNN=8.6.0.163-1
32 | ARG CUDNN_MAJOR_VERSION=8
33 | ARG LIB_DIR_PREFIX=x86_64
34 | ARG LIBNVINFER=8.5.3-1
35 | ARG LIBNVINFER_MAJOR_VERSION=8
36 |
37 | # Needed for string substitution
38 | SHELL ["/bin/bash", "-c"]
39 | ENV DEBIAN_FRONTEND=noninteractive
40 | RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub && \
41 | apt-get update && apt-get install -y --no-install-recommends \
42 | build-essential \
43 | clang-format \
44 | cuda-command-line-tools-${CUDA/./-} \
45 | libcublas-${CUDA/./-} \
46 | libcublas-dev-${CUDA/./-} \
47 | cuda-nvprune-${CUDA/./-} \
48 | cuda-nvrtc-${CUDA/./-} \
49 | cuda-nvrtc-dev-${CUDA/./-} \
50 | cuda-cudart-dev-${CUDA/./-} \
51 | libcufft-dev-${CUDA/./-} \
52 | libcurand-dev-${CUDA/./-} \
53 | libcusolver-dev-${CUDA/./-} \
54 | libcusparse-dev-${CUDA/./-} \
55 | libcudnn8=${CUDNN}+cuda${CUDA} \
56 | libcudnn8-dev=${CUDNN}+cuda${CUDA} \
57 | libcurl3-dev \
58 | libfreetype6-dev \
59 | libhdf5-serial-dev \
60 | libzmq3-dev \
61 | pkg-config \
62 | rsync \
63 | software-properties-common \
64 | unzip \
65 | zip \
66 | zlib1g-dev \
67 | wget \
68 | git \
69 | && \
70 | find /usr/local/cuda-${CUDA}/lib64/ -type f -name 'lib*_static.a' -not -name 'libcudart_static.a' -delete
71 |
72 | # Install TensorRT if not building for PowerPC
73 | # NOTE: libnvinfer uses cuda11.1 versions
74 | RUN apt-get update && \
75 | apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub && \
76 | echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/tensorRT.list && \
77 | apt-get update && \
78 | apt-get install -y --no-install-recommends libnvinfer${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda11.8 \
79 | libnvinfer-dev=${LIBNVINFER}+cuda11.8 \
80 | libnvinfer-plugin-dev=${LIBNVINFER}+cuda11.8 \
81 | libnvinfer-plugin${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda11.8 \
82 | && apt-get clean \
83 | && rm -rf /var/lib/apt/lists/*
84 |
85 | # Configure the build for our CUDA configuration.
86 | ENV LD_LIBRARY_PATH /usr/local/cuda-11.8/targets/x86_64-linux/lib:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:/usr/include/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH:/usr/local/cuda/lib64/stubs:/usr/local/cuda-11.8/lib64:/usr/local/cuda-11.8/lib64
87 | ENV TF_NEED_CUDA 1
88 | ENV TF_NEED_TENSORRT 1
89 | ENV TF_CUDA_VERSION=${CUDA}
90 | ENV TF_CUDNN_VERSION=${CUDNN_MAJOR_VERSION}
91 | # CACHE_STOP is used to rerun future commands, otherwise cloning tensorflow will be cached and will not pull the most recent version
92 | ARG CACHE_STOP=1
93 | # Check out TensorFlow source code if --build-arg CHECKOUT_TF_SRC=1
94 | ARG CHECKOUT_TF_SRC=0
95 | RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone --depth=1 https://github.com/tensorflow/tensorflow.git /tensorflow_src || true
96 |
97 | # Link the libcuda stub to the location where tensorflow is searching for it and reconfigure
98 | # dynamic linker run-time bindings
99 | RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1 \
100 | && echo "/usr/local/cuda/lib64/stubs" > /etc/ld.so.conf.d/z-cuda-stubs.conf \
101 | && ldconfig
102 |
103 | # See http://bugs.python.org/issue19846
104 | ENV LANG C.UTF-8
105 |
106 | RUN apt-get update && apt-get install -y \
107 | python3 \
108 | python3-pip
109 |
110 | RUN python3 -m pip --no-cache-dir install --upgrade \
111 | "pip<20.3" \
112 | setuptools
113 |
114 | # Some TF tools expect a "python" binary
115 | RUN ln -s $(which python3) /usr/local/bin/python
116 |
117 | RUN apt-get update && apt-get install -y \
118 | build-essential \
119 | curl \
120 | git \
121 | wget \
122 | openjdk-8-jdk \
123 | python3-dev \
124 | virtualenv \
125 | swig
126 |
127 | RUN python3 -m pip install --upgrade pip && \
128 | python3 -m pip --no-cache-dir install \
129 | Pillow \
130 | h5py \
131 | tb-nightly \
132 | matplotlib \
133 | mock \
134 | numpy \
135 | scipy \
136 | scikit-learn \
137 | pandas \
138 | future \
139 | portpicker \
140 | enum34 \
141 | 'protobuf < 4'
142 |
143 | # Installs bazelisk
144 | RUN mkdir /bazel && \
145 | curl -fSsL -o /bazel/LICENSE.txt "https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE" && \
146 | mkdir /bazelisk && \
147 | curl -fSsL -o /bazelisk/LICENSE.txt "https://raw.githubusercontent.com/bazelbuild/bazelisk/master/LICENSE" && \
148 | curl -fSsL -o /usr/bin/bazel "https://github.com/bazelbuild/bazelisk/releases/download/v1.11.0/bazelisk-linux-amd64" && \
149 | chmod +x /usr/bin/bazel
150 |
151 | COPY bashrc /etc/bash.bashrc
152 | RUN chmod a+rwx /etc/bash.bashrc
153 |
--------------------------------------------------------------------------------
/docker/.Dockerfiles/2.11.0/dockerfiles/devel-gpu+cu118-ubuntu22.Dockerfile:
--------------------------------------------------------------------------------
1 | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | # ============================================================================
15 | #
16 | # THIS IS A GENERATED DOCKERFILE.
17 | #
18 | # This file was assembled from multiple pieces, whose use is documented
19 | # throughout. Please refer to the TensorFlow dockerfiles documentation
20 | # for more information.
21 |
22 | ARG UBUNTU_VERSION=22.04
23 |
24 | ARG ARCH=
25 | ARG CUDA=11.8
26 | FROM nvidia/cuda${ARCH:+-$ARCH}:${CUDA}.0-devel-ubuntu${UBUNTU_VERSION} as base
27 | # ARCH and CUDA are specified again because the FROM directive resets ARGs
28 | # (but their default value is retained if set previously)
29 | ARG ARCH
30 | ARG CUDA
31 | ARG CUDNN=8.6.0.163-1
32 | ARG CUDNN_MAJOR_VERSION=8
33 | ARG LIB_DIR_PREFIX=x86_64
34 | ARG LIBNVINFER=8.5.3-1
35 | ARG LIBNVINFER_MAJOR_VERSION=8
36 |
37 | # Needed for string substitution
38 | SHELL ["/bin/bash", "-c"]
39 | ENV DEBIAN_FRONTEND=noninteractive
40 | RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub && \
41 | apt-get update && apt-get install -y --no-install-recommends \
42 | build-essential \
43 | clang-format \
44 | cuda-command-line-tools-${CUDA/./-} \
45 | libcublas-${CUDA/./-} \
46 | libcublas-dev-${CUDA/./-} \
47 | cuda-nvprune-${CUDA/./-} \
48 | cuda-nvrtc-${CUDA/./-} \
49 | cuda-nvrtc-dev-${CUDA/./-} \
50 | cuda-cudart-dev-${CUDA/./-} \
51 | libcufft-dev-${CUDA/./-} \
52 | libcurand-dev-${CUDA/./-} \
53 | libcusolver-dev-${CUDA/./-} \
54 | libcusparse-dev-${CUDA/./-} \
55 | libcudnn8=${CUDNN}+cuda${CUDA} \
56 | libcudnn8-dev=${CUDNN}+cuda${CUDA} \
57 | libcurl3-dev \
58 | libfreetype6-dev \
59 | libhdf5-serial-dev \
60 | libzmq3-dev \
61 | pkg-config \
62 | rsync \
63 | software-properties-common \
64 | unzip \
65 | zip \
66 | zlib1g-dev \
67 | wget \
68 | git \
69 | && \
70 | find /usr/local/cuda-${CUDA}/lib64/ -type f -name 'lib*_static.a' -not -name 'libcudart_static.a' -delete
71 |
72 | # Install TensorRT if not building for PowerPC
73 | # NOTE: libnvinfer uses cuda11.1 versions
74 | RUN apt-get update && \
75 | apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub && \
76 | echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/tensorRT.list && \
77 | apt-get update && \
78 | apt-get install -y --no-install-recommends libnvinfer${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda11.8 \
79 | libnvinfer-dev=${LIBNVINFER}+cuda11.8 \
80 | libnvinfer-plugin-dev=${LIBNVINFER}+cuda11.8 \
81 | libnvinfer-plugin${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda11.8 \
82 | && apt-get clean \
83 | && rm -rf /var/lib/apt/lists/*
84 |
85 | # Configure the build for our CUDA configuration.
86 | ENV LD_LIBRARY_PATH /usr/local/cuda-11.8/targets/x86_64-linux/lib:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:/usr/include/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH:/usr/local/cuda/lib64/stubs:/usr/local/cuda-11.8/lib64:/usr/local/cuda-11.8/lib64
87 | ENV TF_NEED_CUDA 1
88 | ENV TF_NEED_TENSORRT 1
89 | ENV TF_CUDA_VERSION=${CUDA}
90 | ENV TF_CUDNN_VERSION=${CUDNN_MAJOR_VERSION}
91 | # CACHE_STOP is used to rerun future commands, otherwise cloning tensorflow will be cached and will not pull the most recent version
92 | ARG CACHE_STOP=1
93 | # Check out TensorFlow source code if --build-arg CHECKOUT_TF_SRC=1
94 | ARG CHECKOUT_TF_SRC=0
95 | RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone --depth=1 https://github.com/tensorflow/tensorflow.git /tensorflow_src || true
96 |
97 | # Link the libcuda stub to the location where tensorflow is searching for it and reconfigure
98 | # dynamic linker run-time bindings
99 | RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1 \
100 | && echo "/usr/local/cuda/lib64/stubs" > /etc/ld.so.conf.d/z-cuda-stubs.conf \
101 | && ldconfig
102 |
103 | # See http://bugs.python.org/issue19846
104 | ENV LANG C.UTF-8
105 |
106 | RUN apt-get update && apt-get install -y \
107 | python3 \
108 | python3-pip
109 |
110 | RUN python3 -m pip --no-cache-dir install --upgrade \
111 | "pip<20.3" \
112 | setuptools
113 |
114 | # Some TF tools expect a "python" binary
115 | RUN ln -s $(which python3) /usr/local/bin/python
116 |
117 | RUN apt-get update && apt-get install -y \
118 | build-essential \
119 | curl \
120 | git \
121 | wget \
122 | openjdk-8-jdk \
123 | python3-dev \
124 | virtualenv \
125 | swig
126 |
127 | RUN python3 -m pip install --upgrade pip && \
128 | python3 -m pip --no-cache-dir install \
129 | Pillow \
130 | h5py \
131 | tb-nightly \
132 | matplotlib \
133 | mock \
134 | numpy \
135 | scipy \
136 | scikit-learn \
137 | pandas \
138 | future \
139 | portpicker \
140 | enum34 \
141 | 'protobuf < 4'
142 |
143 | # Installs bazelisk
144 | RUN mkdir /bazel && \
145 | curl -fSsL -o /bazel/LICENSE.txt "https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE" && \
146 | mkdir /bazelisk && \
147 | curl -fSsL -o /bazelisk/LICENSE.txt "https://raw.githubusercontent.com/bazelbuild/bazelisk/master/LICENSE" && \
148 | curl -fSsL -o /usr/bin/bazel "https://github.com/bazelbuild/bazelisk/releases/download/v1.11.0/bazelisk-linux-amd64" && \
149 | chmod +x /usr/bin/bazel
150 |
151 | COPY bashrc /etc/bash.bashrc
152 | RUN chmod a+rwx /etc/bash.bashrc
153 |
--------------------------------------------------------------------------------
/docker/.Dockerfiles/2.11.1/bashrc:
--------------------------------------------------------------------------------
1 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | #
15 | # ==============================================================================
16 |
17 | # If not running interactively, don't do anything
18 | [ -z "$PS1" ] && return
19 |
20 | export PS1="\[\e[31m\]tf-docker\[\e[m\] \[\e[33m\]\w\[\e[m\] > "
21 | export TERM=xterm-256color
22 | alias grep="grep --color=auto"
23 | alias ls="ls --color=auto"
24 |
25 | echo -e "\e[1;31m"
26 | cat< /etc/apt/sources.list.d/tensorRT.list && \
78 | apt-get update && \
79 | apt-get install -y --no-install-recommends libnvinfer${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda11.0 \
80 | libnvinfer-dev=${LIBNVINFER}+cuda11.0 \
81 | libnvinfer-plugin-dev=${LIBNVINFER}+cuda11.0 \
82 | libnvinfer-plugin${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda11.0 \
83 | && apt-get clean \
84 | && rm -rf /var/lib/apt/lists/*; }
85 |
86 | # Configure the build for our CUDA configuration.
87 | ENV LD_LIBRARY_PATH /usr/local/cuda-11.0/targets/x86_64-linux/lib:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:/usr/include/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH:/usr/local/cuda/lib64/stubs:/usr/local/cuda-11.0/lib64:/usr/local/cuda-11.2/lib64
88 | ENV TF_NEED_CUDA 1
89 | ENV TF_NEED_TENSORRT 1
90 | ENV TF_CUDA_VERSION=${CUDA}
91 | ENV TF_CUDNN_VERSION=${CUDNN_MAJOR_VERSION}
92 | # CACHE_STOP is used to rerun future commands, otherwise cloning tensorflow will be cached and will not pull the most recent version
93 | ARG CACHE_STOP=1
94 | # Check out TensorFlow source code if --build-arg CHECKOUT_TF_SRC=1
95 | ARG CHECKOUT_TF_SRC=0
96 | RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone --depth=1 https://github.com/tensorflow/tensorflow.git /tensorflow_src || true
97 |
98 | # Link the libcuda stub to the location where tensorflow is searching for it and reconfigure
99 | # dynamic linker run-time bindings
100 | RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1 \
101 | && echo "/usr/local/cuda/lib64/stubs" > /etc/ld.so.conf.d/z-cuda-stubs.conf \
102 | && ldconfig
103 |
104 | # See http://bugs.python.org/issue19846
105 | ENV LANG C.UTF-8
106 |
107 | RUN apt-get update && apt-get install -y \
108 | python3 \
109 | python3-pip
110 |
111 | RUN python3 -m pip --no-cache-dir install --upgrade \
112 | "pip<20.3" \
113 | setuptools
114 |
115 | # Some TF tools expect a "python" binary
116 | RUN ln -s $(which python3) /usr/local/bin/python
117 |
118 | RUN apt-get update && apt-get install -y \
119 | build-essential \
120 | curl \
121 | git \
122 | wget \
123 | openjdk-8-jdk \
124 | python3-dev \
125 | virtualenv \
126 | swig
127 |
128 | RUN python3 -m pip --no-cache-dir install \
129 | Pillow \
130 | h5py \
131 | tb-nightly \
132 | matplotlib \
133 | mock \
134 | 'numpy<1.19.0' \
135 | scipy \
136 | scikit-learn \
137 | pandas \
138 | future \
139 | portpicker \
140 | enum34 \
141 | 'protobuf < 4'
142 |
143 | # Installs bazelisk
144 | RUN mkdir /bazel && \
145 | curl -fSsL -o /bazel/LICENSE.txt "https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE" && \
146 | mkdir /bazelisk && \
147 | curl -fSsL -o /bazelisk/LICENSE.txt "https://raw.githubusercontent.com/bazelbuild/bazelisk/master/LICENSE" && \
148 | curl -fSsL -o /usr/bin/bazel "https://github.com/bazelbuild/bazelisk/releases/download/v1.11.0/bazelisk-linux-amd64" && \
149 | chmod +x /usr/bin/bazel
150 |
151 | COPY bashrc /etc/bash.bashrc
152 | RUN chmod a+rwx /etc/bash.bashrc
153 |
--------------------------------------------------------------------------------
/docker/.Dockerfiles/2.12.0/bashrc:
--------------------------------------------------------------------------------
1 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | #
15 | # ==============================================================================
16 |
17 | # If not running interactively, don't do anything
18 | [ -z "$PS1" ] && return
19 |
20 | export PS1="\[\e[31m\]tf-docker\[\e[m\] \[\e[33m\]\w\[\e[m\] > "
21 | export TERM=xterm-256color
22 | alias grep="grep --color=auto"
23 | alias ls="ls --color=auto"
24 |
25 | echo -e "\e[1;31m"
26 | cat< /etc/apt/sources.list.d/tensorRT.list && \
77 | apt-get update && \
78 | apt-get install -y --no-install-recommends libnvinfer${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda11.8 \
79 | libnvinfer-dev=${LIBNVINFER}+cuda11.8 \
80 | libnvinfer-plugin-dev=${LIBNVINFER}+cuda11.8 \
81 | libnvinfer-plugin${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda11.8 \
82 | && apt-get clean \
83 | && rm -rf /var/lib/apt/lists/*; }
84 |
85 | # Configure the build for our CUDA configuration.
86 | ENV LD_LIBRARY_PATH /usr/local/cuda-11.8/targets/x86_64-linux/lib:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:/usr/include/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH:/usr/local/cuda/lib64/stubs:/usr/local/cuda-11.8/lib64:/usr/local/cuda-11.2/lib64
87 | ENV TF_NEED_CUDA 1
88 | ENV TF_NEED_TENSORRT 1
89 | ENV TF_CUDA_VERSION=${CUDA}
90 | ENV TF_CUDNN_VERSION=${CUDNN_MAJOR_VERSION}
91 | # CACHE_STOP is used to rerun future commands, otherwise cloning tensorflow will be cached and will not pull the most recent version
92 | ARG CACHE_STOP=1
93 | # Check out TensorFlow source code if --build-arg CHECKOUT_TF_SRC=1
94 | ARG CHECKOUT_TF_SRC=0
95 | RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone --depth=1 https://github.com/tensorflow/tensorflow.git /tensorflow_src || true
96 |
97 | # Link the libcuda stub to the location where tensorflow is searching for it and reconfigure
98 | # dynamic linker run-time bindings
99 | RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1 \
100 | && echo "/usr/local/cuda/lib64/stubs" > /etc/ld.so.conf.d/z-cuda-stubs.conf \
101 | && ldconfig
102 |
103 | # See http://bugs.python.org/issue19846
104 | ENV LANG C.UTF-8
105 |
106 | RUN apt-get update && apt-get install -y \
107 | python3 \
108 | python3-pip
109 |
110 | RUN python3 -m pip --no-cache-dir install --upgrade \
111 | "pip<20.3" \
112 | setuptools
113 |
114 | # Some TF tools expect a "python" binary
115 | RUN ln -s $(which python3) /usr/local/bin/python
116 |
117 | RUN apt-get update && apt-get install -y \
118 | build-essential \
119 | curl \
120 | git \
121 | wget \
122 | openjdk-8-jdk \
123 | python3-dev \
124 | virtualenv \
125 | swig
126 |
127 | RUN python3 -m pip --no-cache-dir install \
128 | Pillow \
129 | h5py \
130 | keras_preprocessing \
131 | tb-nightly \
132 | matplotlib \
133 | mock \
134 | 'numpy<1.19.0' \
135 | scipy \
136 | scikit-learn \
137 | pandas \
138 | future \
139 | portpicker \
140 | enum34
141 |
142 | # Installs bazelisk
143 | RUN mkdir /bazel && \
144 | curl -fSsL -o /bazel/LICENSE.txt "https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE" && \
145 | mkdir /bazelisk && \
146 | curl -fSsL -o /bazelisk/LICENSE.txt "https://raw.githubusercontent.com/bazelbuild/bazelisk/master/LICENSE" && \
147 | curl -fSsL -o /usr/bin/bazel "https://github.com/bazelbuild/bazelisk/releases/download/v1.11.0/bazelisk-linux-amd64" && \
148 | chmod +x /usr/bin/bazel
149 |
150 | COPY bashrc /etc/bash.bashrc
151 | RUN chmod a+rwx /etc/bash.bashrc
152 |
--------------------------------------------------------------------------------
/docker/.Dockerfiles/2.12.1/bashrc:
--------------------------------------------------------------------------------
1 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | #
15 | # ==============================================================================
16 |
17 | # If not running interactively, don't do anything
18 | [ -z "$PS1" ] && return
19 |
20 | export PS1="\[\e[31m\]tf-docker\[\e[m\] \[\e[33m\]\w\[\e[m\] > "
21 | export TERM=xterm-256color
22 | alias grep="grep --color=auto"
23 | alias ls="ls --color=auto"
24 |
25 | echo -e "\e[1;31m"
26 | cat< /etc/apt/sources.list.d/tensorRT.list && \
77 | apt-get update && \
78 | apt-get install -y --no-install-recommends libnvinfer${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda11.8 \
79 | libnvinfer-dev=${LIBNVINFER}+cuda11.8 \
80 | libnvinfer-plugin-dev=${LIBNVINFER}+cuda11.8 \
81 | libnvinfer-plugin${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda11.8 \
82 | && apt-get clean \
83 | && rm -rf /var/lib/apt/lists/*; }
84 |
85 | # Configure the build for our CUDA configuration.
86 | ENV LD_LIBRARY_PATH /usr/local/cuda-11.8/targets/x86_64-linux/lib:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:/usr/include/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH:/usr/local/cuda/lib64/stubs:/usr/local/cuda-11.8/lib64:/usr/local/cuda-11.2/lib64
87 | ENV TF_NEED_CUDA 1
88 | ENV TF_NEED_TENSORRT 1
89 | ENV TF_CUDA_VERSION=${CUDA}
90 | ENV TF_CUDNN_VERSION=${CUDNN_MAJOR_VERSION}
91 | # CACHE_STOP is used to rerun future commands, otherwise cloning tensorflow will be cached and will not pull the most recent version
92 | ARG CACHE_STOP=1
93 | # Check out TensorFlow source code if --build-arg CHECKOUT_TF_SRC=1
94 | ARG CHECKOUT_TF_SRC=0
95 | RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone --depth=1 https://github.com/tensorflow/tensorflow.git /tensorflow_src || true
96 |
97 | # Link the libcuda stub to the location where tensorflow is searching for it and reconfigure
98 | # dynamic linker run-time bindings
99 | RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1 \
100 | && echo "/usr/local/cuda/lib64/stubs" > /etc/ld.so.conf.d/z-cuda-stubs.conf \
101 | && ldconfig
102 |
103 | # See http://bugs.python.org/issue19846
104 | ENV LANG C.UTF-8
105 |
106 | RUN apt-get update && apt-get install -y \
107 | python3 \
108 | python3-pip
109 |
110 | RUN python3 -m pip --no-cache-dir install --upgrade \
111 | "pip<20.3" \
112 | setuptools
113 |
114 | # Some TF tools expect a "python" binary
115 | RUN ln -s $(which python3) /usr/local/bin/python
116 |
117 | RUN apt-get update && apt-get install -y \
118 | build-essential \
119 | curl \
120 | git \
121 | wget \
122 | openjdk-8-jdk \
123 | python3-dev \
124 | virtualenv \
125 | swig
126 |
127 | RUN python3 -m pip --no-cache-dir install \
128 | Pillow \
129 | h5py \
130 | keras_preprocessing \
131 | tb-nightly \
132 | matplotlib \
133 | mock \
134 | 'numpy<1.19.0' \
135 | scipy \
136 | scikit-learn \
137 | pandas \
138 | future \
139 | portpicker \
140 | enum34
141 |
142 | # Installs bazelisk
143 | RUN mkdir /bazel && \
144 | curl -fSsL -o /bazel/LICENSE.txt "https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE" && \
145 | mkdir /bazelisk && \
146 | curl -fSsL -o /bazelisk/LICENSE.txt "https://raw.githubusercontent.com/bazelbuild/bazelisk/master/LICENSE" && \
147 | curl -fSsL -o /usr/bin/bazel "https://github.com/bazelbuild/bazelisk/releases/download/v1.11.0/bazelisk-linux-amd64" && \
148 | chmod +x /usr/bin/bazel
149 |
150 | COPY bashrc /etc/bash.bashrc
151 | RUN chmod a+rwx /etc/bash.bashrc
152 |
--------------------------------------------------------------------------------
/docker/.Dockerfiles/2.13.0/bashrc:
--------------------------------------------------------------------------------
1 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | #
15 | # ==============================================================================
16 |
17 | # If not running interactively, don't do anything
18 | [ -z "$PS1" ] && return
19 |
20 | export PS1="\[\e[31m\]tf-docker\[\e[m\] \[\e[33m\]\w\[\e[m\] > "
21 | export TERM=xterm-256color
22 | alias grep="grep --color=auto"
23 | alias ls="ls --color=auto"
24 |
25 | echo -e "\e[1;31m"
26 | cat< /etc/apt/sources.list.d/tensorRT.list && \
77 | apt-get update && \
78 | apt-get install -y --no-install-recommends libnvinfer${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda11.8 \
79 | libnvinfer-dev=${LIBNVINFER}+cuda11.8 \
80 | libnvinfer-plugin-dev=${LIBNVINFER}+cuda11.8 \
81 | libnvinfer-plugin${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda11.8 \
82 | && apt-get clean \
83 | && rm -rf /var/lib/apt/lists/*; }
84 |
85 | # Configure the build for our CUDA configuration.
86 | ENV LD_LIBRARY_PATH /usr/local/cuda-11.8/targets/x86_64-linux/lib:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:/usr/include/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH:/usr/local/cuda/lib64/stubs:/usr/local/cuda-11.8/lib64:/usr/local/cuda-11.2/lib64
87 | ENV TF_NEED_CUDA 1
88 | ENV TF_NEED_TENSORRT 1
89 | ENV TF_CUDA_VERSION=${CUDA}
90 | ENV TF_CUDNN_VERSION=${CUDNN_MAJOR_VERSION}
91 | # CACHE_STOP is used to rerun future commands, otherwise cloning tensorflow will be cached and will not pull the most recent version
92 | ARG CACHE_STOP=1
93 | # Check out TensorFlow source code if --build-arg CHECKOUT_TF_SRC=1
94 | ARG CHECKOUT_TF_SRC=0
95 | RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone --depth=1 https://github.com/tensorflow/tensorflow.git /tensorflow_src || true
96 |
97 | # Link the libcuda stub to the location where tensorflow is searching for it and reconfigure
98 | # dynamic linker run-time bindings
99 | RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1 \
100 | && echo "/usr/local/cuda/lib64/stubs" > /etc/ld.so.conf.d/z-cuda-stubs.conf \
101 | && ldconfig
102 |
103 | # See http://bugs.python.org/issue19846
104 | ENV LANG C.UTF-8
105 |
106 | RUN apt-get update && apt-get install -y \
107 | python3 \
108 | python3-pip
109 |
110 | RUN python3 -m pip --no-cache-dir install --upgrade \
111 | "pip<20.3" \
112 | setuptools
113 |
114 | # Some TF tools expect a "python" binary
115 | RUN ln -s $(which python3) /usr/local/bin/python
116 |
117 | RUN apt-get update && apt-get install -y \
118 | build-essential \
119 | curl \
120 | git \
121 | wget \
122 | openjdk-8-jdk \
123 | python3-dev \
124 | virtualenv \
125 | swig
126 |
127 | RUN python3 -m pip --no-cache-dir install \
128 | Pillow \
129 | h5py \
130 | keras_preprocessing \
131 | tb-nightly \
132 | matplotlib \
133 | mock \
134 | 'numpy<1.19.0' \
135 | scipy \
136 | scikit-learn \
137 | pandas \
138 | future \
139 | portpicker \
140 | enum34
141 |
142 | # Installs bazelisk
143 | RUN mkdir /bazel && \
144 | curl -fSsL -o /bazel/LICENSE.txt "https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE" && \
145 | mkdir /bazelisk && \
146 | curl -fSsL -o /bazelisk/LICENSE.txt "https://raw.githubusercontent.com/bazelbuild/bazelisk/master/LICENSE" && \
147 | curl -fSsL -o /usr/bin/bazel "https://github.com/bazelbuild/bazelisk/releases/download/v1.11.0/bazelisk-linux-amd64" && \
148 | chmod +x /usr/bin/bazel
149 |
150 | COPY bashrc /etc/bash.bashrc
151 | RUN chmod a+rwx /etc/bash.bashrc
152 |
--------------------------------------------------------------------------------
/docker/.gitignore:
--------------------------------------------------------------------------------
1 | .log/
--------------------------------------------------------------------------------
/docker/DEBIAN/control:
--------------------------------------------------------------------------------
1 | Package: libtensorflow-cc
2 | Version: TF_VERSION
3 | Architecture: TARGETARCH
4 | Maintainer: Lennart Reiher
5 | Uploaders: Lennart Reiher , Jean-Pierre Busch
6 | Description: TensorFlow C++ Library
7 |
--------------------------------------------------------------------------------
/docker/Dockerfile:
--------------------------------------------------------------------------------
1 | # ==============================================================================
2 | # MIT License
3 | # Copyright 2022 Institute for Automotive Engineering of RWTH Aachen University.
4 | # Permission is hereby granted, free of charge, to any person obtaining a copy
5 | # of this software and associated documentation files (the "Software"), to deal
6 | # in the Software without restriction, including without limitation the rights
7 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | # copies of the Software, and to permit persons to whom the Software is
9 | # furnished to do so, subject to the following conditions:
10 | # The above copyright notice and this permission notice shall be included in all
11 | # copies or substantial portions of the Software.
12 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18 | # SOFTWARE.
19 | # ==============================================================================
20 |
21 | # --- build stage for building libtensorflow_cc --------------------------------
22 | ARG TARGETARCH
23 | ARG TF_VERSION=master
24 | ARG GPU_POSTFIX=-gpu
25 | FROM tensorflow/tensorflow:${TF_VERSION}-devel${GPU_POSTFIX}-${TARGETARCH} as build
26 |
27 | ARG TARGETARCH
28 | ARG TF_VERSION
29 | ARG GPU_POSTFIX
30 |
31 | # clone TensorFlow
32 | RUN git clone --branch v${TF_VERSION} --depth=1 https://github.com/tensorflow/tensorflow.git /tensorflow
33 | WORKDIR /tensorflow
34 |
35 | # fix build issue in 2.10.0, 2.10.1
36 | # https://github.com/tensorflow/tensorflow/issues/57826
37 | RUN if [ "${TF_VERSION}" = "2.10.0" ] || [ "${TF_VERSION}" = "2.10.1" ]; then \
38 | git fetch --depth=1 origin b1bd1d6beeac169ce669f81dcbf3c48899ca1ed0 && \
39 | git checkout FETCH_HEAD -- tensorflow/BUILD; \
40 | fi
41 |
42 | # fix GPU-version build issue in 2.11.1, 2.12.0, 2.12.1, 2.13.0
43 | # https://github.com/tensorflow/tensorflow/issues/60398#issuecomment-1537040602
44 | COPY patch/ patch/
45 | RUN if [ "${TF_VERSION}" = "2.11.1" ] || [ "${TF_VERSION}" = "2.12.0" ] || [ "${TF_VERSION}" = "2.12.1" ] || [ "${TF_VERSION}" = "2.13.0" ]; then \
46 | git apply patch/${TF_VERSION}/workspace2.bzl.patch; \
47 | fi
48 |
49 | # configure compilation
50 | ENV PYTHON_BIN_PATH=/usr/bin/python3
51 | ENV PYTHON_LIB_PATH=/usr/lib/python3/dist-packages
52 | ENV TF_NEED_ROCM=0
53 | ARG TF_CUDA_COMPUTE_CAPABILITIES=6.0,6.1,7.0,7.5,8.0,8.6,8.9,9.0
54 | ENV TF_CUDA_COMPUTE_CAPABILITIES=${TF_CUDA_COMPUTE_CAPABILITIES}
55 | ENV TF_CUDA_CLANG=0
56 | ENV GCC_HOST_COMPILER_PATH=/usr/bin/gcc
57 | ENV CC_OPT_FLAGS="-march=native -Wno-sign-compare"
58 | ENV TF_SET_ANDROID_WORKSPACE=0
59 | RUN ./configure
60 |
61 | # build C++ library
62 | # fix runtime issue in 2.10.0, 2.10.1, 2.11.0, 2.11.1, 2.12.0, 2.12.1, 2.13.0 by building non-monolithic
63 | # https://github.com/tensorflow/tensorflow/issues/59081
64 | ARG JOBS="auto"
65 | RUN if [ "${GPU_POSTFIX}" = "-gpu" ]; then \
66 | if [ "${TF_VERSION}" = "2.10.0" ] || [ "${TF_VERSION}" = "2.10.1" ] || [ "${TF_VERSION}" = "2.11.0" ] || [ "${TF_VERSION}" = "2.11.1" ] || [ "${TF_VERSION}" = "2.12.0" ] || [ "${TF_VERSION}" = "2.12.1" ] || [ "${TF_VERSION}" = "2.13.0" ]; then \
67 | bazel build --jobs ${JOBS} --config=cuda --config=opt --verbose_failures tensorflow:libtensorflow_cc.so tensorflow:install_headers; \
68 | else \
69 | bazel build --jobs ${JOBS} --config=cuda --config=opt --config=monolithic --verbose_failures tensorflow:libtensorflow_cc.so tensorflow:install_headers; \
70 | fi; \
71 | else \
72 | if [ "${TF_VERSION}" = "2.10.0" ] || [ "${TF_VERSION}" = "2.10.1" ] || [ "${TF_VERSION}" = "2.11.0" ] || [ "${TF_VERSION}" = "2.11.1" ] || [ "${TF_VERSION}" = "2.12.0" ] || [ "${TF_VERSION}" = "2.12.1" ] || [ "${TF_VERSION}" = "2.13.0" ]; then \
73 | bazel build --jobs ${JOBS} --config=opt --verbose_failures tensorflow:libtensorflow_cc.so tensorflow:install_headers; \
74 | else \
75 | bazel build --jobs ${JOBS} --config=opt --config=monolithic --verbose_failures tensorflow:libtensorflow_cc.so tensorflow:install_headers; \
76 | fi; \
77 | fi
78 |
79 | # move libtensorflow_cc to separate folder for easier Dockerfile COPY
80 | RUN mkdir -p bazel-bin/tensorflow/lib && \
81 | mv bazel-bin/tensorflow/libtensorflow_cc.so* bazel-bin/tensorflow/lib/ && \
82 | mv bazel-bin/tensorflow/libtensorflow_framework.so* bazel-bin/tensorflow/lib/ && \
83 | ln -sf libtensorflow_framework.so.2 bazel-bin/tensorflow/lib/libtensorflow_framework.so && \
84 | rm bazel-bin/tensorflow/lib/*params
85 |
86 | # build pip package
87 | # fix runtime issue in 2.10.0, 2.10.1, 2.11.0, 2.11.1, 2.12.0, 2.12.1, 2.13.0 by building non-monolithic
88 | # https://github.com/tensorflow/tensorflow/issues/59081
89 | ARG BUILD_PIP_PACKAGE=0
90 | RUN if [ "${BUILD_PIP_PACKAGE}" = "1" ]; then \
91 | if [ "${GPU_POSTFIX}" = "-gpu" ]; then \
92 | if [ "${TF_VERSION}" = "2.10.0" ] || [ "${TF_VERSION}" = "2.10.1" ] || [ "${TF_VERSION}" = "2.11.0" ] || [ "${TF_VERSION}" = "2.11.1" ] || [ "${TF_VERSION}" = "2.12.0" ] || [ "${TF_VERSION}" = "2.12.1" ] || [ "${TF_VERSION}" = "2.13.0" ]; then \
93 | bazel build --jobs ${JOBS} --config=cuda --config=opt --verbose_failures tensorflow/tools/pip_package:build_pip_package; \
94 | else \
95 | bazel build --jobs ${JOBS} --config=cuda --config=opt --config=monolithic --verbose_failures tensorflow/tools/pip_package:build_pip_package; \
96 | fi; \
97 | else \
98 | if [ "${TF_VERSION}" = "2.10.0" ] || [ "${TF_VERSION}" = "2.10.1" ] || [ "${TF_VERSION}" = "2.11.0" ] || [ "${TF_VERSION}" = "2.11.1" ] || [ "${TF_VERSION}" = "2.12.0" ] || [ "${TF_VERSION}" = "2.12.1" ] || [ "${TF_VERSION}" = "2.13.0" ]; then \
99 | bazel build --jobs ${JOBS} --config=opt --verbose_failures tensorflow/tools/pip_package:build_pip_package; \
100 | else \
101 | bazel build --jobs ${JOBS} --config=opt --config=monolithic --verbose_failures tensorflow/tools/pip_package:build_pip_package; \
102 | fi; \
103 | fi; \
104 | pip install patchelf && \
105 | ./bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow/pip ; \
106 | else \
107 | mkdir -p /tmp/tensorflow/pip && \
108 | touch /tmp/tensorflow/pip/tensorflow-dummy.whl ; \
109 | fi
110 |
111 | # build protobuf from source, same version as TensorFlow is using
112 | WORKDIR /
113 | RUN apt-get install -y autoconf automake libtool curl make g++ unzip wget && \
114 | PROTOBUF_URL=$(grep -Eho "https://github.com/protocolbuffers/protobuf/archive/.*\.(zip|tar.gz)" tensorflow/tensorflow/workspace*.bzl) && \
115 | PROTOBUF_VERSION=$(echo $PROTOBUF_URL | grep -Eo "([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}|[0-9a-f]{40})") && \
116 | wget -q $PROTOBUF_URL -O protobuf.archive && \
117 | (unzip -q protobuf.archive || tar -xzf protobuf.archive) && \
118 | rm protobuf.archive && \
119 | mv protobuf-$PROTOBUF_VERSION protobuf && \
120 | cd protobuf && \
121 | ./autogen.sh && \
122 | ./configure --prefix=/usr/local && \
123 | make -j $(nproc) && \
124 | make install && \
125 | ldconfig
126 |
127 | # --- deb-package stage providing libtensorflow-cc.deb -------------------------
128 | FROM ubuntu:focal as deb-package
129 |
130 | ARG TARGETARCH
131 | ARG TF_VERSION
132 | ARG GPU_POSTFIX
133 |
134 | # create package structure
135 | WORKDIR /libtensorflow-cc_${TF_VERSION}${GPU_POSTFIX}
136 | RUN mkdir -p usr/local/include/bin usr/local/include usr/local/lib/ usr/local/lib/cmake/tensorflow
137 | COPY DEBIAN DEBIAN
138 | COPY cmake/TensorFlowConfig.cmake usr/local/lib/cmake/tensorflow/TensorFlowConfig.cmake
139 | COPY --from=build /tensorflow/bazel-bin/tensorflow/include usr/local/include/tensorflow
140 | COPY --from=build /tensorflow/bazel-bin/tensorflow/lib usr/local/lib/tensorflow
141 | COPY --from=build /usr/local/bin/protoc usr/local/bin/protoc
142 | COPY --from=build /usr/local/include/google usr/local/include/google
143 | COPY --from=build /usr/local/lib usr/local/lib/protobuf
144 | RUN cp -d usr/local/lib/tensorflow/lib* usr/local/lib/protobuf/lib* usr/local/lib/ && \
145 | rm -rf usr/local/lib/tensorflow usr/local/lib/protobuf
146 | RUN sed -i "s/TF_VERSION/$TF_VERSION/" DEBIAN/control
147 | RUN sed -i "s/TARGETARCH/$TARGETARCH/" DEBIAN/control
148 |
149 | # build .deb
150 | WORKDIR /
151 | RUN dpkg-deb --build --root-owner-group libtensorflow-cc_${TF_VERSION}${GPU_POSTFIX} && \
152 | rm -rf libtensorflow-cc_${TF_VERSION}${GPU_POSTFIX}/
153 |
154 | # copy pip package, if built
155 | ARG BUILD_PIP_PACKAGE
156 | COPY --from=build /tmp/tensorflow/pip/tensorflow*.whl /
157 |
158 | # --- final stage with TensorFlow Python and C++ Library -----------------------
159 | FROM --platform=amd64 tensorflow/tensorflow:${TF_VERSION}${GPU_POSTFIX} as final-amd64
160 |
161 | FROM --platform=arm64 ubuntu:focal as final-base-arm64
162 |
163 | FROM --platform=arm64 rwthika/cuda:11.8-cudnn-trt-ubuntu20.04 as final-base-arm64-gpu
164 |
165 | FROM "final-base-arm64${GPU_POSTFIX}" as final-arm64
166 |
167 | # copy and install pip package, if built (not present in base image)
168 | ARG BUILD_PIP_PACKAGE
169 | COPY --from=deb-package /tensorflow*.whl /
170 | RUN if [ "${BUILD_PIP_PACKAGE}" = "1" ]; then \
171 | apt-get update && \
172 | apt-get install -y python3-pip && \
173 | python3 -m pip install --no-cache /tensorflow*.whl && \
174 | rm -rf /var/lib/apt/lists/*; \
175 | fi && \
176 | rm -rf /tensorflow*.whl
177 |
178 | FROM "final-${TARGETARCH}" as final
179 |
180 | ARG DEBIAN_FRONTEND=noninteractive
181 | ARG TF_VERSION
182 | ARG GPU_POSTFIX
183 |
184 | # make sure gcc is installed
185 | RUN apt-get update && \
186 | apt-get install -y build-essential && \
187 | rm -rf /var/lib/apt/lists/*
188 |
189 | # install gcc 11 for 2.12.0, 2.12.1, 2.13.0
190 | # https://stackoverflow.com/a/67453352/7264974
191 | RUN if [ "${TF_VERSION}" = "2.12.0" ] || [ "${TF_VERSION}" = "2.12.1" ] || [ "${TF_VERSION}" = "2.13.0" ]; then \
192 | apt-get update && \
193 | apt-get install -y software-properties-common && \
194 | add-apt-repository ppa:ubuntu-toolchain-r/test && \
195 | apt-get install -y gcc-11 g++-11 && \
196 | rm -rf /var/lib/apt/lists/* && \
197 | update-alternatives --remove-all cpp && \
198 | update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90 --slave /usr/bin/g++ g++ /usr/bin/g++-9 --slave /usr/bin/gcov gcov /usr/bin/gcov-9 --slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-9 --slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-9 --slave /usr/bin/cpp cpp /usr/bin/cpp-9 && \
199 | update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 110 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11 --slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-11 --slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-11 --slave /usr/bin/cpp cpp /usr/bin/cpp-11 ; \
200 | fi
201 |
202 | # install TensorFlow C++ API incl. protobuf
203 | COPY --from=deb-package /libtensorflow-cc_${TF_VERSION}${GPU_POSTFIX}.deb /tmp
204 | RUN dpkg -i /tmp/libtensorflow-cc_${TF_VERSION}${GPU_POSTFIX}.deb && \
205 | ldconfig && \
206 | rm /tmp/libtensorflow-cc_${TF_VERSION}${GPU_POSTFIX}.deb
207 |
--------------------------------------------------------------------------------
/docker/cmake/TensorFlowConfig.cmake:
--------------------------------------------------------------------------------
1 | # ==============================================================================
2 | # MIT License
3 | # Copyright 2022 Institute for Automotive Engineering of RWTH Aachen University.
4 | # Permission is hereby granted, free of charge, to any person obtaining a copy
5 | # of this software and associated documentation files (the "Software"), to deal
6 | # in the Software without restriction, including without limitation the rights
7 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | # copies of the Software, and to permit persons to whom the Software is
9 | # furnished to do so, subject to the following conditions:
10 | # The above copyright notice and this permission notice shall be included in all
11 | # copies or substantial portions of the Software.
12 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18 | # SOFTWARE.
19 | # ==============================================================================
20 |
21 | # find dependencies
22 | find_package(Protobuf REQUIRED)
23 |
24 | # find include directories
25 | find_path(INCLUDE_DIR tensorflow/core/public/session.h PATH_SUFFIXES tensorflow)
26 | list(APPEND INCLUDE_DIRS ${INCLUDE_DIR})
27 | if(INCLUDE_DIR)
28 | list(APPEND INCLUDE_DIRS ${INCLUDE_DIR}/src)
29 | endif()
30 |
31 | # find libraries
32 | find_library(LIBRARY libtensorflow_cc.so PATH_SUFFIXES tensorflow)
33 | find_library(LIBRARY_FRAMEWORK libtensorflow_framework.so PATH_SUFFIXES tensorflow)
34 |
35 | # handle the QUIETLY and REQUIRED arguments and set *_FOUND
36 | include(FindPackageHandleStandardArgs)
37 | find_package_handle_standard_args(TensorFlow DEFAULT_MSG INCLUDE_DIRS LIBRARY)
38 | mark_as_advanced(INCLUDE_DIRS LIBRARY LIBRARY_FRAMEWORK)
39 |
40 | # set INCLUDE_DIRS and LIBRARIES
41 | if(TensorFlow_FOUND)
42 | set(TensorFlow_INCLUDE_DIRS ${INCLUDE_DIRS})
43 | if(LIBRARY_FRAMEWORK)
44 | set(TensorFlow_LIBRARIES ${LIBRARY} ${LIBRARY_FRAMEWORK} ${Protobuf_LIBRARY})
45 | else()
46 | set(TensorFlow_LIBRARIES ${LIBRARY} ${Protobuf_LIBRARY})
47 | endif()
48 | endif()
--------------------------------------------------------------------------------
/docker/patch/2.11.1/workspace2.bzl.patch:
--------------------------------------------------------------------------------
1 | diff --git a/tensorflow/workspace2.bzl b/tensorflow/workspace2.bzl
2 | index 18274158..306f2431 100644
3 | --- a/tensorflow/workspace2.bzl
4 | +++ b/tensorflow/workspace2.bzl
5 | @@ -171,9 +171,9 @@ def _tf_repositories():
6 | name = "cudnn_frontend_archive",
7 | build_file = "//third_party:cudnn_frontend.BUILD",
8 | patch_file = ["//third_party:cudnn_frontend_header_fix.patch"],
9 | - sha256 = "6ca6e7d4affdff59c749865d6d0428c849968b0873a1d1b849f56d7be624f27b",
10 | - strip_prefix = "cudnn-frontend-0.7.1",
11 | - urls = tf_mirror_urls("https://github.com/NVIDIA/cudnn-frontend/archive/refs/tags/v0.7.1.zip"),
12 | + sha256 = "d8dba9e2607a0c256aa8eacb45b39986ab6f3f24a4d431d4397047a3cb0cd4fb",
13 | + strip_prefix = "cudnn-frontend-0.9",
14 | + urls = tf_mirror_urls("https://github.com/NVIDIA/cudnn-frontend/archive/refs/tags/v0.9.zip"),
15 | )
16 |
17 | tf_http_archive(
18 |
--------------------------------------------------------------------------------
/docker/patch/2.12.0/workspace2.bzl.patch:
--------------------------------------------------------------------------------
1 | diff --git a/tensorflow/workspace2.bzl b/tensorflow/workspace2.bzl
2 | index 1261273b..0a9d755a 100644
3 | --- a/tensorflow/workspace2.bzl
4 | +++ b/tensorflow/workspace2.bzl
5 | @@ -172,9 +172,9 @@ def _tf_repositories():
6 | name = "cudnn_frontend_archive",
7 | build_file = "//third_party:cudnn_frontend.BUILD",
8 | patch_file = ["//third_party:cudnn_frontend_header_fix.patch"],
9 | - sha256 = "3c7b842cd67989810955b220fa1116e7e2ed10660a8cfb632118146a64992c30",
10 | - strip_prefix = "cudnn-frontend-0.7.3",
11 | - urls = tf_mirror_urls("https://github.com/NVIDIA/cudnn-frontend/archive/refs/tags/v0.7.3.zip"),
12 | + sha256 = "d8dba9e2607a0c256aa8eacb45b39986ab6f3f24a4d431d4397047a3cb0cd4fb",
13 | + strip_prefix = "cudnn-frontend-0.9",
14 | + urls = tf_mirror_urls("https://github.com/NVIDIA/cudnn-frontend/archive/refs/tags/v0.9.zip"),
15 | )
16 |
17 | tf_http_archive(
18 |
--------------------------------------------------------------------------------
/docker/patch/2.12.1/workspace2.bzl.patch:
--------------------------------------------------------------------------------
1 | diff --git a/tensorflow/workspace2.bzl b/tensorflow/workspace2.bzl
2 | index 1261273b..0a9d755a 100644
3 | --- a/tensorflow/workspace2.bzl
4 | +++ b/tensorflow/workspace2.bzl
5 | @@ -172,9 +172,9 @@ def _tf_repositories():
6 | name = "cudnn_frontend_archive",
7 | build_file = "//third_party:cudnn_frontend.BUILD",
8 | patch_file = ["//third_party:cudnn_frontend_header_fix.patch"],
9 | - sha256 = "3c7b842cd67989810955b220fa1116e7e2ed10660a8cfb632118146a64992c30",
10 | - strip_prefix = "cudnn-frontend-0.7.3",
11 | - urls = tf_mirror_urls("https://github.com/NVIDIA/cudnn-frontend/archive/refs/tags/v0.7.3.zip"),
12 | + sha256 = "d8dba9e2607a0c256aa8eacb45b39986ab6f3f24a4d431d4397047a3cb0cd4fb",
13 | + strip_prefix = "cudnn-frontend-0.9",
14 | + urls = tf_mirror_urls("https://github.com/NVIDIA/cudnn-frontend/archive/refs/tags/v0.9.zip"),
15 | )
16 |
17 | tf_http_archive(
18 |
--------------------------------------------------------------------------------
/docker/patch/2.13.0/workspace2.bzl.patch:
--------------------------------------------------------------------------------
1 | diff --git a/tensorflow/workspace2.bzl b/tensorflow/workspace2.bzl
2 | index da9295ad..86a3df2f 100644
3 | --- a/tensorflow/workspace2.bzl
4 | +++ b/tensorflow/workspace2.bzl
5 | @@ -174,9 +174,9 @@ def _tf_repositories():
6 | name = "cudnn_frontend_archive",
7 | build_file = "//third_party:cudnn_frontend.BUILD",
8 | patch_file = ["//third_party:cudnn_frontend_header_fix.patch"],
9 | - sha256 = "bfcf778030831f325cfc13ae5995388cc834fbff2995a297ba580d9ec65ca3b6",
10 | - strip_prefix = "cudnn-frontend-0.8",
11 | - urls = tf_mirror_urls("https://github.com/NVIDIA/cudnn-frontend/archive/refs/tags/v0.8.zip"),
12 | + sha256 = "d8dba9e2607a0c256aa8eacb45b39986ab6f3f24a4d431d4397047a3cb0cd4fb",
13 | + strip_prefix = "cudnn-frontend-0.9",
14 | + urls = tf_mirror_urls("https://github.com/NVIDIA/cudnn-frontend/archive/refs/tags/v0.9.zip"),
15 | )
16 |
17 | tf_http_archive(
18 |
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | hello_tensorflow
--------------------------------------------------------------------------------
/example/build-and-run-monolithic.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | g++ -I /usr/local/include/tensorflow \
5 | hello_tensorflow.cpp \
6 | -ltensorflow_cc -lprotobuf \
7 | -o hello_tensorflow
8 |
9 | ./hello_tensorflow
--------------------------------------------------------------------------------
/example/build-and-run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | g++ -I /usr/local/include/tensorflow \
5 | hello_tensorflow.cpp \
6 | -ltensorflow_cc -ltensorflow_framework -lprotobuf \
7 | -o hello_tensorflow
8 |
9 | ./hello_tensorflow
--------------------------------------------------------------------------------
/example/hello_tensorflow.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 | MIT License
4 | Copyright 2022 Institute for Automotive Engineering of RWTH Aachen University.
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | SOFTWARE.
20 | ==============================================================================
21 | */
22 |
23 | #include
24 | #include
25 |
26 | #include
27 | #include
28 | #include
29 | #include
30 |
31 | using namespace std;
32 |
33 |
34 | int main(int argc, char **argv) {
35 |
36 | // create new session
37 | auto scope = tensorflow::Scope::NewRootScope();
38 | tensorflow::ClientSession session(scope);
39 |
40 | // define graph of operations
41 | auto A = tensorflow::ops::Const(scope, {{1, 2}, {3, 4}});
42 | auto x = tensorflow::ops::Const(scope, {{1}, {2}});
43 | auto b = tensorflow::ops::MatMul(scope, A, x);
44 |
45 | // run graph and fetch outputs of A, x, and b
46 | vector outputs;
47 | tensorflow::Status status = session.Run({A, x, b}, &outputs);
48 | if (!status.ok())
49 | throw std::runtime_error("Failed to run TensorFlow graph: " + status.ToString());
50 |
51 | // print results
52 | cout << "Hello from TensorFlow C++ " << TF_VERSION_STRING << "!" << endl << endl;
53 | cout << "A = " << endl << outputs[0].tensor() << endl << endl;
54 | cout << "x = " << endl << outputs[1].tensor() << endl << endl;
55 | cout << "A * x = " << endl << outputs[2].tensor() << endl;
56 |
57 | return 0;
58 | }
--------------------------------------------------------------------------------
/libtensorflow-cc/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
--------------------------------------------------------------------------------
/scripts/.common.sh:
--------------------------------------------------------------------------------
1 | # ==============================================================================
2 | # MIT License
3 | # Copyright 2022 Institute for Automotive Engineering of RWTH Aachen University.
4 | # Permission is hereby granted, free of charge, to any person obtaining a copy
5 | # of this software and associated documentation files (the "Software"), to deal
6 | # in the Software without restriction, including without limitation the rights
7 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | # copies of the Software, and to permit persons to whom the Software is
9 | # furnished to do so, subject to the following conditions:
10 | # The above copyright notice and this permission notice shall be included in all
11 | # copies or substantial portions of the Software.
12 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18 | # SOFTWARE.
19 | # ==============================================================================
20 |
21 | set -e
22 | set -o pipefail
23 |
24 | DEFAULT_TF_VERSION="2.13.0"
25 | DEFAULT_JOBS=$(nproc 2> /dev/null || sysctl -n hw.ncpu)
26 | DEFAULT_GPU=1
27 | DEFAULT_ARCH=$(dpkg --print-architecture 2> /dev/null || uname -m)
28 |
29 | TF_VERSION=${TF_VERSION:-${DEFAULT_TF_VERSION}}
30 | JOBS=${JOBS:-${DEFAULT_JOBS}}
31 | GPU=${GPU:-${DEFAULT_GPU}}
32 | [[ $GPU == "1" ]] && GPU_POSTFIX="-gpu" || GPU_POSTFIX=""
33 | ARCH=${ARCH:-${DEFAULT_ARCH}}
34 |
35 | if [ "$ARCH" = "arm64" ]; then
36 | DEFAULT_TF_CUDA_COMPUTE_CAPABILITIES=5.3,6.2,7.2,8.7
37 | else
38 | DEFAULT_TF_CUDA_COMPUTE_CAPABILITIES=6.0,6.1,7.0,7.5,8.0,8.6,8.9,9.0
39 | fi
40 | TF_CUDA_COMPUTE_CAPABILITIES=${TF_CUDA_COMPUTE_CAPABILITIES:-${DEFAULT_TF_CUDA_COMPUTE_CAPABILITIES}}
41 |
42 | SCRIPT_NAME=$(basename "$0")
43 | SCRIPT_DIR=$(realpath $(dirname "$0"))
44 | REPOSITORY_DIR=$(realpath ${SCRIPT_DIR}/..)
45 | DOCKER_DIR=${REPOSITORY_DIR}/docker
46 | LOG_DIR=${DOCKER_DIR}/.log
47 | LOG_FILE=${LOG_DIR}/${SCRIPT_NAME}_${TF_VERSION}${GPU_POSTFIX}.log
48 | mkdir -p ${LOG_DIR}
49 |
50 | DOWNLOAD_DOCKERFILES_DIR=${DOCKER_DIR}/.Dockerfiles
51 | DOWNLOAD_DOCKERFILE_DIR=${DOWNLOAD_DOCKERFILES_DIR}/${TF_VERSION}
52 |
53 | IMAGE_DEVEL_ARCH="tensorflow/tensorflow:${TF_VERSION}-devel${GPU_POSTFIX}-${ARCH}"
54 | IMAGE_CPP="rwthika/tensorflow-cc:${TF_VERSION}${GPU_POSTFIX}"
55 | IMAGE_CPP_ARCH="${IMAGE_CPP}-${ARCH}"
56 | IMAGE_LIBTENSORFLOW_CC_ARCH="rwthika/tensorflow-cc:${TF_VERSION}-libtensorflow_cc${GPU_POSTFIX}-${ARCH}"
57 |
--------------------------------------------------------------------------------
/scripts/.versions.devel.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # ==============================================================================
3 | # MIT License
4 | # Copyright 2022 Institute for Automotive Engineering of RWTH Aachen University.
5 | # Permission is hereby granted, free of charge, to any person obtaining a copy
6 | # of this software and associated documentation files (the "Software"), to deal
7 | # in the Software without restriction, including without limitation the rights
8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | # copies of the Software, and to permit persons to whom the Software is
10 | # furnished to do so, subject to the following conditions:
11 | # The above copyright notice and this permission notice shall be included in all
12 | # copies or substantial portions of the Software.
13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | # SOFTWARE.
20 | # ==============================================================================
21 |
22 | ARCH=$(uname -m)
23 |
24 | UBUNTU_VERSION=$(. /etc/os-release; echo $VERSION_ID)
25 |
26 | GCC_VERSION=$(gcc -dumpfullversion)
27 |
28 | if [[ $(command -v bazel) ]]; then
29 | BAZEL_VERSION=$(bazel version 2> /dev/null | grep "Build label" | awk '{print $3}')
30 | fi
31 |
32 | if [[ $(command -v nvcc) ]]; then
33 | CUDA_VERSION=$(nvcc --version | grep ^Cuda | awk '{print $6}' | sed 's/V//')
34 | fi
35 |
36 | if [[ -f /usr/include/cudnn_version.h ]]; then
37 | CUDNN_MAJOR=$(cat /usr/include/cudnn_version.h | grep "#define CUDNN_MAJOR" | sed "s/#define CUDNN_MAJOR //")
38 | CUDNN_MINOR=$(cat /usr/include/cudnn_version.h | grep "#define CUDNN_MINOR" | sed "s/#define CUDNN_MINOR //")
39 | CUDNN_PATCH=$(cat /usr/include/cudnn_version.h | grep "#define CUDNN_PATCHLEVEL" | sed "s/#define CUDNN_PATCHLEVEL //")
40 | CUDNN_VERSION=$CUDNN_MAJOR.$CUDNN_MINOR.$CUDNN_PATCH
41 | fi
42 |
43 | if [[ -f /usr/include/$(uname -m)-linux-gnu/NvInferVersion.h ]]; then
44 | TENSORRT_MAJOR=$(cat /usr/include/$(uname -m)-linux-gnu/NvInferVersion.h | grep "#define NV_TENSORRT_MAJOR" | sed "s/#define NV_TENSORRT_MAJOR //" | sed "s#//.*##" | sed "s/ //")
45 | TENSORRT_MINOR=$(cat /usr/include/$(uname -m)-linux-gnu/NvInferVersion.h | grep "#define NV_TENSORRT_MINOR" | sed "s/#define NV_TENSORRT_MINOR //" | sed "s#//.*##" | sed "s/ //")
46 | TENSORRT_PATCH=$(cat /usr/include/$(uname -m)-linux-gnu/NvInferVersion.h | grep "#define NV_TENSORRT_PATCH" | sed "s/#define NV_TENSORRT_PATCH //" | sed "s#//.*##" | sed "s/ //")
47 | TENSORRT_VERSION=$TENSORRT_MAJOR.$TENSORRT_MINOR.$TENSORRT_PATCH
48 | fi
49 |
50 | cat << EOF
51 | Architecture: $ARCH
52 | Ubuntu: $UBUNTU_VERSION
53 | GCC: $GCC_VERSION
54 | Bazel: $BAZEL_VERSION
55 | CUDA: $CUDA_VERSION
56 | cuDNN: $CUDNN_VERSION
57 | TensorRT: $TENSORRT_VERSION
58 | EOF
59 |
--------------------------------------------------------------------------------
/scripts/.versions.run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # ==============================================================================
3 | # MIT License
4 | # Copyright 2022 Institute for Automotive Engineering of RWTH Aachen University.
5 | # Permission is hereby granted, free of charge, to any person obtaining a copy
6 | # of this software and associated documentation files (the "Software"), to deal
7 | # in the Software without restriction, including without limitation the rights
8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | # copies of the Software, and to permit persons to whom the Software is
10 | # furnished to do so, subject to the following conditions:
11 | # The above copyright notice and this permission notice shall be included in all
12 | # copies or substantial portions of the Software.
13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | # SOFTWARE.
20 | # ==============================================================================
21 |
22 | PYTHON_VERSION=$(python3 --version 2>&1 | awk '{print $2}')
23 |
24 | if [[ $(command -v python) ]]; then
25 | TENSORFLOW_PYTHON_VERSION=$(python3 -c "exec(\"try:\n import os; os.environ['TF_CPP_MIN_LOG_LEVEL'] = '1'; import tensorflow as tf; print(tf.__version__);\n\rexcept ImportError:\n pass\")" 2> /dev/null)
26 | fi
27 |
28 | if [[ -f /usr/local/include/tensorflow/tensorflow/core/public/version.h ]]; then
29 | TENSORFLOW_CPP_MAJOR=$(cat /usr/local/include/tensorflow/tensorflow/core/public/version.h | grep "#define TF_MAJOR_VERSION" | sed "s/#define TF_MAJOR_VERSION //")
30 | TENSORFLOW_CPP_MINOR=$(cat /usr/local/include/tensorflow/tensorflow/core/public/version.h | grep "#define TF_MINOR_VERSION" | sed "s/#define TF_MINOR_VERSION //")
31 | TENSORFLOW_CPP_PATCH=$(cat /usr/local/include/tensorflow/tensorflow/core/public/version.h | grep "#define TF_PATCH_VERSION" | sed "s/#define TF_PATCH_VERSION //")
32 | TENSORFLOW_CPP_VERSION=$TENSORFLOW_CPP_MAJOR.$TENSORFLOW_CPP_MINOR.$TENSORFLOW_CPP_PATCH
33 | fi
34 |
35 | if [[ $(command -v protoc) ]]; then
36 | PROTOBUF_VERSION=$(protoc --version | awk '{print $2}')
37 | fi
38 |
39 | cat << EOF
40 | Python: $PYTHON_VERSION
41 | TensorFlow (Python): $TENSORFLOW_PYTHON_VERSION
42 | TensorFlow (C++): $TENSORFLOW_CPP_VERSION
43 | protobuf: $PROTOBUF_VERSION
44 | EOF
45 |
--------------------------------------------------------------------------------
/scripts/0-download-official-dockerfiles.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # ==============================================================================
3 | # MIT License
4 | # Copyright 2022 Institute for Automotive Engineering of RWTH Aachen University.
5 | # Permission is hereby granted, free of charge, to any person obtaining a copy
6 | # of this software and associated documentation files (the "Software"), to deal
7 | # in the Software without restriction, including without limitation the rights
8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | # copies of the Software, and to permit persons to whom the Software is
10 | # furnished to do so, subject to the following conditions:
11 | # The above copyright notice and this permission notice shall be included in all
12 | # copies or substantial portions of the Software.
13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | # SOFTWARE.
20 | # ==============================================================================
21 |
22 | source $(dirname "$0")/.common.sh
23 |
24 | REPO_URL="https://github.com/tensorflow/tensorflow/archive/refs/tags/v${TF_VERSION}.tar.gz"
25 | REPO_PATH="tensorflow/tools/dockerfiles/*"
26 | TEMP_DIR=$(mktemp -d)
27 | REPO_DIR=${TEMP_DIR}/${TF_VERSION}
28 |
29 | mkdir -p ${DOWNLOAD_DOCKERFILES_DIR}
30 | echo -n "Downloading TensorFlow ${TF_VERSION} Dockerfiles to $(realpath ${DOWNLOAD_DOCKERFILE_DIR}) ... "
31 |
32 | if [[ ! -d ${DOWNLOAD_DOCKERFILE_DIR} ]]; then
33 | wget --quiet --directory-prefix ${TEMP_DIR} ${REPO_URL}
34 | mkdir ${REPO_DIR}
35 | tar -xzf ${TEMP_DIR}/v${TF_VERSION}.tar.gz -C ${REPO_DIR} --strip-components=1
36 | mkdir ${DOWNLOAD_DOCKERFILE_DIR}
37 | mv ${REPO_DIR}/${REPO_PATH} ${DOWNLOAD_DOCKERFILE_DIR}
38 | rm -rf ${TEMP_DIR}
39 | fi
40 |
41 | echo "done"
42 |
--------------------------------------------------------------------------------
/scripts/1-build-official-devel-image.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # ==============================================================================
3 | # MIT License
4 | # Copyright 2022 Institute for Automotive Engineering of RWTH Aachen University.
5 | # Permission is hereby granted, free of charge, to any person obtaining a copy
6 | # of this software and associated documentation files (the "Software"), to deal
7 | # in the Software without restriction, including without limitation the rights
8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | # copies of the Software, and to permit persons to whom the Software is
10 | # furnished to do so, subject to the following conditions:
11 | # The above copyright notice and this permission notice shall be included in all
12 | # copies or substantial portions of the Software.
13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | # SOFTWARE.
20 | # ==============================================================================
21 |
22 | source $(dirname "$0")/.common.sh
23 |
24 | CPU_GPU_POSTFIX=${GPU_POSTFIX:--cpu}
25 | BUILD_DIR=${DOWNLOAD_DOCKERFILE_DIR}
26 | BSD_SED_ARG=""
27 | if [ "$(uname -s)" = "Darwin" ]; then
28 | BSD_SED_ARG=".bak"
29 | fi
30 | TF_VERSION_MAJOR=$(echo "$TF_VERSION" | cut -d. -f1)
31 | TF_VERSION_MINOR=$(echo "$TF_VERSION" | cut -d. -f2)
32 | TF_VERSION_PATCH=$(echo "$TF_VERSION" | cut -d. -f3)
33 |
34 | if [ "$ARCH" = "amd64" ]; then
35 | DOCKERFILE=${DOWNLOAD_DOCKERFILE_DIR}/dockerfiles/devel${CPU_GPU_POSTFIX}.Dockerfile
36 | elif [ "$ARCH" = "arm64" ]; then
37 | if [[ "$TF_VERSION_MAJOR" -lt "2" || ( "$TF_VERSION_MAJOR" -eq "2" && "$TF_VERSION_MINOR" -le "10" ) ]]; then
38 | DOCKERFILE=${DOWNLOAD_DOCKERFILE_DIR}/dockerfiles/arm64v8/devel-cpu-arm64v8.Dockerfile
39 | if [ "$TF_VERSION" = "2.8.4" ]; then
40 | sed -i $BSD_SED_ARG "s/ubuntu:\${UBUNTU_VERSION}/nvcr.io\/nvidia\/l4t-tensorflow:r34.1.1-tf2.8-py3/" $DOCKERFILE
41 | else
42 | sed -i $BSD_SED_ARG "s/ubuntu:\${UBUNTU_VERSION}/nvcr.io\/nvidia\/l4t-tensorflow:r35.1.0-tf2.9-py3/" $DOCKERFILE
43 | fi
44 | # replace sklearn (deprecated) with scikit-learn https://pypi.org/project/sklearn/
45 | sed -i $BSD_SED_ARG "s/sklearn/scikit-learn/" $DOCKERFILE
46 | else
47 | DOCKERFILE=${DOWNLOAD_DOCKERFILE_DIR}/dockerfiles/arm64v8/devel${CPU_GPU_POSTFIX}-arm64v8.Dockerfile
48 | fi
49 | fi
50 |
51 | echo "Building ${IMAGE_DEVEL_ARCH} ... "
52 | docker build -t ${IMAGE_DEVEL_ARCH} -f ${DOCKERFILE} ${BUILD_DIR} | tee ${LOG_FILE}
53 |
--------------------------------------------------------------------------------
/scripts/2-build-cpp-image.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # ==============================================================================
3 | # MIT License
4 | # Copyright 2022 Institute for Automotive Engineering of RWTH Aachen University.
5 | # Permission is hereby granted, free of charge, to any person obtaining a copy
6 | # of this software and associated documentation files (the "Software"), to deal
7 | # in the Software without restriction, including without limitation the rights
8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | # copies of the Software, and to permit persons to whom the Software is
10 | # furnished to do so, subject to the following conditions:
11 | # The above copyright notice and this permission notice shall be included in all
12 | # copies or substantial portions of the Software.
13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | # SOFTWARE.
20 | # ==============================================================================
21 |
22 | source $(dirname "$0")/.common.sh
23 |
24 | echo "Building ${IMAGE_CPP} ... "
25 | docker build --build-arg TARGETARCH=$ARCH --build-arg TF_VERSION=${TF_VERSION} --build-arg JOBS=${JOBS} --build-arg GPU_POSTFIX=${GPU_POSTFIX} --build-arg TF_CUDA_COMPUTE_CAPABILITIES=${TF_CUDA_COMPUTE_CAPABILITIES} --build-arg BUILD_PIP_PACKAGE=${BUILD_PIP_PACKAGE} -t ${IMAGE_CPP_ARCH} ${DOCKER_DIR} | tee ${LOG_FILE}
26 | docker tag ${IMAGE_CPP_ARCH} ${IMAGE_CPP}
--------------------------------------------------------------------------------
/scripts/3-export-libtensorflow-cc.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # ==============================================================================
3 | # MIT License
4 | # Copyright 2022 Institute for Automotive Engineering of RWTH Aachen University.
5 | # Permission is hereby granted, free of charge, to any person obtaining a copy
6 | # of this software and associated documentation files (the "Software"), to deal
7 | # in the Software without restriction, including without limitation the rights
8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | # copies of the Software, and to permit persons to whom the Software is
10 | # furnished to do so, subject to the following conditions:
11 | # The above copyright notice and this permission notice shall be included in all
12 | # copies or substantial portions of the Software.
13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | # SOFTWARE.
20 | # ==============================================================================
21 |
22 | source $(dirname "$0")/.common.sh
23 |
24 | EXPORT_DIR=${REPOSITORY_DIR}/libtensorflow-cc
25 | CONTAINER_FILE="libtensorflow-cc_${TF_VERSION}${GPU_POSTFIX}.deb"
26 | EXPORT_FILE="libtensorflow-cc_${TF_VERSION}${GPU_POSTFIX}_${ARCH}.deb"
27 |
28 | EXPORT_DIR_PIP=${REPOSITORY_DIR}/tensorflow-wheel
29 | CONTAINER_FILE_PIP="tensorflow-${TF_VERSION}*.whl"
30 |
31 | STAGE="deb-package"
32 |
33 | echo "Building ${IMAGE_LIBTENSORFLOW_CC_ARCH} ... "
34 | docker build --build-arg TARGETARCH=$ARCH --build-arg TF_VERSION=${TF_VERSION} --build-arg JOBS=${JOBS} --build-arg GPU_POSTFIX=${GPU_POSTFIX} --build-arg TF_CUDA_COMPUTE_CAPABILITIES=${TF_CUDA_COMPUTE_CAPABILITIES} --build-arg BUILD_PIP_PACKAGE=${BUILD_PIP_PACKAGE} --target ${STAGE} -t ${IMAGE_LIBTENSORFLOW_CC_ARCH} ${DOCKER_DIR} | tee ${LOG_FILE}
35 |
36 | echo "Exporting to $(realpath ${EXPORT_DIR})/${EXPORT_FILE} ... "
37 | TMP_CONTAINER=$(docker run -d --rm ${IMAGE_LIBTENSORFLOW_CC_ARCH} sleep infinity)
38 | docker cp ${TMP_CONTAINER}:/${CONTAINER_FILE} ${EXPORT_DIR}/${EXPORT_FILE}
39 | if [ "$BUILD_PIP_PACKAGE" = "1" ]; then
40 | echo "Exporting to $(realpath ${EXPORT_DIR_PIP}) ... "
41 | docker exec ${TMP_CONTAINER} bash -c "ls /${CONTAINER_FILE_PIP}" | while read f; do docker cp ${TMP_CONTAINER}:/$f ${EXPORT_DIR_PIP}; done
42 | fi
43 | docker kill ${TMP_CONTAINER}
44 |
--------------------------------------------------------------------------------
/scripts/4-test-libtensorflow-cc.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # ==============================================================================
3 | # MIT License
4 | # Copyright 2022 Institute for Automotive Engineering of RWTH Aachen University.
5 | # Permission is hereby granted, free of charge, to any person obtaining a copy
6 | # of this software and associated documentation files (the "Software"), to deal
7 | # in the Software without restriction, including without limitation the rights
8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | # copies of the Software, and to permit persons to whom the Software is
10 | # furnished to do so, subject to the following conditions:
11 | # The above copyright notice and this permission notice shall be included in all
12 | # copies or substantial portions of the Software.
13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | # SOFTWARE.
20 | # ==============================================================================
21 |
22 | source $(dirname "$0")/.common.sh
23 |
24 | EXAMPLE_DIR=${REPOSITORY_DIR}/example
25 | EXAMPLE_MOUNT="/example"
26 | if [ "${TF_VERSION}" = "2.10.0" ] || [ "${TF_VERSION}" = "2.10.1" ] || [ "${TF_VERSION}" = "2.11.0" ] || [ "${TF_VERSION}" = "2.11.1" ] || [ "${TF_VERSION}" = "2.12.0" ] || [ "${TF_VERSION}" = "2.12.1" ] || [ "${TF_VERSION}" = "2.13.0" ]; then
27 | CMD="./build-and-run.sh"
28 | else
29 | CMD="./build-and-run-monolithic.sh"
30 | fi
31 |
32 | echo "Testing libtensorflow_cc in ${IMAGE_CPP} ... "
33 | if [[ "$GPU" == "1" && "$ARCH" = "amd64" ]]; then
34 | GPU_ARG="--gpus all"
35 | elif [[ "$GPU" == "1" && "$ARCH" = "arm64" ]]; then
36 | GPU_ARG="--runtime nvidia"
37 | else
38 | GPU_ARG=""
39 | fi
40 | docker run --rm ${GPU_ARG} -v ${EXAMPLE_DIR}:${EXAMPLE_MOUNT} -w ${EXAMPLE_MOUNT} ${IMAGE_CPP} ${CMD} | tee ${LOG_FILE}
41 |
--------------------------------------------------------------------------------
/scripts/5-print-versions.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # ==============================================================================
3 | # MIT License
4 | # Copyright 2022 Institute for Automotive Engineering of RWTH Aachen University.
5 | # Permission is hereby granted, free of charge, to any person obtaining a copy
6 | # of this software and associated documentation files (the "Software"), to deal
7 | # in the Software without restriction, including without limitation the rights
8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | # copies of the Software, and to permit persons to whom the Software is
10 | # furnished to do so, subject to the following conditions:
11 | # The above copyright notice and this permission notice shall be included in all
12 | # copies or substantial portions of the Software.
13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | # SOFTWARE.
20 | # ==============================================================================
21 |
22 | source $(dirname "$0")/.common.sh
23 |
24 | SCRIPT_DEVEL=${SCRIPT_DIR}/.versions.devel.sh
25 | SCRIPT_RUN=${SCRIPT_DIR}/.versions.run.sh
26 | SCRIPT_MOUNT=/.versions.sh
27 | CMD="bash ${SCRIPT_MOUNT}"
28 |
29 | echo "Getting version information from ${IMAGE_DEVEL_ARCH} and ${IMAGE_CPP} ... "
30 | if [[ "$GPU" == "1" && "$ARCH" = "amd64" ]]; then
31 | GPU_ARG="--gpus all"
32 | elif [[ "$GPU" == "1" && "$ARCH" = "arm64" ]]; then
33 | GPU_ARG="--runtime nvidia"
34 | else
35 | GPU_ARG=""
36 | fi
37 | docker run --rm ${GPU_ARG} -v ${SCRIPT_DEVEL}:${SCRIPT_MOUNT} ${IMAGE_DEVEL_ARCH} ${CMD} | tee ${LOG_FILE}
38 | docker run --rm ${GPU_ARG} -v ${SCRIPT_RUN}:${SCRIPT_MOUNT} ${IMAGE_CPP} ${CMD}| tee -a ${LOG_FILE}
39 |
--------------------------------------------------------------------------------
/scripts/6-push-image.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # ==============================================================================
3 | # MIT License
4 | # Copyright 2022 Institute for Automotive Engineering of RWTH Aachen University.
5 | # Permission is hereby granted, free of charge, to any person obtaining a copy
6 | # of this software and associated documentation files (the "Software"), to deal
7 | # in the Software without restriction, including without limitation the rights
8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | # copies of the Software, and to permit persons to whom the Software is
10 | # furnished to do so, subject to the following conditions:
11 | # The above copyright notice and this permission notice shall be included in all
12 | # copies or substantial portions of the Software.
13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | # SOFTWARE.
20 | # ==============================================================================
21 |
22 | source $(dirname "$0")/.common.sh
23 |
24 | docker login
25 | docker push ${IMAGE_CPP_ARCH}
26 |
--------------------------------------------------------------------------------
/tensorflow-wheel/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
--------------------------------------------------------------------------------