80 Commits
Author SHA1 Message Date
Maddipatla Chatan 170787f454 Enhance accelerator detection and JSON output
Refactor accelerator detection and JSON summary generation in tf_env_collect.sh. Improve temporary file handling and streamline pip list checks.
2026-08-31 06:50:20 +05:30
Roy Kim 9fc9bdf828 Redact google strings from --json output for parity with text report
The text report filters lines containing google (grep -v -i google) to
avoid leaking internal hostnames, depot paths, or build configurations
when users upload diagnostic logs. The new --json path wrote raw env
vars (TPU_NAME, XLA_FLAGS, paths) and TF device/version strings straight
to tf_env.json without that filter.

Add a recursive redact() helper that replaces any string value containing
google (case-insensitive) with [redacted] and apply it to the report
before writing, so tf_env.json matches the redaction safety of tf_env.txt.

Addresses review feedback from @sgarciagoogle.
2026-06-25 10:35:10 -07:00
Roy Kim dbd352edf9 tf_env_collect.sh: address review feedback
- Quote the LD_LIBRARY_PATH/DYLD_LIBRARY_PATH echoes in the env section.
- Prefer `command -v` over `which` for Python and c++ detection.
- Add an EXIT/INT/TERM trap so the temporary loaded-libs file is removed
  even when the script is interrupted.
- Add section banners to make the long collection block easier to scan.
2026-06-24 06:50:08 -07:00
Roy Kimandgemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> 5b82087dc8 Update tools/tf_env_collect.sh
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-06-23 17:21:05 -07:00
Roy Kimandgemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> d6499d76b2 Update tools/tf_env_collect.sh
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-06-23 17:20:56 -07:00
Roy Kimandgemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> 1252b23588 Update tools/tf_env_collect.sh
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-06-23 17:20:46 -07:00
Roy Kim 4c75d74b0f Enhance tools/tf_env_collect.sh for modern accelerators and add JSON output
Add ROCm/AMD GPU and Apple Silicon/Metal detection, surface hermetic
CUDA/ROCm and XLA/TPU build environment variables, report TensorFlow's
visible devices, and warn on conflicting TensorFlow installs. Add
--json, --verbose, --output, and --help flags and make missing-tool
handling robust across Linux and macOS. The default text report
(tf_env.txt) remains backward compatible.
2026-06-23 17:15:47 -07:00
RasheedAli-Shaik 15e1af8f94 Adopted f-strings for consistent Python formatting in tf_env_collect.sh
Replace older %-style string formatting with modern Python 3.6+ f-strings for all
environment info output in tf_env_collect.sh.

This change improves code consistency and readability by unifying the formatting
style across all Python code blocks within the script. F-strings are currently
the recommended standard in Python due to their clarity and performance.

No functionality is changed; the output remains identical. This stylistic update
supports easier ongoing maintenance and makes the codebase more inviting to new
contributors familiar with contemporary Python best practices.

Following the guidelines of clear, imperative, and descriptive commit messages,
this change documents *what* is updated and *why* the update is made, ensuring
future reviewers understand the motivation.

Reference: https://cbea.ms/git-commit/
2025-08-06 16:22:52 +05:30
Mitchell Ludwig c0898454d1 Added comments 2025-03-16 16:33:20 -06:00
Mitchell Ludwig eb1f516233 Fixing a lot of bugs and ancient code in the tf_env script 2025-03-14 21:07:27 -06:00
TensorFlower Gardener b6dedcb917 Merge pull request #25673 from Ryan-Qiyu-Jiang:env_capture_script_more_system_info_update
PiperOrigin-RevId: 254264543
2019-06-20 14:07:21 -07:00
TensorFlower Gardener 64a6966e9a Merge pull request #25833 from a6802739:environment_capture
PiperOrigin-RevId: 249262596
2019-05-21 09:24:48 -07:00
serv-inc ad10339dad also update the tf_env_collect script to work with 2.0 2019-04-05 14:37:46 +02:00
Yuxin Wu 813412f4c5 DEBUG_LD -> LD_DEBUG 2019-03-21 20:09:50 -07:00
blairhan acf46746ce type-o error fixed 2019-03-20 01:16:50 +09:00
a6802739 14f5227d37 add python and os information in environment capture script 2019-02-18 18:45:04 +08:00
ryan jiang 8593e24a4f added python version, bazel version, and tf installed info to env_capture_script 2019-02-11 13:03:59 -05:00
Jason Zaman b41761c499 Update to bazel-0.18.0 and use try-import
Bazel-0.18.0 adds a try-import option that will non-fatally try and
import a file. Use this for the configure options so that .bazelrc does
not need to change. ./configure rewriting .bazelrc makes using the git
repo annoying because the file is changed.

The allowed bazel range is now 0.18.0-0.20.0 inclusive. The env var
TF_IGNORE_MAX_BAZEL_VERSION can be set to skip the max bazel version
check.

Also optionally import a /.bazelrc.user file that is gitignored so
user-specific options can go in there.

Fixes: https://github.com/tensorflow/tensorflow/issues/22762
Fixes: https://github.com/tensorflow/tensorflow/pull/22906
Signed-off-by: Jason Zaman <jason@perfinion.com>
2018-12-05 08:34:07 +08:00
Gunhan Gulsoy eea816869a Automated rollback of commit 72f193b5c9
PiperOrigin-RevId: 222910206
2018-11-26 16:58:44 -08:00
A. Unique TensorFlower 72f193b5c9 Automated rollback of commit 54dc404a7d. Revert #23808.
PiperOrigin-RevId: 222548550
2018-11-22 09:03:34 -08:00
Sami Kama 6ee836b862 Review changes 2018-11-19 09:55:37 -08:00
Sami Kama b51ad2408b Add option to disable nccl 2018-11-16 14:16:23 -08:00
Gunhan Gulsoy ce126591bd Fix the macro definition flag for dynamic_kernels config option.
PiperOrigin-RevId: 217765509
2018-10-18 14:17:02 -07:00
Gunhan Gulsoy 6cd6115a7b Automated rollback of commit a98b34414f
PiperOrigin-RevId: 217572495
2018-10-17 13:08:49 -07:00
Jason Zaman c11b5458f8 Revert "Move bazel.rc to workspace root to support bazel-0.18.0"
This reverts commit a74a3217f7.

Bazel-0.18.0 is changing where it searches for .bazelrc files.
Originally it was removing /tools/bazel.rc and only using /.bazelrc.
This causes issues for gitignoring /.bazelrc and 0.18.0 has temporarily
added tools/bazel.rc back to the list until 0.19. The long term solution
is to use try-import but that statement is new in 0.18 and we are not
going to bump TF's minimum right away. When 0.19 is out things will need
to be changed back and the minimum bumped to 0.18.

Fixes: https://github.com/tensorflow/tensorflow/issues/22762
Fixes: https://github.com/tensorflow/tensorflow/pull/22906
Signed-off-by: Jason Zaman <jason@perfinion.com>
2018-10-14 13:59:17 +08:00
Jason Zaman a74a3217f7 Move bazel.rc to workspace root to support bazel-0.18.0
Bazel 0.18.0 will contain a change for which rc files it accepts.
https://github.com/bazelbuild/bazel/commit/ec83598cb6ee4136166bb562a24dc5dfa58921db
https://github.com/bazelbuild/bazel/issues/4502

Old bazel used to read %workspace%/tools/bazel.rc. New bazel will not
read that and instead will only read %workspace%/.bazelrc.

Signed-off-by: Jason Zaman <jason@perfinion.com>
2018-09-28 23:40:29 +08:00
TensorFlower Gardener 62e60166de Merge pull request #20277 from ROCmSoftwarePlatform:upstream-staging
PiperOrigin-RevId: 214793113
2018-09-27 10:22:55 -07:00
Gunhan Gulsoy 3da0dff642 Remove verbs, gdr and ngraph questions in configure script.
PiperOrigin-RevId: 214643700
2018-09-26 12:00:41 -07:00
A. Unique TensorFlower c63d21b0bf Adds a build flag to enable MKL (mkl_enabled=true).
PiperOrigin-RevId: 214557082
2018-09-25 23:02:36 -07:00
Jason Zaman 05b43db45d systemlibs: allow building with PREFIX other than /usr
Some use-cases want to build packages in a different path than /usr. For
example to have a set of packages independent from other system
binaries. This change allows building with bazel build
--define=PREFIX=/some/other/path to search that path instead. The
default of /usr is set in bazelrc so that building with no options will
work as before and setting PREFIX on the commandline or later in the
bazelrc will override that setting if desired. PREFIX is not used by the
bundled build so should not affect that at all.

This also adds a few other standard Make variables that can be
overridden independently if needed.

Signed-off-by: Jason Zaman <jason@perfinion.com>
2018-09-22 10:31:26 +08:00
Wen-Heng (Jack) Chung 69d3b8faf4 [ROCm] bazel build system and continuous integration logic
The commit contains following components to support TensorFlow on ROCm platform

- bazel build system
- continuous integration logic

Authors:

- Jack Chung: jack.chung@amd.com
- Jeffrey Poznanovic: Jeffrey.Poznanovic@amd.com
- Peng Sun: Peng.Sun@amd.com
2018-09-05 23:50:51 +00:00
Ilya Biryukov 1c3d02eb35 Use LLD when building with downloaded GPU toolchain
This improves build times when using the downloaded clang toolchain.

Additionally, remove '-B/usr/bin' flags from the cuda CROSSTOOL when using
the downloaded toolchain.
It was forcing 'clang' to first search for the linker in '/usr/bin',
preventing downloaded LLD from being selected.

PiperOrigin-RevId: 211430374
2018-09-04 03:15:01 -07:00
TensorFlower Gardener c26c9e6caa Merge pull request #20419 from hermanzdosilovic:patch-1
PiperOrigin-RevId: 207647916
2018-08-06 19:09:57 -07:00
Gunhan Gulsoy 5a5e42e575 Add a config option "dynamic_kernels" to build kernels in separate dsos.
PiperOrigin-RevId: 207327254
2018-08-03 15:01:06 -07:00
Herman Zvonimir Došilović 04a8b8ae9d Update bazel.rc 2018-07-26 02:17:31 +02:00
Herman Zvonimir Došilović 348c4696d2 Merge branch 'master' into patch-1 2018-07-26 00:03:07 +02:00
TensorFlower Gardener 4a00a65805 Merge pull request #20576 from Intel-tensorflow:mabuzain/avx-performance-fix
PiperOrigin-RevId: 204530874
2018-07-13 14:42:57 -07:00
A. Unique TensorFlower ab39198ace Add CROSSTOOL for Windows GPU build with nvcc compiler
After this change, to build TensorFlow with GPU support on Windows, you just need to follow the same procedure as Linux.

Also re-enable remote cache since the bug in b/111106393 has been fixed by the new wrapper script.

The clean-up of the wrapper scripts also made the build around 5 mins faster than using Bazel's msvc wrapper script.

PiperOrigin-RevId: 204105368
2018-07-11 04:59:54 -07:00
Mahmoud Abuzaina 64117da0c3 Fixing AVX performance issue 2018-07-05 13:56:22 -07:00
Herman Zvonimir Došilović cc1c870f97 Removed duplicated line in bazel.rc 2018-06-29 17:53:03 +02:00
Amit Patankar 3c87b99d8c Remove --distinct_host_configuration=false from tools/bazel.rc
Don't use --distinct_host_configuration=false by default, because it would break cross compiling, like android build and Raspberry Pi build.

Instead, we add it for builds that we know they have the same host and target platforms.

PiperOrigin-RevId: 199194260
2018-06-04 14:28:52 -07:00
A. Unique TensorFlower 6f971fb184 Adding --distinct_host_configuration=false in tools/bazel.rc
When building TensorFlow, the host and target platforms are usually the same. So we don't have to distinct them by default. This helps avoid building the same targets twice.

If we need to do cross compilation, add --config=cross-compile to distinct them.

PiperOrigin-RevId: 196673728
2018-05-15 08:41:22 -07:00
Ilya Biryukov 9e651e4571 Allow to download clang and use clang for CPU builds.
Previously we only allowed to download clang when doing GPU builds.

The added skylark files use bazel's autoconf scripts, which were only added in
0.10.0. To provide nice error message for older versions of bazel
(i.e. 'version is less than 0.10' vs 'can't load @bazel_tools/cpp/...'), we
move the bazel version check into WORKSPACE file from workspace.bzl.

PiperOrigin-RevId: 190050798
2018-03-22 05:36:18 -07:00
Austin Anderson 0f68a22758 Add --fat_apk_cpu=arm64-v8a for arm64 Android builds
Bazel silently uses the wrong build settings for --config=android_arm64 (--cpu=arm64-v8a is not enough), and actually still uses armeabi-v7a in at least some cases. --fat_apk_cpu fixes this.

See #15581 for more.

PiperOrigin-RevId: 181525260
2018-01-10 15:21:40 -08:00
Michael Case d31531af15 Move some build configs to tools/bazel.rc from configure.py
Moving --config=android_arm --config=mkl and --config=monolithic
build configs into tools/bazel.rc. These options are just always
written the same way to .bazelrc when configure.py is run. This
should trim down the scope of configure.py and make it easier to
build TF without running configure.py prior.

PiperOrigin-RevId: 180973131
2018-01-05 14:13:39 -08:00
Yifei Feng b1d8c59e9b Merge changes from github.
PiperOrigin-RevId: 176695926
2017-11-22 13:50:02 -08:00
Yifei Feng e70c00950d Automated g4 rollback of changelist 176615107
PiperOrigin-RevId: 176622438
2017-11-22 00:42:30 -08:00
Yifei Feng c6d603f02e Merge changes from github.
PiperOrigin-RevId: 176615107
2017-11-21 23:36:22 -08:00
A. Unique TensorFlower 061c3597b8 Upgrade gRPC version used in OSS. Fix-forward of #14262. Remove namespace-compatibility hack.
PiperOrigin-RevId: 175586521
2017-11-13 14:25:14 -08:00
Michael Case 0017742dd0 Clean up some redundant and unused build settings.
--copts are passed to both c++ and c (so is redundent with --cxxopts).
Configs passed to "bazel build" are inherited by "bazel run" and "bazel test".
Also removed some unused configs.

PiperOrigin-RevId: 175326697
2017-11-10 16:47:55 -08:00