使用CUDA安装JAX时出现错误“/usr/bin/bash:line 1:realpath:command not found”

2024-09-29 23:26:36 发布

您现在位置:Python中文网/ 问答频道 /正文

我正试图在我的windows笔记本电脑上用CUDA从源代码构建JAX。我已经安装了MSYS2

我正在按照指示行事here

但是,我无法使用文档中提到的pacman -S patch realpath安装realpath。每当我从MSYS2运行pacman -S realpath时,就会收到错误error: target not found: realpath

我想这可能是我出错的原因。但是,我不知道如何使用pacman安装realpath,因为我在任何地方都找不到它

任何有关这方面的帮助都将不胜感激

我在下面给出了整个错误消息

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.

Tags: pathinbuildconfigtensorflowlineusersexternal

热门问题