Skip to content

new packages: rife-ncnn-vulkan{,-nihui,-tntwise} #1017

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

Merged
merged 5 commits into from
May 16, 2024

Conversation

knyipab
Copy link
Contributor

@knyipab knyipab commented May 13, 2024

managed to build rife-ncnn-vulkan and tested with:

rife-ncnn-vulkan -0 0.png -1 1.png -o test.png -m rife-v4.6 -g -1

It works BUT it cannot work using gpu (i.e. without -g -1), with error below:

SPIR-V WARNING:
    In file ../src/compiler/spirv/spirv_to_nir.c:4862
    Unsupported SPIR-V capability: SpvCapabilityStorageBuffer8BitAccess (4448)
    36 bytes into the SPIR-V binary
validation fail: (type_size(instr->cat6.type) <= 16) == !!((instr->srcs[2])->flags & IR3_REG_HALF)
  -> for instruction: MESA: info: 0000:000: 	stib.base0 ssa_43, ssa_75, hssa_76

I have no ideas, but I speculate that even after solving this error, vulkan will likely generates black image (an issue I raised at nihui/rife-ncnn-vulkan#41).

Anyways, even with this caveat, I still want it to be listed on TUR. Thanks.

@knyipab
Copy link
Contributor Author

knyipab commented May 13, 2024

By the way, little more info, rife-vulkan-ncnn uses older version of glslang so it cannot be built to dynamically link to the libncnn package (i.e. -DUSE_SYSTEM_NCNN=ON does not compile).

@knyipab knyipab force-pushed the rife-ncnn-vulkan branch from 0a095b1 to 893cb84 Compare May 14, 2024 11:11
@knyipab knyipab closed this May 14, 2024
@knyipab knyipab force-pushed the rife-ncnn-vulkan branch from 893cb84 to e9da3b2 Compare May 14, 2024 11:22
@knyipab
Copy link
Contributor Author

knyipab commented May 14, 2024

@licy183 Thanks. Fixed and tested with the command.

@knyipab knyipab reopened this May 14, 2024
@knyipab
Copy link
Contributor Author

knyipab commented May 14, 2024

Seems to build two packages in one go and does not remove the soft link before building the other:
ln: failed to create symbolic link '/data/data/com.termux/files/usr/bin/rife-ncnn-vulkan': File exists

There is no problem if building separately. Grateful for advice. Thanks.

[Edited:] By the way, I am not so familiar. should it be TERMUX_PKG_GIT_BRANCH=v$TERMUX_PKG_VERSION instead?

@knyipab
Copy link
Contributor Author

knyipab commented May 14, 2024

I investigated and found few things:

  • the SPIR-V error should be an issue of vulkan-loader-generic. If vulkan-loader-android is installed instead. While I doubt if it is fixable or anyone will try to fix vulkan-lodaer-generc, should this package be built against /system/lib(64)/libvulkan.so?
  • it can indeed be built against libncnn using -DUSE_SYSTEM_NCNN=ON by replacing include("${GLSLANG_TARGET_DIR}/*.cmake with include("${GLSLANG_TARGET_DIR}/glslang-targets.cmake") in CMakeLists.txt
  • in that case, it probably won't need git clone the repo, but use release tar.gz instead. Also, the command line git submodule update ... in build.sh should be unnecessary.

Thank you for your advice.

@knyipab
Copy link
Contributor Author

knyipab commented May 15, 2024

@licy183 two things:

  • No more editing from me and ready for review. Sorry for any confusion and inconvenience caused by my frequent editing.
  • Your PR build action failed. But in fact, there is nothing wrong in my commits. My Actions work (this and this).

@licy183 licy183 force-pushed the rife-ncnn-vulkan branch 2 times, most recently from 9c34d04 to 85ed664 Compare May 15, 2024 19:32
@knyipab
Copy link
Contributor Author

knyipab commented May 16, 2024

Thanks a lot for help!

TNTwise updated the repo to 20240515 after I reflected the cpu mode segfault bug yesterday in TNTwise/rife-ncnn-vulkan#4.

After that, we may test all commands below and they should work for both -nihui and -tntwise

git clone https://github.com/nihui/rife-ncnn-vulkan
cd ./rife-ncnn-vulkan/images
# GPU mode
rife-ncnn-vulkan -0 0.png -1 1.png -o test.png
rife-ncnn-vulkan -0 0.png -1 1.png -o test.png -m rife-v4.6
rife-ncnn-vulkan -0 0.png -1 1.png -o test.png -m rife-v4-latest
# CPU mode
rife-ncnn-vulkan -0 0.png -1 1.png -o test.png -g -1
rife-ncnn-vulkan -0 0.png -1 1.png -o test.png -m rife-v4.6 -g -1
rife-ncnn-vulkan -0 0.png -1 1.png -o test.png -m rife-v4-latest -g -1

@licy183 licy183 force-pushed the rife-ncnn-vulkan branch from 85ed664 to 258d2a0 Compare May 16, 2024 16:48
@licy183 licy183 merged commit 12b9eab into termux-user-repository:master May 16, 2024
7 checks passed
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 this pull request may close these issues.

2 participants