微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

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

我正在尝试在我的 Windows 笔记本电脑上从源代码构建带有 CUDA 的 JAX。我已经安装了 MSYS2。

我正在按照 here

给出的说明进行操作

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

而且我认为这可能是我收到错误的原因。但是,我无法弄清楚如何使用 realpath 安装 pacman,因为我在任何地方都找不到它。

对此的任何帮助表示赞赏。

我在下面给出了完整的错误信息。

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",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.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?