nihui / rife-ncnn-vulkan

RIFE, Real-Time Intermediate Flow Estimation for Video Frame Interpolation implemented with ncnn library
MIT License
802 stars 69 forks source link

GPU generates black image on Adreno 618/660 (Android/Termux) #41

Open knyipab opened 2 years ago

knyipab commented 2 years ago

Thanks a lot for porting this RIFE to ncnn! I recently tried to use this project on Termux/Android.

rife-ncnn-vulkan generates black image using GPU while perfect running CPU (rife-ncnn-vulkan -g -1). Tested on Adreno 505, 618 and 660 Android (Termux) against your images/ files (and other jpg). Nothing insightful from its terminal output (even with -v).

CPU (-g -1) GPU
Adreno 550 successful, correct output image failed with vkCreateComputePiplines failed 5
Adreno 618 successful, correct output image black image
Adreno 660 successful, correct output image black image

Adreno 550 seems to have buggy driver. The others' GPU seems to do its work, as they freeze the screen somehow.

FYI, here's how I setup wtih Termux,

  1. unzip ncnn-20220216-android-vulkan-shared.zip and install the lib/cmake/include with ln -s
  2. unzip ncnn-20220216-android-vulkan.zip (to prepare glslang objects)
  3. pkg install libwebp vulkan-header vulkan-loader-android
  4. cmake ../src -DUSE_SYSTEM_NCNN=ON -DUSE_SYSTEM_WEBP=ON -DVulkan_LIBRARY="/system/lib64/libvulkan.so" -DGLSLANG_TARGET_DIR="<path-to-glslang-directory>"

I also tested my setup against waifu2x-ncnn-vulkan (GPU, 2x) which works fine on Adreno 618 and 660. Any clues on what's wrong in rife-ncnn-vulkan?

感谢大神!!

910514 commented 8 months ago

Hi, I discovered that compiling together with the "mini Vulkan SDK" composed of glslc and glslangValidator may resolve the black screen issue.However, I found that enabling -x in rife-ncnn-vulkan is a way to avoid the black screen. Below are reference urls and compiled file. rife-ncnn-vulkan.zip https://github.com/tanyiok1234/waifu2x_srmd-ncnn-vulkan-termux-binary/issues/3 https://xyx.moe/010-Build-waifu2x-ncnn-vulkan-in-termux.html glslc binary file from https://github.com/lzhiyong/termux-ndk/tree/android-ndk This line suggests to me that the Vulkan SDK may not be complete -- Found Vulkan: /system/lib64/libvulkan.so (found version "1.3.275") missing components: glslc glslangValidator when build with "mini Vulkan SDK" -- Found Vulkan: /system/lib64/libvulkan.so (found version "1.3.275") found components: glslc glslangValidator