Skip to content
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

Building from source error #9490

Closed
samsha1971 opened this issue Mar 21, 2025 · 4 comments
Closed

Building from source error #9490

samsha1971 opened this issue Mar 21, 2025 · 4 comments

Comments

@samsha1971
Copy link

🐛 Describe the bug

OS: Ubuntu 22.04 LTS

By: https://pytorch.org/executorch/main/using-executorch-building-from-source.html.

Buildiing from source:

git clone --branch viable/strict https://github.com/pytorch/executorch.git
cd executorch
git submodule sync
git submodule update --init
./install_executorch.sh

logs:

Building wheels for collected packages: executorch
  Running command Building wheel for executorch (pyproject.toml)
  running bdist_wheel
  running build
  command options for 'CustomBuild':
    build_base = pip-out
    build_purelib = pip-out/lib
    build_platlib = pip-out/lib.linux-x86_64-cpython-310
    build_lib = pip-out/lib.linux-x86_64-cpython-310
    build_scripts = pip-out/scripts-3.10
    build_temp = pip-out/temp.linux-x86_64-cpython-310
    plat_name = linux-x86_64
    compiler = None
    parallel = 31
    debug = None
    force = None
    executable = /home/sam/anaconda3/envs/executorch/bin/python
  deleting /data/sam/projects/executorch/pip-out/temp.linux-x86_64-cpython-310/cmake-out/CMakeCache.txt
  Traceback (most recent call last):
    File "<string>", line 733, in run
    File "/home/sam/anaconda3/envs/executorch/lib/python3.10/subprocess.py", line 526, in run
      raise CalledProcessError(retcode, process.args,
  subprocess.CalledProcessError: Command '['cmake', '-S', '/data/sam/projects/executorch', '-B', '/data/sam/projects/executorch/pip-out/temp.linux-x86_64-cpython-310/cmake-out', '-DBUCK2=', '-DPYTHON_EXECUTABLE=/home/sam/anaconda3/envs/executorch/bin/python', '-DCMAKE_PREFIX_PATH=/home/sam/anaconda3/envs/executorch/lib/python3.10/site-packages', '-DCMAKE_BUILD_TYPE=Release', '-DEXECUTORCH_ENABLE_LOGGING=ON', '-DEXECUTORCH_LOG_LEVEL=Info', '-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15', '-DEXECUTORCH_SEPARATE_FLATCC_HOST_PROJECT=OFF', '-DEXECUTORCH_BUILD_PYBIND=ON', '-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON', '-DEXECUTORCH_BUILD_KERNELS_QUANTIZED_AOT=ON', '-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON', '-DEXECUTORCH_BUILD_KERNELS_CUSTOM_AOT=ON', '-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON', '-DEXECUTORCH_BUILD_KERNELS_QUANTIZED_AOT=ON', '-DEXECUTORCH_BUILD_XNNPACK=ON']' returned non-zero exit status 1.

  The above exception was the direct cause of the following exception:

  Traceback (most recent call last):
    File "/home/sam/anaconda3/envs/executorch/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
      main()
    File "/home/sam/anaconda3/envs/executorch/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
      json_out["return_val"] = hook(**hook_input["kwargs"])
    File "/home/sam/anaconda3/envs/executorch/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 280, in build_wheel
      return _build_backend().build_wheel(
    File "/home/sam/anaconda3/envs/executorch/lib/python3.10/site-packages/setuptools/build_meta.py", line 438, in build_wheel
      return _build(['bdist_wheel', '--dist-info-dir', str(metadata_directory)])
    File "/home/sam/anaconda3/envs/executorch/lib/python3.10/site-packages/setuptools/build_meta.py", line 426, in _build
      return self._build_with_temp_dir(
    File "/home/sam/anaconda3/envs/executorch/lib/python3.10/site-packages/setuptools/build_meta.py", line 407, in _build_with_temp_dir
      self.run_setup()
    File "/home/sam/anaconda3/envs/executorch/lib/python3.10/site-packages/setuptools/build_meta.py", line 320, in run_setup
      exec(code, locals())
    File "<string>", line 833, in <module>
    File "/home/sam/anaconda3/envs/executorch/lib/python3.10/site-packages/setuptools/__init__.py", line 117, in setup
      return distutils.core.setup(**attrs)
    File "/home/sam/anaconda3/envs/executorch/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 186, in setup
      return run_commands(dist)
    File "/home/sam/anaconda3/envs/executorch/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 202, in run_commands
      dist.run_commands()
    File "/home/sam/anaconda3/envs/executorch/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 983, in run_commands
      self.run_command(cmd)
    File "/home/sam/anaconda3/envs/executorch/lib/python3.10/site-packages/setuptools/dist.py", line 999, in run_command
      super().run_command(command)
    File "/home/sam/anaconda3/envs/executorch/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command
      cmd_obj.run()
    File "/home/sam/anaconda3/envs/executorch/lib/python3.10/site-packages/setuptools/command/bdist_wheel.py", line 379, in run
      self.run_command("build")
    File "/home/sam/anaconda3/envs/executorch/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 339, in run_command
      self.distribution.run_command(command)
    File "/home/sam/anaconda3/envs/executorch/lib/python3.10/site-packages/setuptools/dist.py", line 999, in run_command
      super().run_command(command)
    File "/home/sam/anaconda3/envs/executorch/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command
      cmd_obj.run()
    File "<string>", line 753, in run
  Exception: CMake Deprecation Warning at backends/xnnpack/third-party/FXdiv/CMakeLists.txt:1 (CMAKE_MINIMUM_REQUIRED):
    Compatibility with CMake < 3.10 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
    to tell CMake that the project requires at least <min> but has been updated
    to work with policies introduced by <max> or earlier.


  CMake Deprecation Warning at backends/xnnpack/third-party/cpuinfo/CMakeLists.txt:1 (CMAKE_MINIMUM_REQUIRED):
    Compatibility with CMake < 3.10 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
    to tell CMake that the project requires at least <min> but has been updated
    to work with policies introduced by <max> or earlier.


  CMake Deprecation Warning at backends/xnnpack/third-party/pthreadpool/CMakeLists.txt:1 (CMAKE_MINIMUM_REQUIRED):
    Compatibility with CMake < 3.10 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
    to tell CMake that the project requires at least <min> but has been updated
    to work with policies introduced by <max> or earlier.


  Error while generating /data/sam/projects/executorch/pip-out/temp.linux-x86_64-cpython-310/cmake-out/executorch_srcs.cmake. Exit code: 1
  Output:

  Error:
  2025-03-21 20:42:25,725 [ExecuTorch] ERROR: Failed to query buck for sources. Failed command:

     buck2 cquery inputs(deps('//kernels/optimized:generated_lib'))

  This is likely due to missing git submodules or outdated CMake cache. Please run the following before retry:

      ./install_executorch.sh --clean
      git submodule sync
      git submodule update --init

  Traceback (most recent call last):
    File "/data/sam/projects/executorch/tools/cmake/buck_util.py", line 34, in run
      cp: subprocess.CompletedProcess = subprocess.run(
    File "/home/sam/anaconda3/envs/executorch/lib/python3.10/subprocess.py", line 526, in run
      raise CalledProcessError(retcode, process.args,
  subprocess.CalledProcessError: Command '['/data/sam/projects/executorch/buck2-bin/buck2-edae27cfca00053d9c5f7c7be81b6b0d7d07573a50be374ce53a9d8692afa5fc', 'cquery', "inputs(deps('//kernels/optimized:generated_lib'))"]' returned non-zero exit status 2.

  The above exception was the direct cause of the following exception:

  Traceback (most recent call last):
    File "/data/sam/projects/executorch/tools/cmake/extract_sources.py", line 255, in <module>
      main()
    File "/data/sam/projects/executorch/tools/cmake/extract_sources.py", line 240, in main
      target_to_srcs[name] = sorted(target.get_sources(graph, runner, buck_args))
    File "/data/sam/projects/executorch/tools/cmake/extract_sources.py", line 144, in get_sources
      raise e
    File "/data/sam/projects/executorch/tools/cmake/extract_sources.py", line 132, in get_sources
      sources: set[str] = set(runner.run(["cquery", query] + buck_args))
    File "/data/sam/projects/executorch/tools/cmake/buck_util.py", line 42, in run
      raise RuntimeError(ex.stderr.decode("utf-8")) from ex
  RuntimeError: [2025-03-21T20:42:25.722+08:00] Build ID: a997a642-9c4f-4b3a-85a6-12490905148f
  Command failed:
  From load at kernels/optimized/TARGETS:4

  Caused by:
      0: From load at kernels/optimized/targets.bzl:3
      1: From load at kernels/optimized/lib_defs.bzl:2
      2: read_to_string_if_exists(/data/sam/projects/executorch/shim_et/tools/build_defs/fb_native_wrapper.bzl)
      3: Not a directory (os error 20)


  CMake Error at tools/cmake/Utils.cmake:236 (message):
    executorch: source list generation failed
  Call Stack (most recent call first):
    CMakeLists.txt:404 (extract_sources)




  error: subprocess-exited-with-error
  
  × Building wheel for executorch (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /home/sam/anaconda3/envs/executorch/bin/python /home/sam/anaconda3/envs/executorch/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /tmp/tmpnor3_sgw
  cwd: /data/sam/projects/executorch
  Building wheel for executorch (pyproject.toml) ... error
  ERROR: Failed building wheel for executorch
Failed to build executorch
ERROR: Failed to build installable wheels for some pyproject.toml based projects (executorch)
Traceback (most recent call last):
  File "/data/sam/projects/executorch/./install_executorch.py", line 275, in <module>
    main(sys.argv[1:])
  File "/data/sam/projects/executorch/./install_executorch.py", line 250, in main
    subprocess.run(
  File "/home/sam/anaconda3/envs/executorch/lib/python3.10/subprocess.py", line 526, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/home/sam/anaconda3/envs/executorch/bin/python', '-m', 'pip', 'install', '.', '--no-build-isolation', '-v', '--extra-index-url', 'https://download.pytorch.org/whl/nightly/cpu']' returned non-zero exit status 1.

Versions

Collecting environment information...
PyTorch version: 2.7.0.dev20250311+cpu
Is debug build: False
CUDA used to build PyTorch: Could not collect
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.5 LTS (x86_64)
GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version: Could not collect
CMake version: version 3.31.6
Libc version: glibc-2.35

Python version: 3.10.16 (main, Dec 11 2024, 16:24:50) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-6.8.0-56-generic-x86_64-with-glibc2.35
Is CUDA available: False
CUDA runtime version: 12.4.131
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 4090
Nvidia driver version: 550.54.15
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.9.7
/usr/lib/x86_64-linux-gnu/libcudnn.so.9.8.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv.so.9.8.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.9.7
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.9.7
/usr/lib/x86_64-linux-gnu/libcudnn_cnn.so.9.8.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.9.7
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.9.7
/usr/lib/x86_64-linux-gnu/libcudnn_engines_precompiled.so.9.8.0
/usr/lib/x86_64-linux-gnu/libcudnn_engines_runtime_compiled.so.9.8.0
/usr/lib/x86_64-linux-gnu/libcudnn_graph.so.9.8.0
/usr/lib/x86_64-linux-gnu/libcudnn_heuristic.so.9.8.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops.so.9.8.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.9.7
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.9.7
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 46 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 32
On-line CPU(s) list: 0-31
Vendor ID: GenuineIntel
Model name: 13th Gen Intel(R) Core(TM) i9-13900K
CPU family: 6
Model: 183
Thread(s) per core: 2
Core(s) per socket: 24
Socket(s): 1
Stepping: 1
CPU max MHz: 5800.0000
CPU min MHz: 800.0000
BogoMIPS: 5990.40
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves split_lock_detect user_shstk avx_vnni dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req hfi vnmi umip pku ospke waitpkg gfni vaes vpclmulqdq tme rdpid movdiri movdir64b fsrm md_clear serialize pconfig arch_lbr ibt flush_l1d arch_capabilities
Virtualization: VT-x
L1d cache: 896 KiB (24 instances)
L1i cache: 1.3 MiB (24 instances)
L2 cache: 32 MiB (12 instances)
L3 cache: 36 MiB (1 instance)
NUMA node(s): 1
NUMA node0 CPU(s): 0-31
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Reg file data sampling: Mitigation; Clear Register File
Vulnerability Retbleed: Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Enhanced / Automatic IBRS; IBPB conditional; RSB filling; PBRSB-eIBRS SW sequence; BHI BHI_DIS_S
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected

Versions of relevant libraries:
[pip3] numpy==2.0.0
[pip3] nvidia-cublas-cu12==12.4.5.8
[pip3] nvidia-cuda-cupti-cu12==12.4.127
[pip3] nvidia-cuda-nvrtc-cu12==12.4.127
[pip3] nvidia-cuda-runtime-cu12==12.4.127
[pip3] nvidia-cudnn-cu12==9.1.0.70
[pip3] nvidia-cufft-cu12==11.2.1.3
[pip3] nvidia-curand-cu12==10.3.5.147
[pip3] nvidia-cusolver-cu12==11.6.1.9
[pip3] nvidia-cusparse-cu12==12.3.1.170
[pip3] nvidia-cusparselt-cu12==0.6.2
[pip3] nvidia-nccl-cu12==2.21.5
[pip3] nvidia-nvjitlink-cu12==12.4.127
[pip3] nvidia-nvtx-cu12==12.4.127
[pip3] torch==2.7.0.dev20250311+cpu
[pip3] torchao==0.10.0+git7d8794622
[pip3] torchaudio==2.6.0.dev20250311+cpu
[pip3] torchsr==1.0.4
[pip3] torchtune==0.5.0
[pip3] torchvision==0.22.0.dev20250311+cpu
[pip3] triton==3.2.0
[conda] numpy 2.0.0 pypi_0 pypi
[conda] nvidia-cublas-cu12 12.4.5.8 pypi_0 pypi
[conda] nvidia-cuda-cupti-cu12 12.4.127 pypi_0 pypi
[conda] nvidia-cuda-nvrtc-cu12 12.4.127 pypi_0 pypi
[conda] nvidia-cuda-runtime-cu12 12.4.127 pypi_0 pypi
[conda] nvidia-cudnn-cu12 9.1.0.70 pypi_0 pypi
[conda] nvidia-cufft-cu12 11.2.1.3 pypi_0 pypi
[conda] nvidia-curand-cu12 10.3.5.147 pypi_0 pypi
[conda] nvidia-cusolver-cu12 11.6.1.9 pypi_0 pypi
[conda] nvidia-cusparse-cu12 12.3.1.170 pypi_0 pypi
[conda] nvidia-cusparselt-cu12 0.6.2 pypi_0 pypi
[conda] nvidia-nccl-cu12 2.21.5 pypi_0 pypi
[conda] nvidia-nvjitlink-cu12 12.4.127 pypi_0 pypi
[conda] nvidia-nvtx-cu12 12.4.127 pypi_0 pypi
[conda] torch 2.7.0.dev20250311+cpu pypi_0 pypi
[conda] torchao 0.10.0+git7d8794622 pypi_0 pypi
[conda] torchaudio 2.6.0.dev20250311+cpu pypi_0 pypi
[conda] torchsr 1.0.4 pypi_0 pypi
[conda] torchtune 0.5.0 pypi_0 pypi
[conda] torchvision 0.22.0.dev20250311+cpu pypi_0 pypi
[conda] triton 3.2.0 pypi_0 pypi

@kimishpatel
Copy link
Contributor

Seems like generated_lib related issues where buck query is failing. @larryliu0820

@kimishpatel
Copy link
Contributor

Seems like it is not able to find data/sam/projects/executorch/shim_et/tools/build_defs/fb_native_wrapper.bzl

@kimishpatel
Copy link
Contributor

@samsha1971 can you check if you have this directory shim_et/tools/build_defs in your clone?

@samsha1971
Copy link
Author

@kimishpatel The code was copied from Windows but the soft links were lost in linux. The problem has been solved. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants