0

I am trying to build JAX with CUDA from source on my windows laptop. I have installed MSYS2.

I am following the instructions given here

However, I am unable to install realpath using pacman -S patch realpath as mentioned in the docs. I am getting the error error: target not found: realpath whenever I am running pacman -S realpath from MSYS2.

And I think that maybe the reason I am getting the error. However, I cannot figure out how to install realpath using pacman because I cannot find it anywhere.

Any help regarding this is appreciated.

I am giving the whole error message below.

Bazel binary path: C:\Program Files (x86)\Common Files\Bazel\bazel.EXE
Python binary path: C:/Users/manna/AppData/Local/Programs/Python/Python38/python.exe
Python version: 3.8
NumPy version: 1.21.0
SciPy version: 1.7.0
MKL-DNN enabled: yes
Target CPU: AMD64
Target CPU features: release
CUDA enabled: yes
CUDA toolkit path: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.1
CUDNN library path: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.1
CUDA compute capabilities: 6.1
CUDA version: 11.1
CUDNN version: 8.2.2
NCCL enabled: yes
TPU enabled: no
ROCm enabled: no
Building XLA and installing it in the jaxlib source tree...
C:\Program Files (x86)\Common Files\Bazel\bazel.EXE run --verbose_failures=true --config=short_logs --config=mkl_open_source_only --config=cuda --define=xla_python_enable_gpu=true :build_wheel -- --output_path=D:\jax\dist --cpu=AMD64
INFO: Options provided by the client:
 Inherited 'common' options: --isatty=1 --terminal_columns=80
INFO: Reading rc options for 'run' from d:\jax\.bazelrc:
 Inherited 'common' options: --experimental_repo_remote_exec
INFO: Options provided by the client:
 Inherited 'build' options: --python_path=C:/Users/manna/AppData/Local/Programs/Python/Python38/python.exe
INFO: Reading rc options for 'run' from d:\jax\.bazelrc:
 Inherited 'build' options: --repo_env PYTHON_BIN_PATH=C:/Users/manna/AppData/Local/Programs/Python/Python38/python.exe --action_env=PYENV_ROOT --python_path=C:/Users/manna/AppData/Local/Programs/Python/Python38/python.exe --repo_env TF_NEED_CUDA=1 --action_env TF_CUDA_COMPUTE_CAPABILITIES=6.1 --repo_env TF_NEED_ROCM=0 --action_env TF_ROCM_AMDGPU_TARGETS=gfx803,gfx900,gfx906,gfx1010 -c opt --apple_platform_type=macos --macos_minimum_os=10.9 --announce_rc --define open_source_build=true --define=no_kafka_support=true --define=no_ignite_support=true --define=grpc_no_ares=true --spawn_strategy=standalone --strategy=Genrule=standalone --enable_platform_specific_config --action_env CUDA_TOOLKIT_PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.1 --action_env CUDNN_INSTALL_PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.1 --action_env TF_CUDA_VERSION=11.1 --action_env TF_CUDNN_VERSION=8.2.2 --distinct_host_configuration=false
INFO: Found applicable config definition build:short_logs in file d:\jax\.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:mkl_open_source_only in file d:\jax\.bazelrc: --define=tensorflow_mkldnn_contraction_kernel=1
INFO: Found applicable config definition build:cuda in file d:\jax\.bazelrc: --crosstool_top=@local_config_cuda//crosstool:toolchain --@local_config_cuda//:enable_cuda
INFO: Found applicable config definition build:windows in file d:\jax\.bazelrc: --copt=/D_USE_MATH_DEFINES --host_copt=/D_USE_MATH_DEFINES --copt=-DWIN32_LEAN_AND_MEAN --host_copt=-DWIN32_LEAN_AND_MEAN --copt=-DNOGDI --host_copt=-DNOGDI --copt=/Zc:preprocessor --cxxopt=/std:c++14 --host_cxxopt=/std:c++14 --linkopt=/DEBUG --host_linkopt=/DEBUG --linkopt=/OPT:REF --host_linkopt=/OPT:REF --linkopt=/OPT:ICF --host_linkopt=/OPT:ICF --experimental_strict_action_env=true
INFO: Repository local_config_cuda instantiated at:
 D:/jax/WORKSPACE:30:10: in <toplevel>
 C:/users/manna/_bazel_manna/hwk42b7s/external/org_tensorflow/tensorflow/workspace2.bzl:1085:19: in workspace
 C:/users/manna/_bazel_manna/hwk42b7s/external/org_tensorflow/tensorflow/workspace2.bzl:90:19: in _tf_toolchains
Repository rule cuda_configure defined at:
 C:/users/manna/_bazel_manna/hwk42b7s/external/org_tensorflow/third_party/gpus/cuda_configure.bzl:1448:33: in <toplevel>
ERROR: An error occurred during the fetch of repository 'local_config_cuda':
 Traceback (most recent call last):
 File "C:/users/manna/_bazel_manna/hwk42b7s/external/org_tensorflow/third_party/gpus/cuda_configure.bzl", line 1401, column 38, in _cuda_autoconf_impl
 _create_local_cuda_repository(repository_ctx)
 File "C:/users/manna/_bazel_manna/hwk42b7s/external/org_tensorflow/third_party/gpus/cuda_configure.bzl", line 1239, column 56, in _create_local_cuda_repository
 host_compiler_includes + _cuda_include_path(
 File "C:/users/manna/_bazel_manna/hwk42b7s/external/org_tensorflow/third_party/gpus/cuda_configure.bzl", line 364, column 32, in _cuda_include_path
 inc_entries.append(realpath(repository_ctx, cuda_config.cuda_toolkit_path + "/include"))
 File "C:/users/manna/_bazel_manna/hwk42b7s/external/org_tensorflow/third_party/remote_config/common.bzl", line 290, column 19, in realpath
 return execute(repository_ctx, [bash_bin, "-c", "realpath \"%s\"" % path]).stdout.strip()
 File "C:/users/manna/_bazel_manna/hwk42b7s/external/org_tensorflow/third_party/remote_config/common.bzl", line 230, column 13, in execute
 fail(
Error in fail: Repository command failed
/usr/bin/bash: line 1: realpath: command not found
ERROR: Error fetching repository: Traceback (most recent call last):
 File "C:/users/manna/_bazel_manna/hwk42b7s/external/org_tensorflow/third_party/gpus/cuda_configure.bzl", line 1401, column 38, in _cuda_autoconf_impl
 _create_local_cuda_repository(repository_ctx)
 File "C:/users/manna/_bazel_manna/hwk42b7s/external/org_tensorflow/third_party/gpus/cuda_configure.bzl", line 1239, column 56, in _create_local_cuda_repository
 host_compiler_includes + _cuda_include_path(
 File "C:/users/manna/_bazel_manna/hwk42b7s/external/org_tensorflow/third_party/gpus/cuda_configure.bzl", line 364, column 32, in _cuda_include_path
 inc_entries.append(realpath(repository_ctx, cuda_config.cuda_toolkit_path + "/include"))
 File "C:/users/manna/_bazel_manna/hwk42b7s/external/org_tensorflow/third_party/remote_config/common.bzl", line 290, column 19, in realpath
 return execute(repository_ctx, [bash_bin, "-c", "realpath \"%s\"" % path]).stdout.strip()
 File "C:/users/manna/_bazel_manna/hwk42b7s/external/org_tensorflow/third_party/remote_config/common.bzl", line 230, column 13, in execute
 fail(
Error in fail: Repository command failed
/usr/bin/bash: line 1: realpath: command not found
INFO: Found applicable config definition build:cuda in file d:\jax\.bazelrc: --crosstool_top=@local_config_cuda//crosstool:toolchain --@local_config_cuda//:enable_cuda
ERROR: @local_config_cuda//:enable_cuda :: Error loading option @local_config_cuda//:enable_cuda: Repository command failed
/usr/bin/bash: line 1: realpath: command not found
b''
Traceback (most recent call last):
 File "build/build.py", line 597, in <module>
 File "build/build.py", line 592, in main
 File "build/build.py", line 52, in shell
 File "C:\Users\manna\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 411, in check_output
 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
 File "C:\Users\manna\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 512, in run
 raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['C:\\Program Files (x86)\\Common Files\\Bazel\\bazel.EXE', 'run', '--verbose_failures=true', '--config=short_logs', '--config=mkl_open_source_only', '--config=cuda', '--define=xla_python_enable_gpu=true', ':build_wheel', '--', '--output_path=D:\\jax\\dist', '--cpu=AMD64']' returned non-zero exit status 2.
asked Jul 17, 2021 at 13:25
7
  • Are you running pacman -s realpath or pacman -S realpath? Commented Jul 17, 2021 at 14:08
  • @HolyBlackCat I am running pacman -S realpath Commented Jul 17, 2021 at 14:19
  • @HolyBlackCat No, that is a typo. I corrected it Commented Jul 17, 2021 at 14:21
  • Does realpath work if you run it yourself? It's in the coreutils package, and should be installed by default. Commented Jul 17, 2021 at 14:24
  • 1
    @HolyBlackCat But the error still occurs when trying to build JAX from source. realpath command not found. After adding C:\msys64\usr\bin to the PATH, the error disappeared. Commented Jul 17, 2021 at 15:25

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.