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

I fixed Github Actions #1

Closed
styler00dollar opened this issue Feb 8, 2022 · 19 comments
Closed

I fixed Github Actions #1

styler00dollar opened this issue Feb 8, 2022 · 19 comments

Comments

@styler00dollar
Copy link

styler00dollar commented Feb 8, 2022

It seems like you tried to work on Github Actions and only Ubuntu currently works. In the past you had a different approach for Github Actions but that only ran cmake and did not produce the whl files. I fixed the process to build whl files for Ubuntu, Windows and Mac if you are interested. In your repo Windows currently fails because of this and I also added Python 3.10 everywhere, since Mac does use Python 2 by default (cmake extention wont install with pip) and it's nice to have the same version everywhere. You can see the built wheels yourself here. Wanted to mention it in case you would be interested. My current code uses OpenCV numpy arrays instead of Pillow and I removed C++ tiling, so instead of making a pull request, due big differences, I just decided to just mention it in an issue.

Edit:
I also added a Python matrix for multiple versions, it is here. It does build and upload everything, but for some reason it shows failed at the end since it tries to access a non-existent path. I am not sure how to fix that one.

@ArchieMeng
Copy link
Member

Thank you for your suggestion. Well done.
We will discuss about it later.

@styler00dollar
Copy link
Author

styler00dollar commented Feb 10, 2022

I tried to install the Windows whl, and it does not work, like it is already mentioned here in this issue. I did not expect this. At least the whl building process and the linux packages seem to work fine though. I did not test the Mac files. I don't know how to fix the Windows whl problem. All I archived is getting

ImportError: DLL load fialed while importing _realsr_ncnn_vulkan_wrapper: %1 not a valid Win32-application

by inputting dll files into System32 I found on the internet.

C:\Users\AppData\Local\Programs\Python\Python310\Lib\site-packages\realsr_ncnn_vulkan_python>dumpbin /dependents _realsr_ncnn_vulkan_wrapper.pyd
Microsoft (R) COFF/PE Dumper Version 14.30.30709.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file _realsr_ncnn_vulkan_wrapper.pyd

File Type: DLL

  Image has the following dependencies:

    python310.dll
    libgcc_s_seh-1.dll
    KERNEL32.dll
    msvcrt.dll
    libwinpthread-1.dll
    libstdc++-6.dll
    libgomp-1.dll
    vulkan-1.dll

@joeyballentine
Copy link

Can confirm the windows .whl has a DLL import problem. It installs fine, but when I try to import the package I get that error

@ArchieMeng
Copy link
Member

Can confirm the windows .whl has a DLL import problem. It installs fine, but when I try to import the package I get that error

Could you provide the python version you used on windows? As far as I know, the binary wheel is strictly linked to python 3.10 on Windows.

@styler00dollar
Copy link
Author

styler00dollar commented Feb 13, 2022

For my newest attempt with the version matrix, it seems like different versions all reference python310.dll, which might explain why every other version could fail.

C:\Users\Downloads\realsr-ncnn-vulkan-python-v1-windows_3.9.10\realsr_ncnn_vulkan_python>dumpbin /dependents _realsr_ncnn_vulkan_wrapper.pyd
Microsoft (R) COFF/PE Dumper Version 14.30.30709.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file _realsr_ncnn_vulkan_wrapper.pyd

File Type: DLL

  Image has the following dependencies:

    python310.dll
    libgcc_s_seh-1.dll
    KERNEL32.dll
    msvcrt.dll
    libwinpthread-1.dll
    libstdc++-6.dll
    libgomp-1.dll
    vulkan-1.dll

But when I try to install the 3.10.2 wheel into my own Python 3.10.2, I get the already mentioned error. Even if I take the whl from the non-matrix action, the same error appears. That wheel also mentions python310.dll and should be built and actually work with 3.10.

Non-matrix 3.10 wheel:
realsr-ncnn-vulkan-python-v1-windows.zip

Matrix wheels:
realsr-ncnn-vulkan-python-v1-windows_3.10.2.zip

realsr-ncnn-vulkan-python-v1-windows_3.9.10.zip

My only solution for now was to compile a 3.10 whl locally since all Windows whl files from Github Actions seem broken, but it would be nice if that can be fixed, since compiling different versions manually is quite time consuming. I sent the file to Joey and he said that the file I compiled myself with Visual Studio also didn't crash the import. I couldn't get one single Github Actions Windows whl working sadly. I tried to stick with 3.10 because of the mentioned dll name I always got, but that didn't help.

I am not sure if it would be useful, but my own compiled and working 3.10 pyd is here.

@joeyballentine
Copy link

Could you provide the python version you used on windows? As far as I know, the binary wheel is strictly linked to python 3.10 on Windows.

I'm using 3.9 (that's the highest version pytorch supports). If it's hardcoded to 3.10 that would explain it. Why is it only for 3.10?

@ArchieMeng
Copy link
Member

Could you provide the python version you used on windows? As far as I know, the binary wheel is strictly linked to python 3.10 on Windows.

I'm using 3.9 (that's the highest version pytorch supports). If it's hardcoded to 3.10 that would explain it. Why is it only for 3.10?

Because that's the python version used to build the library by default in the past.
Could you test if the latest windows wheels which is built with python version matrix solve the problem.

@joeyballentine
Copy link

joeyballentine commented Feb 14, 2022

I believe styler00dollar said that he tested that wheel in 3.10.2 and it still did not work

@ArchieMeng
Copy link
Member

I believe styler00dollar said that he tested that wheel in 3.10.2 and it still did not work

Yes, it is confirmed still broken.

Luckily, I have successfully built windows wheels with GitHub action in Waifu2x ncnn vulkan python project. If those wheels are confirmed working, then the fix will be applied to this project.

@ArchieMeng
Copy link
Member

I believe styler00dollar said that he tested that wheel in 3.10.2 and it still did not work

Yes, it is confirmed still broken.

Luckily, I have successfully built windows wheels with GitHub action in Waifu2x ncnn vulkan python project. If those wheels are confirmed working, then the fix will be applied to this project.

Pre-releases are here: https://github.com/media2x/waifu2x-ncnn-vulkan-python/releases/tag/1.0.2rc1

@joeyballentine
Copy link

Unfortunately, I still get the error (Windows - Python 3.9)

File "C:\Users\Joey\AppData\Local\Programs\Python\Python39\lib\site-packages\waifu2x_ncnn_vulkan_python\waifu2x_ncnn_vulkan_wrapper.py", line 13, in
from . import _waifu2x_ncnn_vulkan_wrapper
ImportError: DLL load failed while importing _waifu2x_ncnn_vulkan_wrapper: The specified module could not be found.

@ArchieMeng
Copy link
Member

Unfortunately, I still get the error (Windows - Python 3.9)

File "C:\Users\Joey\AppData\Local\Programs\Python\Python39\lib\site-packages\waifu2x_ncnn_vulkan_python\waifu2x_ncnn_vulkan_wrapper.py", line 13, in
from . import _waifu2x_ncnn_vulkan_wrapper
ImportError: DLL load failed while importing _waifu2x_ncnn_vulkan_wrapper: The specified module could not be found.

Yes. I confirmed that there are some other problems in the build process. It uses GCC to build windows wheel, and making the result lib depends on libstdc++-6.dll and some other dlls.

@ArchieMeng
Copy link
Member

ArchieMeng commented Feb 15, 2022

Unfortunately, I still get the error (Windows - Python 3.9)

File "C:\Users\Joey\AppData\Local\Programs\Python\Python39\lib\site-packages\waifu2x_ncnn_vulkan_python\waifu2x_ncnn_vulkan_wrapper.py", line 13, in
from . import _waifu2x_ncnn_vulkan_wrapper
ImportError: DLL load failed while importing _waifu2x_ncnn_vulkan_wrapper: The specified module could not be found.

How about 1.0.2rc2 releases?
I have confirmed that cp310 works for python 3.10 on windows 10 virtual machine.
https://github.com/media2x/waifu2x-ncnn-vulkan-python/releases/tag/1.0.2rc2

@joeyballentine
Copy link

It no longer gives me that error, but it crashes python instead.

This is the output I got before it crashed:

[0 NVIDIA GeForce RTX 3070 Ti] queueC=2[8] queueG=0[16] queueT=1[2]
[0 NVIDIA GeForce RTX 3070 Ti] bugsbn1=0 bugbilz=0 bugcopc=0 bugihfa=0
[0 NVIDIA GeForce RTX 3070 Ti] fp16-p/s/a=1/1/1 int8-p/s/a=1/1/1
[0 NVIDIA GeForce RTX 3070 Ti] subgroup=32 basic=1 vote=1 ballot=1 shuffle=1

@styler00dollar
Copy link
Author

styler00dollar commented Feb 15, 2022

I tested the 1.0.2rc2 waifu ncnn and it works fine on my machine. I tested Python 3.9. Seems like Joeys error was image related.

I tried to put release.yml into my repo and built some wheels. 18.04 also fails to build, so I removed it (.so not found error when it tries to finish compile).

C:\Users\realsr_ncnn_vulkan_python-1.0.0-cp39-cp39-win_amd64\realsr_ncnn_vulkan_python>dumpbin /dependents _realsr_ncnn_vulkan_wrapper.pyd
Microsoft (R) COFF/PE Dumper Version 14.30.30709.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file _realsr_ncnn_vulkan_wrapper.pyd

File Type: DLL

  Image has the following dependencies:

    vulkan-1.dll
    python310.dll
    KERNEL32.dll
    VCOMP140.DLL
    from . import _realsr_ncnn_vulkan_wrapper
ImportError: DLL load failed while importing _realsr_ncnn_vulkan_wrapper: Das angegebene Modul wurde nicht gefunden.

Seems like at least 3.10 seems to work, but the other versions still rely on python310.dll and fail to import. I have no idea why. Your waifu repo seems to work fine. Would be nice if you can try it on your own realsr repo.

@joeyballentine
Copy link

joeyballentine commented Feb 15, 2022

Also a small note: it actually does run ok for me on 3.9, it just still crashes python after running

EDIT: this might just be a pil problem, not a waifu2x problem. Will report back after trying some stuff

EDIT2: Never mind, it's definitely a problem with Waifu2x. It doesn't crash if I comment it out, but as soon as I put it back in it crashes the example.

@joeyballentine
Copy link

By the way, it's not a normal crash either, its a complete python failure
image

@ArchieMeng
Copy link
Member

ArchieMeng commented Feb 16, 2022

@joeyballentine @styler00dollar

I tried to put release.yml into my repo and built some wheels. 18.04 also fails to build, so I removed it (.so not found error when it tries to finish compile).

The ubuntu 18.04 build requires Fix error in CMakeLists.txt setup.py branch.

C:\Users\realsr_ncnn_vulkan_python-1.0.0-cp39-cp39-win_amd64\realsr_ncnn_vulkan_python>dumpbin /dependents _realsr_ncnn_vulkan_wrapper.pyd
Microsoft (R) COFF/PE Dumper Version 14.30.30709.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file _realsr_ncnn_vulkan_wrapper.pyd

File Type: DLL

  Image has the following dependencies:

    vulkan-1.dll
    python310.dll
    KERNEL32.dll
    VCOMP140.DLL
    from . import _realsr_ncnn_vulkan_wrapper
ImportError: DLL load failed while importing _realsr_ncnn_vulkan_wrapper: Das angegebene Modul wurde nicht gefunden.

Seems like at least 3.10 seems to work, but the other versions still rely on python310.dll and fail to import. I have no idea why. Your waifu repo seems to work fine. Would be nice if you can try it on your own realsr repo.

The windows build with specific python version of development libs requires Update setup.py and CMakeLists.txt to allow building with specific python version

And from your dump of _realsr_ncnn_vulkan_wrapper.pyd dependents, it is clear that the binary build requires VCOMP140.DLL which is a part of Visual C++ runtime 2015 to 2019

@styler00dollar
Copy link
Author

styler00dollar commented Feb 16, 2022

Thanks for pointing out what was wrong. I did not notice these changes. 18.04 does build now and the other Python versions also work now for Windows. The whl are now pointing to the correct python3X.dll. I am closing this issue since all mentioned problems I had are resolved now. Thanks for helping.

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