-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failure to build jaxlib, AMD GPU #25204
Comments
python3 ./build/build.py build --wheels=jaxlib,jax-rocm-plugin,jax-rocm-pjrt --rocm_path=/opt/rocm-6.2.4 2024-12-03 00:21:06,886 - INFO - Building jaxlib for linux x86_64... 2024-12-03 00:40:05,229 - INFO - Building jax-rocm-plugin for linux x86_64... I tried again with no --local_xla_path flag. |
I already tried bazel clean --expunge |
I've been seeing the same issue. Any chance you've found a solution? |
Not yet, and give up to use pytorch. |
Just adding some investigation findings. Looks like the error comes from TSL adding this flag to its compiler options: https://github.com/google/tsl/pull/2944/files. I double-checked that I'm setting In the meantime, Wintoplay, if you're using an AMD GPU you can get a Docker container that has JAX in it or install it via pip: https://hub.docker.com/r/rocm/jax and https://github.com/ROCm/jax/releases. Curious as to what your use-case is for JAX that you're building from source and not using one of the AMD-provided ways of getting JAX. |
clang-18: error: unknown argument: '-fno-canonical-system-headers' So it is the result of my clang package having the name clang-18 and it think I am using gcc? How to work around that? and for why I want to build it, I just want to have the access to the latest version as ROCM build lack behind |
Thanks for using JAX on ROCm. We identified a Clang tooling issue in the XLA repository that is causing this problem. We are actively working to get this patch upstream. In the meantime, could you cherry-pick the following commit into your custom XLA repository? Once cherry-picked, you can use the following command (change accordingly) to build JAX + XLA:
Please let us know if you encounter any issues or need further assistance. |
Description
I can't build jaxlib.
python3 ./build/build.py build --wheels=jax-rocm-plugin --rocm_version=60 --rocm_path=/opt/rocm --local_xla_path=/media/win/storing/xla
2024-12-03 00:08:13,627 - INFO -
_ _ __ __
| | / \ \ / /
_ | |/ _ \ \ /
| || / ___ /
___// /_/_\
2024-12-03 00:08:13,630 - INFO - Building jax-rocm-plugin for linux x86_64...
2024-12-03 00:08:13,646 - INFO - Bazel options written to .jax_configure.bazelrc
2024-12-03 00:08:13,647 - INFO - [EXECUTING] ./bazel-6.5.0-linux-x86_64 run --repo_env=HERMETIC_PYTHON_VERSION=3.10 --verbose_failures=true --override_repository=xla="/media/win/storing/xla" --action_env=CLANG_COMPILER_PATH="/usr/lib/llvm-14/bin/clang" --repo_env=CC="/usr/lib/llvm-14/bin/clang" --repo_env=BAZEL_COMPILER="/usr/lib/llvm-14/bin/clang" --config=clang --config=mkl_open_source_only --config=avx_posix --config=rocm_base --config=rocm --action_env=CLANG_COMPILER_PATH="/usr/lib/llvm-14/bin/clang" --action_env=ROCM_PATH="/opt/rocm" --action_env=TF_ROCM_AMDGPU_TARGETS=gfx900,gfx906,gfx908,gfx90a,gfx940,gfx941,gfx942,gfx1030,gfx1100 //jaxlib/tools:build_gpu_kernels_wheel -- --output_path="/media/win/storing/jax/dist" --cpu=x86_64 --enable-rocm=True --platform_version=60 --jaxlib_git_hash=aff7714dc0f49cc0097e4db08e028b68182c8ab9
2024-12-03 00:08:13,683 - INFO - WARNING: The following configs were expanded more than once: [rocm_base, clang, mkl_open_source_only, avx_posix, rocm]. For repeatable flags, repeats are counted twice and may lead to unexpected behavior.
2024-12-03 00:08:13,683 - INFO - INFO: Options provided by the client:
2024-12-03 00:08:13,683 - INFO - Inherited 'common' options: --isatty=0 --terminal_columns=80
2024-12-03 00:08:13,683 - INFO - INFO: Reading rc options for 'run' from /media/win/storing/jax/.bazelrc:
2024-12-03 00:08:13,683 - INFO - Inherited 'common' options: --experimental_repo_remote_exec
2024-12-03 00:08:13,683 - INFO - INFO: Reading rc options for 'run' from /media/win/storing/jax/.bazelrc:
2024-12-03 00:08:13,683 - INFO - Inherited 'build' options: --announce_rc --spawn_strategy=local --enable_platform_specific_config --experimental_cc_shared_library --define=grpc_no_ares=true --define=tsl_link_protobuf=true -c opt --output_filter=DONT_MATCH_ANYTHING --copt=-DMLIR_PYTHON_PACKAGE_PREFIX=jaxlib.mlir.
2024-12-03 00:08:13,683 - INFO - INFO: Reading rc options for 'run' from /media/win/storing/jax/.jax_configure.bazelrc:
2024-12-03 00:08:13,683 - INFO - Inherited 'build' options: --repo_env=HERMETIC_PYTHON_VERSION=3.10 --verbose_failures=true --override_repository=xla=/media/win/storing/xla --action_env=CLANG_COMPILER_PATH=/usr/lib/llvm-14/bin/clang --repo_env=CC=/usr/lib/llvm-14/bin/clang --repo_env=BAZEL_COMPILER=/usr/lib/llvm-14/bin/clang --config=clang --config=mkl_open_source_only --config=avx_posix --config=rocm_base --config=rocm --action_env=CLANG_COMPILER_PATH=/usr/lib/llvm-14/bin/clang --action_env=ROCM_PATH=/opt/rocm --action_env=TF_ROCM_AMDGPU_TARGETS=gfx900,gfx906,gfx908,gfx90a,gfx940,gfx941,gfx942,gfx1030,gfx1100
2024-12-03 00:08:13,683 - INFO - INFO: Found applicable config definition build:clang in file /media/win/storing/jax/.bazelrc: --copt=-Wno-gnu-offsetof-extensions --copt=-Qunused-arguments
2024-12-03 00:08:13,684 - INFO - INFO: Found applicable config definition build:mkl_open_source_only in file /media/win/storing/jax/.bazelrc: --define=tensorflow_mkldnn_contraction_kernel=1
2024-12-03 00:08:13,684 - INFO - INFO: Found applicable config definition build:avx_posix in file /media/win/storing/jax/.bazelrc: --copt=-mavx --host_copt=-mavx
2024-12-03 00:08:13,684 - INFO - INFO: Found applicable config definition build:rocm_base in file /media/win/storing/jax/.bazelrc: --crosstool_top=@local_config_rocm//crosstool:toolchain --define=using_rocm=true --define=using_rocm_hipcc=true --repo_env TF_NEED_ROCM=1 --action_env TF_ROCM_AMDGPU_TARGETS=gfx900,gfx906,gfx908,gfx90a,gfx940,gfx941,gfx942,gfx1030,gfx1100
2024-12-03 00:08:13,684 - INFO - INFO: Found applicable config definition build:rocm in file /media/win/storing/jax/.bazelrc: --config=rocm_base --action_env=TF_ROCM_CLANG=1 --action_env=CLANG_COMPILER_PATH=/usr/lib/llvm-18/bin/clang --copt=-Wno-gnu-offsetof-extensions --copt=-Qunused-arguments --action_env=TF_HIPCC_CLANG=1
2024-12-03 00:08:13,684 - INFO - INFO: Found applicable config definition build:rocm_base in file /media/win/storing/jax/.bazelrc: --crosstool_top=@local_config_rocm//crosstool:toolchain --define=using_rocm=true --define=using_rocm_hipcc=true --repo_env TF_NEED_ROCM=1 --action_env TF_ROCM_AMDGPU_TARGETS=gfx900,gfx906,gfx908,gfx90a,gfx940,gfx941,gfx942,gfx1030,gfx1100
2024-12-03 00:08:13,684 - INFO - INFO: Found applicable config definition build:clang in file /media/win/storing/jax/.bazelrc: --copt=-Wno-gnu-offsetof-extensions --copt=-Qunused-arguments
2024-12-03 00:08:13,684 - INFO - INFO: Found applicable config definition build:mkl_open_source_only in file /media/win/storing/jax/.bazelrc: --define=tensorflow_mkldnn_contraction_kernel=1
2024-12-03 00:08:13,684 - INFO - INFO: Found applicable config definition build:avx_posix in file /media/win/storing/jax/.bazelrc: --copt=-mavx --host_copt=-mavx
2024-12-03 00:08:13,684 - INFO - INFO: Found applicable config definition build:rocm_base in file /media/win/storing/jax/.bazelrc: --crosstool_top=@local_config_rocm//crosstool:toolchain --define=using_rocm=true --define=using_rocm_hipcc=true --repo_env TF_NEED_ROCM=1 --action_env TF_ROCM_AMDGPU_TARGETS=gfx900,gfx906,gfx908,gfx90a,gfx940,gfx941,gfx942,gfx1030,gfx1100
2024-12-03 00:08:13,684 - INFO - INFO: Found applicable config definition build:rocm in file /media/win/storing/jax/.bazelrc: --config=rocm_base --action_env=TF_ROCM_CLANG=1 --action_env=CLANG_COMPILER_PATH=/usr/lib/llvm-18/bin/clang --copt=-Wno-gnu-offsetof-extensions --copt=-Qunused-arguments --action_env=TF_HIPCC_CLANG=1
2024-12-03 00:08:13,684 - INFO - INFO: Found applicable config definition build:rocm_base in file /media/win/storing/jax/.bazelrc: --crosstool_top=@local_config_rocm//crosstool:toolchain --define=using_rocm=true --define=using_rocm_hipcc=true --repo_env TF_NEED_ROCM=1 --action_env TF_ROCM_AMDGPU_TARGETS=gfx900,gfx906,gfx908,gfx90a,gfx940,gfx941,gfx942,gfx1030,gfx1100
2024-12-03 00:08:13,684 - INFO - INFO: Found applicable config definition build:linux in file /media/win/storing/jax/.bazelrc: --config=posix --copt=-Wno-unknown-warning-option --copt=-Wno-stringop-truncation --copt=-Wno-array-parameter
2024-12-03 00:08:13,684 - INFO - INFO: Found applicable config definition build:posix in file /media/win/storing/jax/.bazelrc: --copt=-fvisibility=hidden --copt=-Wno-sign-compare --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
2024-12-03 00:08:13,705 - INFO - Loading:
2024-12-03 00:08:13,716 - INFO - ERROR: /media/win/storing/jax/WORKSPACE:38:26: //external:python_dev: no such attribute 'version_variant' in 'custom_python_interpreter' rule
2024-12-03 00:08:13,738 - INFO - ERROR: Error computing the main repository mapping: at /home/win/.cache/bazel/_bazel_win/68b1c5f84d40bc8954a3200dd8f20909/external/xla/workspace3.bzl:4:6: Encountered error while reading extension file 'workspace3.bzl': no such package '@tsl//': error loading package 'external': Could not load //external package
Traceback (most recent call last):
File "/media/win/storing/jax/./build/build.py", line 610, in
asyncio.run(main())
File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/media/win/storing/jax/./build/build.py", line 603, in main
raise RuntimeError(f"Command failed with return code {result.return_code}")
RuntimeError: Command failed with return code 1
System info (python version, jaxlib version, accelerator, etc.)
Rocm: 6.2.4
attempting to build from source
https://github.com/jax-ml/jax
0.4.35
command python3 ./build/build.py build --wheels=jax-rocm-plugin --rocm_version=60 --rocm_path=/opt/rocm --local_xla_path=/media/win/storing/xla
failed
7900xtx AMD GPU
The text was updated successfully, but these errors were encountered: