在Fedora 38上安装Jax遇问题,请求技术支持
Fedora 38 上 Jax 安装问题求助
此前在GitHub讨论区提问未获回复,现寻求Fedora 38上Jax的安装解决方案。尝试完成最简版Jax安装,具体操作及问题如下:
系统信息
>uname -a Linux brad-mobile 6.4.15-200.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Sep 7 00:25:01 UTC 2023 x86_64 GNU/Linux
官方PIP安装CPU版失败情况
按官方CPU版安装指引执行命令:
>pip install --upgrade "jax[cpu]" Defaulting to user installation because normal site-packages is not writeable Collecting jax[cpu] ... Successfully installed jax-0.4.18
启动Python导入jax时报错:
>python Python 3.11.5 (main, Aug 28 2023, 00:00:00) [GCC 13.2.1 20230728 (Red Hat 13.2.1-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import jax Traceback (most recent call last): ... RuntimeError: This version of jaxlib was built using AVX instructions, which your CPU and/or operating system do not support. You may be able work around this issue by building jaxlib from source.
源码编译jaxlib失败情况
已确认依赖环境满足要求:
>dnf info python3 ... Installed Packages Name : python3 Version : 3.11.5 ... >dnf info python3-devel ... Installed Packages Name : python3-devel Version : 3.11.5 ... >dnf info llvm ... Installed Packages Name : llvm Version : 16.0.6 Release : 3.fc38 ... >pip list | grep numpy numpy 1.24.4 pip list | grep wheel wheel 0.41.2 >pip list | grep build build 0.10.0
克隆源码并执行编译:
>git clone https://github.com/google/jax.git jax.git Cloning into 'jax.git'... ... Resolving deltas: 100% (89061/89061), done. >cd jax.git >python build/build.py _ _ __ __ | | / \ \ \/ / _ | |/ _ \ \ / | |_| / ___ \/ \ \___/_/ \/_/\_\ ... [594 / 6,049] Generating code from table: lib/Target/RISCV/RISCV.td @llvm-project//llvm:RISCVTargetParserDefGen__gen_riscv_target_def_genrule; 2s local ... (8 actions, 7 running) ERROR: /home/bradbell/.cache/bazel/_bazel_bradbell/81f0ce46861f9615223bf8c46633f0cc/external/llvm-project/llvm/BUILD.bazel:822:7: Generating code from table: include/llvm/IR/Attributes.td @llvm-project//llvm:attributes_gen__gen_attrs_genrule failed: (Illegal instruction): bash failed: error executing command (from target @llvm-project//llvm:attributes_gen__gen_attrs_genrule) (cd /home/bradbell/.cache/bazel/_bazel_bradbell/81f0ce46861f9615223bf8c46633f0cc/execroot/__main__ && \ exec env - \ LD_LIBRARY_PATH='' \ PATH=/home/bradbell/bin:/home/bradbell/devel:/home/bradbell/.local/bin:/home/bradbell/bin:/home/bradbell/.local/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin \ /bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh; bazel-out/k8-opt-exec-50AE0418/bin/external/llvm-project/llvm/llvm-min-tblgen -I external/llvm-project/llvm/include -I external/llvm-project/clang/include -I $(dirname external/llvm-project/llvm/include/llvm/IR/Attributes.td) -gen-attrs external/llvm-project/llvm/include/llvm/IR/Attributes.td -o bazel-out/k8-opt/bin/external/llvm-project/llvm/include/llvm/IR/Attributes.inc') # Configuration: a39dedde6abf8777e291fd040fec0636b686882b349344396e18811f9c5e08dd # Execution platform: @local_execution_config_platform//:platform ERROR: /home/bradbell/.cache/bazel/_bazel_bradbell/81f0ce46861f9615223bf8c46633f0cc/external/llvm-project/llvm/BUILD.bazel:1192:7: Generating code from table: lib/Target/RISCV/RISCV.td @llvm-project//llvm:RISCVTargetParserDefGen__gen_riscv_target_def_genrule [for tool] failed: (Illegal instruction): bash failed: error executing command (from target @llvm-project//llvm:RISCVTargetParserDefGen__gen_riscv_target_def_genrule) (cd /home/bradbell/.cache/bazel/_bazel_bradbell/81f0ce46861f9615223bf8c46633f0cc/execroot/__main__ && \ exec env - \ LD_LIBRARY_PATH='' \ PATH=/home/bradbell/bin:/home/bradbell/devel:/home/bradbell/.local/bin:/home/bradbell/bin:/home/bradbell/.local/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin \ /bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh; bazel-out/k8-opt-exec-50AE0418/bin/external/llvm-project/llvm/llvm-min-tblgen -I external/llvm-project/llvm/include -I external/llvm-project/clang/include -I $(dirname external/llvm-project/llvm/lib/Target/RISCV/RISCV.td) -gen-riscv-target-def external/llvm-project/llvm/lib/Target/RISCV/RISCV.td -o bazel-out/k8-opt-exec-50AE0418/bin/external/llvm-project/llvm/include/llvm/TargetParser/RISCVTargetParserDef.inc') # Configuration: 30990f7facce3ef11d90223b952af7e216aaeace3e7ddfb0d0a2bc1feff790b1 # Execution platform: @local_execution_config_platform//:platform [600 / 6,049] Generating code from table: include/llvm/IR/Intrinsics.td @llvm-project//llvm:intrinsic_X86_gen__gen_intrinsic_enums__intrinsic_prefix_x86_genrule; 2s local ... (2 actions running) Target //jaxlib/tools:build_wheel failed to build INFO: Elapsed time: 24.706s, Critical Path: 3.32s INFO: 12 processes: 9 internal, 3 local. FAILED: Build did NOT complete successfully ERROR: Build failed. Not running target Traceback (most recent call last): File "/home/bradbell/repo/jax.git/build/build.py", line 602, in <module> main() File "/home/bradbell/repo/jax.git/build/build.py", line 584, in main shell(command) File "/home/bradbell/repo/jax.git/build/build.py", line 44, in shell output = subprocess.check_output(cmd) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.11/subprocess.py", line 466, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.11/subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['./bazel-6.1.2-linux-x86_64', 'run', '--verbose_failures=true', '//jaxlib/tools:build_wheel', '--', '--output_path=/home/bradbell/repo/jax.git/dist', '--cpu=x86_64']' returned non-zero exit status 1.
恳请各位提供可行的解决方案,谢谢!
内容的提问来源于stack exchange,提问作者Brad Bell
相关产品推荐
相关产品推荐

