rife-ncnn-vulkan icon indicating copy to clipboard operation
rife-ncnn-vulkan copied to clipboard

Having problems when tta is active for HD content

Open Selur opened this issue 4 years ago • 5 comments

I'm a using Geforce GTX 1070ti 8GB VRAM (driver version 466.47) on Win10 x64 21H1 (19043.1023) with 32GB RAM and a Ryzen 7 1800x.

I first used https://github.com/HomeOfVapourSynthEvolution/VapourSynth-RIFE-ncnn-Vulkan and noticed that when using tta while using 1080p content I got

vkWaitForFences failed -4
vkQueueSubmit failed -4

errors which resulted in black frames. See: https://github.com/HomeOfVapourSynthEvolution/VapourSynth-RIFE-ncnn-Vulkan/issues/2

I then downloaded rife-ncnn-vulkan-20210520-windows to see whether it's a bug in the Vapoursynth port or this project.

using:

i:\Hybrid\64bit\ffmpeg.exe -hide_banner -i MOV_0061.mp4 input_frames/frame_%08d.png

I got

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'MOV_0061.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.20.100
  Duration: 00:00:03.05, start: 0.000000, bitrate: 31299 kb/s
  Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt470bg/bt470bg/smpte170m), 1920x1080, 31277 kb/s, SAR 1:1 DAR 16:9, 29.97 fps, 30 tbr, 29940 tbn, 59880 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 156 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> png (native))
Press [q] to stop, [?] for help
[swscaler @ 0000013ae19c0380] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to 'input_frames/frame_%08d.png':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.77.100
  Stream #0:0(und): Video: png, rgb24(pc, bt470bg/bt470bg/smpte170m, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 30 fps, 30 tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc58.135.100 png
frame=   91 fps= 55 q=-0.0 Lsize=N/A time=00:00:03.03 bitrate=N/A speed=1.83x
video:347813kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

and all frames were created properly in the input_frames-folder.

Calling:

rife-ncnn-vulkan -i input_frames -o output_frames -m rife-v3.1 -j 2:2:2 -x

has the same issue:

[0 NVIDIA GeForce GTX 1070 Ti]  queueC=2[8]  queueG=0[16]  queueT=1[2]
[0 NVIDIA GeForce GTX 1070 Ti]  bugsbn1=0  bugbilz=0  bugcopc=0  bugihfa=0
[0 NVIDIA GeForce GTX 1070 Ti]  fp16-p/s/a=1/1/0  int8-p/s/a=1/1/1
[0 NVIDIA GeForce GTX 1070 Ti]  subgroup=32  basic=1  vote=1  ballot=1  shuffle=1
vkWaitForFences failed -4
vkWaitForFences failed -4
vkQueueSubmit failed -4
vkQueueSubmit failed -4
vkQueueSubmit failed -4
vkQueueSubmit failed -4
vkQueueSubmit failed -4
vkQueueSubmit failed -4

this time not all interpolated frames were black, but quite a few. My source file can be found over at https://drive.google.com/file/d/1tDXAt0gds_fU1E-yGunR_PR2e1jqeLoK/view?usp=sharing, but this happens for me with any source with a 1080p or higher resolution, 720p or SD content works fine.

Cu Selur

Selur avatar Jun 03 '21 08:06 Selur

You may need to disable TDR https://docs.microsoft.com/en-us/windows-hardware/drivers/display/timeout-detection-and-recovery https://docs.nvidia.com/gameworks/content/developertools/desktop/timeout_detection_recovery.htm

nihui avatar Jun 04 '21 14:06 nihui

II downloaded and installed NVIDIA_Nsight_Visual_Studio_Edition_Win64_2021.1.0.21103_29839620 but sadly there is no 'Nsight Monitor'-icon to be seen anywhere like in the screenshots. My guess is you need to install the CUDA SDK for it to work,... Also the NVIDIA link states:

If TDR is enabled and you see the TDR error message, "Display driver stopped responding and has recovered," this means that the Windows operating system reset the display driver.

Which does not happen here. Drivers work fine, I get no such message.

btw, problem is still there with latest 466.63 GeForce Game Ready Drivers.

Changing the energy management mode to maximal performance for the rife binary didn't help either.

Sadly as soon as tta is used I get the error without (-x) tta everything works,..

Selur avatar Jun 04 '21 16:06 Selur

I increased the TDR (to 60) by creating registry keys (see: https://docs.substance3d.com/spdoc/gpu-drivers-crash-with-long-computations-128745489.html) and rebooting my system and that did help. :) Now the error is gone! :) -> thanks for the tip with the tdr.

Selur avatar Jun 04 '21 17:06 Selur

I increased the TDR to 60 and it worked, but i don't know why, but computational operations are terribly slow on NVIDIA GPUs. (I checked Compute_1 in task manager, but it doesn't seem to be working properly.) @nihui This also appears to be a bug. Can you fix it?

ghost avatar Jun 18 '21 16:06 ghost

Use other professional tools like GPU-Z rather than task manager to see true GPU loading.

HolyWu avatar Jun 18 '21 17:06 HolyWu