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

Docker build error when installing pytorch #57

Open
AustrianOakvn opened this issue Nov 8, 2023 · 3 comments
Open

Docker build error when installing pytorch #57

AustrianOakvn opened this issue Nov 8, 2023 · 3 comments

Comments

@AustrianOakvn
Copy link

First, thank you for the great work. I'm trying to install limap by docker but currently there are issues with my buid.
When i ran the build with the Dockerfile provided in the repo, i encountered No matching distribution found for torch==1.12.0

 => CACHED [stage-1 14/16] COPY --from=intermediate /limap /limap                                                                                                            0.0s
 => ERROR [stage-1 15/16] RUN python -m pip install torch==1.12.0 torchvision==0.13.0 --index-url https://download.pytorch.org/whl/cu115                                     2.7s
------
 > [stage-1 15/16] RUN python -m pip install torch==1.12.0 torchvision==0.13.0 --index-url https://download.pytorch.org/whl/cu115:
0.527 Looking in indexes: https://download.pytorch.org/whl/cu115
1.780 ERROR: Could not find a version that satisfies the requirement torch==1.12.0 (from versions: 1.11.0+cu115)
1.780 ERROR: No matching distribution found for torch==1.12.0
------
Dockerfile:121
--------------------
 119 |     # Copy the repository from the first image
 120 |     COPY --from=intermediate /limap /limap
 121 | >>> RUN python -m pip install torch==1.12.0 torchvision==0.13.0 --index-url https://download.pytorch.org/whl/cu115
 122 |     # RUN python -m pip install torch==1.12.0+cu116 torchvision==0.13.0+cu116 torchaudio==0.12.0 --extra-index-url https://download.pytorch.org/whl/cu116
 123 |     # RUN python -m pip install torch==1.11.0 torchvision==0.12.0 --index-url https://download.pytorch.org/whl/cu115
--------------------
ERROR: failed to solve: process "/bin/sh -c python -m pip install torch==1.12.0 torchvision==0.13.0 --index-url https://download.pytorch.org/whl/cu115" did not complete successfully: exit code: 1

Then i changed the torch version to torch==1.11.0 torchvision==0.12.0 similar to the previous commit. This time, there is build issue with the hawp, No module name torch.

=> CACHED [stage-1 15/16] RUN python -m pip install torch==1.11.0 torchvision==0.12.0 --index-url https://download.pytorch.org/whl/cu115                                    0.0s
 => ERROR [stage-1 16/16] RUN python -m pip install --upgrade pip setuptools &&     cd limap &&     python --version &&     pip --version &&     python -m pip install -r r  9.8s
------
 > [stage-1 16/16] RUN python -m pip install --upgrade pip setuptools &&     cd limap &&     python --version &&     pip --version &&     python -m pip install -r requirements.txt &&     python -m pip install -Ive .:
0.508 Requirement already satisfied: pip in /opt/venv/lib/python3.9/site-packages (23.0.1)
0.584 Collecting pip
0.639   Downloading pip-23.3.1-py3-none-any.whl (2.1 MB)
0.888      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 8.5 MB/s eta 0:00:00
0.896 Requirement already satisfied: setuptools in /opt/venv/lib/python3.9/site-packages (58.1.0)
1.075 Collecting setuptools
1.097   Downloading setuptools-68.2.2-py3-none-any.whl (807 kB)
1.179      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 807.9/807.9 kB 9.9 MB/s eta 0:00:00
1.274 Installing collected packages: setuptools, pip
1.274   Attempting uninstall: setuptools
1.274     Found existing installation: setuptools 58.1.0
1.313     Uninstalling setuptools-58.1.0:
1.396       Successfully uninstalled setuptools-58.1.0
1.682   Attempting uninstall: pip
1.683     Found existing installation: pip 23.0.1
1.823     Uninstalling pip-23.0.1:
1.962       Successfully uninstalled pip-23.0.1
2.660 Successfully installed pip-23.3.1 setuptools-68.2.2
2.779 Python 3.9.18
2.943 pip 23.3.1 from /opt/venv/lib/python3.9/site-packages/pip (python 3.9)
3.250 Processing ./third-party/pytlsd
3.254   Installing build dependencies: started
8.338   Installing build dependencies: finished with status 'done'
8.339   Getting requirements to build wheel: started
8.445   Getting requirements to build wheel: finished with status 'done'
8.447   Preparing metadata (pyproject.toml): started
8.564   Preparing metadata (pyproject.toml): finished with status 'done'
8.569 Processing ./third-party/hawp
8.572   Installing build dependencies: started
9.514   Installing build dependencies: finished with status 'done'
9.515   Getting requirements to build wheel: started
9.599   Getting requirements to build wheel: finished with status 'error'
9.603   error: subprocess-exited-with-error
9.603   
9.603   × Getting requirements to build wheel did not run successfully.
9.603   │ exit code: 1
9.603   ╰─> [17 lines of output]
9.603       Traceback (most recent call last):
9.603         File "/opt/venv/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
9.603           main()
9.603         File "/opt/venv/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
9.603           json_out['return_val'] = hook(**hook_input['kwargs'])
9.603         File "/opt/venv/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
9.603           return hook(config_settings)
9.603         File "/tmp/pip-build-env-2apo2evk/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel
9.603           return self._get_build_requires(config_settings, requirements=['wheel'])
9.603         File "/tmp/pip-build-env-2apo2evk/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 325, in _get_build_requires
9.603           self.run_setup()
9.603         File "/tmp/pip-build-env-2apo2evk/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 507, in run_setup
9.603           super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
9.603         File "/tmp/pip-build-env-2apo2evk/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 341, in run_setup
9.603           exec(code, locals())
9.603         File "<string>", line 4, in <module>
9.603       ModuleNotFoundError: No module named 'torch'
9.603       [end of output]
9.603   
9.603   note: This error originates from a subprocess, and is likely not a problem with pip.
9.604 error: subprocess-exited-with-error
9.604 
9.604 × Getting requirements to build wheel did not run successfully.
9.604 │ exit code: 1
9.604 ╰─> See above for output.
9.604 
9.604 note: This error originates from a subprocess, and is likely not a problem with pip.
------
Dockerfile:124
--------------------
 123 |     RUN python -m pip install torch==1.11.0 torchvision==0.12.0 --index-url https://download.pytorch.org/whl/cu115
 124 | >>> RUN python -m pip install --upgrade pip setuptools && \
 125 | >>>     cd limap && \
 126 | >>>     python --version && \
 127 | >>>     pip --version && \
 128 | >>>     python -m pip install -r requirements.txt && \
 129 | >>>     python -m pip install -Ive .
 130 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c python -m pip install --upgrade pip setuptools &&     cd limap &&     python --version &&     pip --version &&     python -m pip install -r requirements.txt &&     python -m pip install -Ive ." did not complete successfully: exit code: 1

My system configuration is:

  • Ubuntu 22.04
  • CUDA 11.7
  • Docker 24.0.7

Is there any mismatch of torch and hawp, or my OS configuration.

@B1ueber2y
Copy link
Member

Hi. Thanks for the interest! I believe the problem of yours is not with limap, but the problem with installing pytorch. You need to refer to https://pytorch.org/get-started/previous-versions/ to install pytorch compatible with your CUDA.

However, I think torch 1.12.0 does not support CUDA 11.7 from the link. So maybe you can give 1.13.1 a try with: "pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu117"

@AustrianOakvn
Copy link
Author

AustrianOakvn commented Nov 8, 2023

Thank for the reply, I thought the pytorch version would depend on the image that you based on, no?. In your Dockerfile it is NVIDIA CUDA 11.5.
And I just tried a bunch of torch versions including the one you mentioned but it just doesn't seem to work, same error. I also tried on another machine with Ubuntu 20.04 and CUDA 11.2 and same error so i guess it is not about CUDA version?
But it works with system wide installation though.

@kunalchelani
Copy link

kunalchelani commented Jan 12, 2024

I also run into the same series of issue. @AustrianOakvn were you able to successfully build through docker? By system-wide installation I assumed you meant building from scratch, and not through the container.

Could you please provide the changes you made, in case you managed to build it successfully.

EDIT : I found out that the above error was not actually with hawp but something to do with calling setup.py. A similar issue with xformers led me to installing wheel before installing everything else.
RUN python -m pip install wheel before the final step allowed me to succesfully build it.

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

3 participants