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

Package issue: most opencv builds fail because of out of memory errors #507

Open
4 of 5 tasks
LivingWithHippos opened this issue Feb 20, 2025 · 0 comments
Open
4 of 5 tasks

Comments

@LivingWithHippos
Copy link

Package name

opencv-contrib-python

Package version

all

PyPI URL

https://pypi.org/project/opencv-contrib-python/

piwheels URL

https://www.piwheels.org/project/opencv-contrib-python/

Python version

  • Python 3.9
  • Python 3.11

I am aware this is the issue tracker for a Python package index specifically for Raspberry Pi

  • Yes

I have checked for duplicate issues

  • Yes

I am the maintainer

  • Yes

More information

There are 4 packages related to opencv:

  • opencv-contrib-python (the heaviest to compile)
  • opencv-contrib-python-headless
  • opencv-python
  • opencv-python-headless

most of these fails because of out of memory errors

2025-01-16T17:27:43,990   virtual memory exhausted: Cannot allocate memory
2025-01-16T17:27:43,990   ninja: build stopped: subcommand failed.
2025-01-16T17:27:43,997   Traceback (most recent call last):
2025-01-16T17:27:44,001     File "/tmp/pip-build-env-dz4z37a7/overlay/lib/python3.9/site-packages/skbuild/setuptools_wrap.py", line 668, in setup
2025-01-16T17:27:44,002       cmkr.make(make_args, install_target=cmake_install_target, env=env)
2025-01-16T17:27:44,002     File "/tmp/pip-build-env-dz4z37a7/overlay/lib/python3.9/site-packages/skbuild/cmaker.py", line 696, in make
2025-01-16T17:27:44,002       self.make_impl(clargs=clargs, config=config, source_dir=source_dir, install_target=install_target, env=env)
2025-01-16T17:27:44,002     File "/tmp/pip-build-env-dz4z37a7/overlay/lib/python3.9/site-packages/skbuild/cmaker.py", line 741, in make_impl
2025-01-16T17:27:44,002       raise SKBuildError(msg)

the solution should be to enable a bigger swap size setting CONF_SWAPSIZE=4GB into /etc/dphys-swapfile and loading the setting with /etc/init.d/dphys-swapfile restart

Thanks for all your work, these are pretty common libraries and having them working without a compilation step would be great.

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

No branches or pull requests

1 participant