Skip to content

Installing from source on Google Cloud Ubuntu 24.04 #8311

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

Closed
SFrav opened this issue Feb 7, 2025 · 8 comments · Fixed by #8431
Closed

Installing from source on Google Cloud Ubuntu 24.04 #8311

SFrav opened this issue Feb 7, 2025 · 8 comments · Fixed by #8431
Assignees
Labels
module: build/install Issues related to the cmake and buck2 builds, and to installing ExecuTorch need-user-input The issue needs more information from the reporter before moving forward triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@SFrav
Copy link

SFrav commented Feb 7, 2025

Sorry to bother with a minor install issue.

I can install from source on my local machine just fine. However on a Google Cloud machine I have been unable to troubleshoot the following error:

    File "/conda/lib/python3.12/site-packages/setuptools/dist.py", line 950, in run_command
      super().run_command(command)
    File "/conda/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
      cmd_obj.run()
    File "<string>", line 619, in run
    File "<string>", line 258, in get_build_type
  ValueError: invalid literal for int() with base 10: ''
  error: subprocess-exited-with-error

The Google Cloud machine is running Ubuntu 24.04 and I have installed g++ (13.3.0) and clang++ (18.1.3).

For the installation I followed the guide linked below, using a Python 3.10.0 virtual environment. https://pytorch.org/executorch/main/getting-started-setup

I am only wanting to export a pte file for a model that is too large for my local machine. The version available through pip doesn't seem to be able to do this.

Do you have other troubleshooting tips?

cc @larryliu0820

@digantdesai
Copy link
Contributor

What is the version of setuptools installed? Is this an issue with setuptools?

Trying to figure out what input is different between two machines. Can you give me full stack trace as well?

@digantdesai digantdesai added module: build/install Issues related to the cmake and buck2 builds, and to installing ExecuTorch triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module labels Feb 7, 2025
@SFrav
Copy link
Author

SFrav commented Feb 7, 2025

setuptools is the latest version, 75.8.0.

Stack trace as follows:

2025-02-07 17:54:58,630 [ExecuTorch] INFO:   executable = /conda/envs/executorch/bin/python
  Traceback (most recent call last):
    File "/conda/envs/executorch/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
      main()
    File "/conda/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 "/conda/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 "/conda/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 "/conda/envs/executorch/lib/python3.10/site-packages/setuptools/build_meta.py", line 426, in _build
      return self._build_with_temp_dir(
    File "/conda/envs/executorch/lib/python3.10/site-packages/setuptools/build_meta.py", line 407, in _build_with_temp_dir
      self.run_setup()
    File "/conda/envs/executorch/lib/python3.10/site-packages/setuptools/build_meta.py", line 320, in run_setup
      exec(code, locals())
    File "<string>", line 863, in <module>
    File "<string>", line 832, in main
    File "/conda/envs/executorch/lib/python3.10/site-packages/setuptools/__init__.py", line 117, in setup
      return distutils.core.setup(**attrs)
    File "/conda/envs/executorch/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 186, in setup
      return run_commands(dist)
    File "/conda/envs/executorch/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 202, in run_commands
      dist.run_commands()
    File "/conda/envs/executorch/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 983, in run_commands
      self.run_command(cmd)
    File "/conda/envs/executorch/lib/python3.10/site-packages/setuptools/dist.py", line 999, in run_command
      super().run_command(command)
    File "/conda/envs/executorch/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command
      cmd_obj.run()
    File "/conda/envs/executorch/lib/python3.10/site-packages/setuptools/command/bdist_wheel.py", line 379, in run
      self.run_command("build")
    File "/conda/envs/executorch/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 339, in run_command
      self.distribution.run_command(command)
    File "/conda/envs/executorch/lib/python3.10/site-packages/setuptools/dist.py", line 999, in run_command
      super().run_command(command)
    File "/conda/envs/executorch/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command
      cmd_obj.run()
    File "<string>", line 619, in run
    File "<string>", line 258, in get_build_type
  ValueError: invalid literal for int() with base 10: ''
  error: subprocess-exited-with-error

@SFrav
Copy link
Author

SFrav commented Feb 8, 2025

These are the four most recent attempts to try and resolve this. These all produce the same error.

conda create -yn ex python=3.10.0
conda activate ex
git clone --branch viable/strict https://github.com/pytorch/executorch.git
cd executorch
git submodule sync
git submodule update --init
pip install setuptools==73.0.1
sudo apt install clang++
sudo apt install gcc g++ build-essential python3-dev ninja-build python3-pip
./install_executorch.sh --pybind xnnpack

sudo apt install clang++-18
sudo ln -s /usr/bin/clang-18 /usr/bin/clang
sudo ln -s /usr/bin/clang++-18 /usr/bin/clang++
./install_executorch.sh --pybind xnnpack
  
sudo apt install gcc-9 g++-9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90 --slave /usr/bin/g++ g++ /usr/bin/g++-9 --slave /usr/bin/gcov gcov /usr/bin/gcov-9
export CC=gcc
export CXX=g++
./install_executorch.sh --pybind xnnpack

pip uninstall setuptools wheel
pip install --no-cache-dir setuptools==73.0.1 wheel
./install_executorch.sh --pybind xnnpack

@digantdesai
Copy link
Contributor

File "<string>", line 258, in get_build_type ValueError: invalid literal for int() with base 10: ''

What is the input command/string here?

@SFrav
Copy link
Author

SFrav commented Feb 11, 2025

I'm not sure what the input is. Would that be a value passed from install_executorch.py to setuptools?
Is there a flag I can add or minor edit I can make to help debug?

@digantdesai
Copy link
Contributor

If I were to guess, this is coming from here. And I guess DEBUG in the env is an empty string?

I can try to repro

digantdesai added a commit that referenced this issue Feb 12, 2025
Summary:

This was not handled and run into `int("")` failing.

Test Plan:

Locally tested installing with `export DEBUG=""`.

Reviewers:

Subscribers:

Tasks:
Resolves #8311

Tags:
@digantdesai
Copy link
Contributor

Try the PR?

@digantdesai digantdesai added the need-user-input The issue needs more information from the reporter before moving forward label Feb 12, 2025
@SFrav
Copy link
Author

SFrav commented Feb 13, 2025

Yes. That resolved the issue. This now installs on a Google Cloud machine with Ubuntu 24.04. Not so relevant to the issue, but for full reproducibility I used g++ (13.3.0), clang++ (18.1.3) and the latest setuptools (75.8.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: build/install Issues related to the cmake and buck2 builds, and to installing ExecuTorch need-user-input The issue needs more information from the reporter before moving forward triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
2 participants