Skip to content

victl/tensoflow-aarch64


This is an already patched Tensorflow 1.14.0 version, for compiling Python & C++ API on NVIDIA Xavier (also works on Pegasus), tested on CUDA 10.0

For lazy guys, checkout my releases here.

The patch file is located in the project root tf.patch, can be applied to the original tf-1.14.0 (not this repo, as it's already patched):

patch -p1 < tf.patch

You probably need to install the same required software packages following the official TF documentation. I'll list some of them here (deb packages not listed, because I'm building TF in docker, the apt-get list ls tooooo long):

sudo -H pip3 install -U cython
sudo -H pip3 install -U numpy matplotlib fire six yapf awscli wheel setuptools mock 'future>=0.17.1'
sudo -H pip3 install -U keras_applications==1.0.6 keras_preprocessing==1.0.5 --no-deps

Configure

PYTHON_BIN_PATH=/usr/bin/python3.6 \
PYTHON_LIB_PATH=/usr/local/lib/python3.6/dist-packages \
TF_ENABLE_XLA=1 \
TF_NEED_OPENCL_SYCL=0 \
TF_NEED_ROCM=0 \
TF_NEED_CUDA=1 \
TF_NEED_TENSORRT=1 \
TF_TENSORRT_VERSION=5 \
TF_CUDA_COMPUTE_CAPABILITIES="7.2" \
TF_CUDA_CLANG=0 \
TF_DOWNLOAD_CLANG=0 \
GCC_HOST_COMPILER_PATH=/usr/bin/gcc \
TF_NEED_MPI=0 \
CC_OPT_FLAGS="-Wno-sign-compare" \
TF_SET_ANDROID_WORKSPACE=0 \
./configure

Build C++ API

TMP=/tmp bazel build --color=yes \
    --curses=yes \
    --verbose_failures \
    --output_filter=DONT_MATCH_ANYTHING \
    --config=cuda \
    --config=nativeopt \
    --config=jetson \
    --config=xavier \
    --copt="-fPIC" \
    --config=monolithic \
    //tensorflow:libtensorflow_cc.so

You only need to copy the generated libtensorflow_cc.so to a suitable location, and prepare all header files to play with C++ API.

Build Python Wheel

TMP=/tmp bazel build --color=yes \
    --curses=yes \
    --verbose_failures \
    --output_filter=DONT_MATCH_ANYTHING \
    --config=cuda \
    --config=nativeopt \
    --config=jetson \
    --config=xavier \
    --copt="-fPIC" \
    --config=monolithic \
    //tensorflow/tools/pip_package:build_pip_package

Then generate .whl installer

./bazel-bin/tensorflow/tools/pip_package/build_pip_package .

.whl file will be generated in current directory.

Build some contrib lib (for using with C++)"

TMP=/tmp bazel build --color=yes \
    --curses=yes \
    --verbose_failures \
    --output_filter=DONT_MATCH_ANYTHING \
    --config=cuda \
    --config=nativeopt \
    --config=jetson \
    --config=xavier \
    --copt="-fPIC" \
    --config=monolithic \
     //tensorflow/contrib/image:python/ops/_image_ops.so
TMP=/tmp bazel build --color=yes \
    --curses=yes \
    --verbose_failures \
    --output_filter=DONT_MATCH_ANYTHING \
    --config=cuda \
    --config=nativeopt \
    --config=jetson \
    --config=xavier \
    --copt="-fPIC" \
    --config=monolithic \
     //tensorflow/contrib/tensorrt:all

Then go to bazel-bin to find out what .so files have been created

find bazel-bin -name *.so -type f

Copy those of interest appropriately.

Documentation
Documentation

TensorFlow is an open source software library for numerical computation using data flow graphs. The graph nodes represent mathematical operations, while the graph edges represent the multidimensional data arrays (tensors) that flow between them. This flexible architecture enables you to deploy computation to one or more CPUs or GPUs in a desktop, server, or mobile device without rewriting code. TensorFlow also includes TensorBoard, a data visualization toolkit.

TensorFlow was originally developed by researchers and engineers working on the Google Brain team within Google's Machine Intelligence Research organization for the purposes of conducting machine learning and deep neural networks research. The system is general enough to be applicable in a wide variety of other domains, as well.

TensorFlow provides stable Python and C APIs as well as non-guaranteed backwards compatible API's for C++, Go, Java, JavaScript, and Swift.

Keep up to date with release announcements and security updates by subscribing to announce@tensorflow.org.

Installation

To install the current release for CPU-only:

pip install tensorflow

Use the GPU package for CUDA-enabled GPU cards:

pip install tensorflow-gpu

See Installing TensorFlow for detailed instructions, and how to build from source.

People who are a little more adventurous can also try our nightly binaries:

Nightly pip packages * We are pleased to announce that TensorFlow now offers nightly pip packages under the tf-nightly and tf-nightly-gpu project on PyPi. Simply run pip install tf-nightly or pip install tf-nightly-gpu in a clean environment to install the nightly TensorFlow build. We support CPU and GPU packages on Linux, Mac, and Windows.

Try your first TensorFlow program

$ python
>>> import tensorflow as tf
>>> tf.enable_eager_execution()
>>> tf.add(1, 2).numpy()
3
>>> hello = tf.constant('Hello, TensorFlow!')
>>> hello.numpy()
'Hello, TensorFlow!'

Learn more examples about how to do specific tasks in TensorFlow at the tutorials page of tensorflow.org.

Contribution guidelines

If you want to contribute to TensorFlow, be sure to review the contribution guidelines. This project adheres to TensorFlow's code of conduct. By participating, you are expected to uphold this code.

We use GitHub issues for tracking requests and bugs, please see TensorFlow Discuss for general questions and discussion, and please direct specific questions to Stack Overflow.

The TensorFlow project strives to abide by generally accepted best practices in open-source software development:

CII Best Practices

Continuous build status

Official Builds

Build Type Status Artifacts
Linux CPU Status pypi
Linux GPU Status pypi
Linux XLA Status TBA
MacOS Status pypi
Windows CPU Status pypi
Windows GPU Status pypi
Android Status Download
Raspberry Pi 0 and 1 Status Status Py2 Py3
Raspberry Pi 2 and 3 Status Status Py2 Py3

Community Supported Builds

Build Type Status Artifacts
IBM s390x Build Status TBA
Linux ppc64le CPU Nightly Build Status Nightly
Linux ppc64le CPU Stable Release Build Status Release
Linux ppc64le GPU Nightly Build Status Nightly
Linux ppc64le GPU Stable Release Build Status Release
Linux CPU with Intel® MKL-DNN Nightly Build Status Nightly
Linux CPU with Intel® MKL-DNN
Supports Python 2.7, 3.4, 3.5, and 3.6
Build Status 1.13.1 pypi
Red Hat® Enterprise Linux® 7.6 CPU & GPU
Python 2.7, 3.6
Build Status 1.13.1 pypi

For more information

Learn more about the TensorFlow community at the community page of tensorflow.org for a few ways to participate.

License

Apache License 2.0

About

tensorflow 1.14.0 for using on NVIDIA Xavier / Pegasus

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published