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

Unable to build diffusion containers after recent updates to opencv #489

Closed
ms1design opened this issue Apr 25, 2024 · 6 comments · May be fixed by #541
Closed

Unable to build diffusion containers after recent updates to opencv #489

ms1design opened this issue Apr 25, 2024 · 6 comments · May be fixed by #541

Comments

@ms1design
Copy link
Contributor

Hi @dusty-nv,

Just taking a note that we had a breaking change in opencv that negatively impacted the diffusion containers breaking the builds:

In opencv we have new way of install/building:

RUN cd /tmp/opencv && \
./install_deps.sh && \
./install_pip.sh || \
./install_deb.sh || \
./build.sh

But this fails hard on stable-diffusion container where invisible-watermark dependency requires opencv-python and cannot find proper distribution.

Same with stable-diffusion-webui:

# partially initialized module 'cv2' has no attribute 'gapi_wip_gst_GStreamerPipeline' \
&& /opt/opencv_install.sh \

10:44:49 INFO: pip is looking at multiple versions of facexlib to determine which version is compatible with other requirements. This could take a while.
10:44:49 
10:44:49 stderr: ERROR: Ignored the following versions that require a different python version: 0.52.0 Requires-Python >=3.6,<3.9; 0.52.0rc3 Requires-Python >=3.6,<3.9; 0.53.0 Requires-Python >=3.6,<3.10; 0.53.0rc1.post1 Requires-Python >=3.6,<3.10; 0.53.0rc2 Requires-Python >=3.6,<3.10; 0.53.0rc3 Requires-Python >=3.6,<3.10; 0.53.1 Requires-Python >=3.6,<3.10; 0.54.0 Requires-Python >=3.7,<3.10; 0.54.0rc2 Requires-Python >=3.7,<3.10; 0.54.0rc3 Requires-Python >=3.7,<3.10; 0.54.1 Requires-Python >=3.7,<3.10
10:44:49 ERROR: Could not find a version that satisfies the requirement opencv-python (from facexlib) (from versions: none)
10:44:49 ERROR: No matching distribution found for opencv-python

Started to fix that in hope it's a quick one – running the opencv install/build sh scripts, but I gave up when realised that it starts the build.sh from opencv. build.sh requires the unavailable environment variables (accessible only when building opencv cotnainer):

cv['build_args'] = {
'OPENCV_VERSION': version,
'OPENCV_PYTHON': f"{version.split('.')[0]}.x",
'CUDA_ARCH_BIN': ','.join([f'{x/10:.1f}' for x in CUDA_ARCHITECTURES]),

@ai-and-i
Copy link

Hi, I have the same issue. @ms1design where you able to solve it or work around it?

@ms1design
Copy link
Contributor Author

Unfortunately, no, but I haven't tried yet tbh. I have this on my to-do list for when I have more time available.

@ai-and-i
Copy link

I think I fixed it in #541

@dusty-nv
Copy link
Owner

Thanks @ai-and-i , took a deeper look and fixed it another way in e0368bf

It was related to the CUDA-enabled opencv wheels being called opencv-contrib-python not opencv-python, but yet I was blacklisting opencv-python on the pip server from mirroring PyPi (so it wouldn't install the non-CUDA versions). So I disabled that one since it was creating errors during pip installs, and instead reinstalled the OpenCV-CUDA binaries near the end of the build.

@ai-and-i
Copy link

ai-and-i commented May 29, 2024

Perfect, thanks for the quick fix!

@ms1design
Copy link
Contributor Author

Fixed in e0368bf, closing.

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

Successfully merging a pull request may close this issue.

3 participants