{"id":15677820,"url":"https://github.com/pinto0309/jetson-tensorflow-pytorch-build","last_synced_at":"2025-05-07T01:43:21.618Z","repository":{"id":97172923,"uuid":"341369626","full_name":"PINTO0309/jetson-tensorflow-pytorch-build","owner":"PINTO0309","description":"Provides an environment for compiling TensorFlow or PyTorch with CUDA for aarch64 on an x86 machine. This is for Jetson. If you build using an EC2 m6g.16xlarge (aarch64) instance, TensorFlow can be fully built in about 30 minutes. It can be used as a cross-compilation environment not only for TensorFlow and PyTorch, but also for various other packages and libraries.","archived":false,"fork":false,"pushed_at":"2021-02-27T07:20:32.000Z","size":31,"stargazers_count":13,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-31T05:03:27.694Z","etag":null,"topics":["cross-compile","cuda","docker","jetson","jetson-nano","l4t","pytorch","tensorflow"],"latest_commit_sha":null,"homepage":"https://qiita.com/PINTO","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PINTO0309.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-22T23:42:23.000Z","updated_at":"2024-01-04T16:55:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"d2563bbc-dac7-4b36-b441-34463fa482f8","html_url":"https://github.com/PINTO0309/jetson-tensorflow-pytorch-build","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PINTO0309%2Fjetson-tensorflow-pytorch-build","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PINTO0309%2Fjetson-tensorflow-pytorch-build/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PINTO0309%2Fjetson-tensorflow-pytorch-build/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PINTO0309%2Fjetson-tensorflow-pytorch-build/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PINTO0309","download_url":"https://codeload.github.com/PINTO0309/jetson-tensorflow-pytorch-build/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252798495,"owners_count":21805876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cross-compile","cuda","docker","jetson","jetson-nano","l4t","pytorch","tensorflow"],"created_at":"2024-10-03T16:12:24.021Z","updated_at":"2025-05-07T01:43:21.601Z","avatar_url":"https://github.com/PINTO0309.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jetson-tensorflow-pytorch-build\nProvides an environment for compiling TensorFlow or PyTorch with CUDA for aarch64 on an x86 machine. This is for Jetson. If you build using an EC2 m6g.16xlarge (aarch64) instance, TensorFlow can be fully built in about 30 minutes. It can be used as a cross-compilation environment not only for TensorFlow and PyTorch, but also for various other packages and libraries.\n\n## 1. Usage\n### Usage1. Launching the Jetson Nano (aarch64) cross-compilation environment on an x86 machine\n```bash\n$ docker run --rm --privileged multiarch/qemu-user-static --reset -p yes\n```\nNext.\n```bash\n$ docker run -it --rm pinto0309/l4t-base:r32.5.0\n```\n\n### Usage2. Launching the Jetson Nano (aarch64) compilation environment on an EC2 aarch64 machine\n```bash\n$ docker run -it --rm pinto0309/l4t-base:r32.5.0\n```\n\n## 2. Example\n### 2-1. TensorFlow build example\n**`--local_ram_resources=n`** is the maximum size of RAM that the build process is allowed to use. **`--local_cpu_resources=n`** is the number of parallel execution of the build process. For x86 CPUs with hyper-threading enabled, the maximum number is twice the number of cores. For x86 CPUs with hyper-threading disabled, the number of cores is the maximum number. Note that a single build process can consume up to 2GB~4GB of RAM.\n```\n# TENSORFLOWVER=v2.4.1\n\n# git clone -b ${TENSORFLOWVER} https://github.com/tensorflow/tensorflow.git\n# cd tensorflow\n# ./configure\n\nYou have bazel 3.1.0- (@non-git) installed.\nPlease specify the location of python. [Default is /usr/bin/python3]: \n\n\nFound possible Python library paths:\n  /usr/local/lib/python3.6/dist-packages\n  /usr/lib/python3/dist-packages\nPlease input the desired Python library path to use.  Default is [/usr/local/lib/python3.6/dist-packages]\n\nDo you wish to build TensorFlow with ROCm support? [y/N]: n\nNo ROCm support will be enabled for TensorFlow.\n\nDo you wish to build TensorFlow with CUDA support? [y/N]: y\nCUDA support will be enabled for TensorFlow.\n\nDo you wish to build TensorFlow with TensorRT support? [y/N]: y\nNo TensorRT support will be enabled for TensorFlow.\n\nFound CUDA 10.2 in:\n    /usr/local/cuda-10.2/targets/aarch64-linux/lib\n    /usr/local/cuda-10.2/targets/aarch64-linux/include\nFound cuDNN 8 in:\n    /usr/lib/aarch64-linux-gnu\n    /usr/include\n\n\nPlease specify a list of comma-separated CUDA compute capabilities you want to build with.\nYou can find the compute capability of your device at: https://developer.nvidia.com/cuda-gpus. Each capability can be specified as \"x.y\" or \"compute_xy\" to include both virtual and binary GPU code, or as \"sm_xy\" to only include the binary code.\nPlease note that each additional compute capability significantly increases your build time and binary size, and that TensorFlow only supports compute capabilities \u003e= 3.5 [Default is: 3.5,7.0]: \n\n\nDo you want to use clang as CUDA compiler? [y/N]: n\nnvcc will be used as CUDA compiler.\n\nPlease specify which gcc should be used by nvcc as the host compiler. [Default is /usr/bin/gcc]: \n\n\nPlease specify optimization flags to use during compilation when bazel option \"--config=opt\" is specified [Default is -Wno-sign-compare]: \n\n\nWould you like to interactively configure ./WORKSPACE for Android builds? [y/N]: n\nNot configuring the WORKSPACE for Android builds.\n\nPreconfigured Bazel build configs. You can use any of the below by adding \"--config=\u003c\u003e\" to your build command. See .bazelrc for more details.\n\t--config=mkl         \t# Build with MKL support.\n\t--config=mkl_aarch64 \t# Build with oneDNN support for Aarch64.\n\t--config=monolithic  \t# Config for mostly static monolithic build.\n\t--config=ngraph      \t# Build with Intel nGraph support.\n\t--config=numa        \t# Build with NUMA support.\n\t--config=dynamic_kernels\t# (Experimental) Build kernels into separate shared objects.\n\t--config=v2          \t# Build TensorFlow 2.x instead of 1.x.\nPreconfigured Bazel build configs to DISABLE default on features:\n\t--config=noaws       \t# Disable AWS S3 filesystem support.\n\t--config=nogcp       \t# Disable GCP support.\n\t--config=nohdfs      \t# Disable HDFS support.\n\t--config=nonccl      \t# Disable NVIDIA NCCL support.\nConfiguration finished\n\n# bazel build \\\n  --config=cuda \\\n  --config=noaws \\\n  --config=nohdfs \\\n  --config=nonccl \\\n  --config=v2 \\\n  #--local_ram_resources=16384 \\\n  #--local_cpu_resources=6 \\\n  //tensorflow/tools/pip_package:build_pip_package\n```\n### 2-2. PyTorch build example\n```\n# TORCHVER=v1.7.1\n# VISIONVER=v0.8.2\n# AUDIOVER=v0.7.2\n\n# git clone -b ${TORCHVER} --recursive https://github.com/pytorch/pytorch\n# cd /pytorch \\\n    \u0026\u0026 sed -i -e \"/^if(DEFINED GLIBCXX_USE_CXX11_ABI)/i set(GLIBCXX_USE_CXX11_ABI 1)\" \\\n                 CMakeLists.txt \\\n    \u0026\u0026 pip3 install -r requirements.txt \\\n    \u0026\u0026 python3 setup.py build \\\n    \u0026\u0026 python3 setup.py bdist_wheel \\\n    \u0026\u0026 cd ..\n\n# pip3 install /pytorch/dist/*.whl \\\n\n# git clone -b ${VISIONVER} https://github.com/pytorch/vision.git\n# cd /vision \\\n    \u0026\u0026 python3 setup.py build \\\n    \u0026\u0026 python3 setup.py bdist_wheel \\\n    \u0026\u0026 cd ..\n\n# git clone -b ${AUDIOVER} https://github.com/pytorch/audio.git\n# cd /audio \\\n    \u0026\u0026 apt-get install -y sox libsox-dev \\\n    \u0026\u0026 python3 setup.py build \\\n    \u0026\u0026 python3 setup.py bdist_wheel \\\n    \u0026\u0026 cd ..\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinto0309%2Fjetson-tensorflow-pytorch-build","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpinto0309%2Fjetson-tensorflow-pytorch-build","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinto0309%2Fjetson-tensorflow-pytorch-build/lists"}