Skip to content

[BUG] RIFE Interpolation engine hangs randomly #37

Closed

Description

@kar-dim

Hello! I am trying to use TensorRT-RTX but I have a very interesting bug.

NOTE: TensorRT 11 is fine, works perfectly with zero problems, only TensorRT-RTX 1.5 hangs randomly. I DO want to use the RTX version because it is more interesting: Portable engines, much lower binary size are important for me. Anyway the problem is this:

A RIFE v4.6 engine built with TensorRT for RTX 1.5.0.114 hangs forever inside enqueueV3 at the input shape 1x11x576x704, but only when the GPU is allowed to go idle between consecutive enqueues! The hang is reproducible with tensorrt_rtx alone (no application code) by adding --idleTime.

The same ONNX, same shape, same idle pattern, same GPU runs good on mainline TensorRT 11.1.0.106, which is I believe this is an RTX-specific problem.

rife_v4.6_fp16.onnx.zip

NOTE: This is the fp16 version of the model which I AutoCast (but kept some "fp32 islands" with surgeries), the original FP32 model can be found here

rife_v4.6.onnx.zip

When it hangs, the GPU sits at 100% utilization but only ~39 W, with 0-1% memory utilization and one CPU core spinning at 100%.

Real inference on this engine draws 150-220 W normally. I left it in this state for 4.5 hours (well, I slept expecting it to complete in an hour 😅) with zero progress.

Environment

GPU NVIDIA GeForce RTX 4070 SUPER (sm_89)
Driver 610.52
OS Windows 11 (10.0.26200)
TensorRT for RTX 1.5.0.114 (reports TensorRT v10500, build b114)
TensorRT TensorRT 11.1.0.106 (v110100, build b106)

| Model | rife_v4.6 ONNX (fp16, opset 16), from vs-mlrt external-models. 11-channel input [1,11,H,W] |

Reproduction

Build the engine (dynamic shapes, these are the ones I use):

tensorrt_rtx --onnx=rife_v4.6_fp16.onnx --saveEngine=rife_v4.6_fp16.trt \
             --minShapes=input:1x11x128x128 \
             --optShapes=input:1x11x1088x1920 \
             --maxShapes=input:1x11x2176x3840

Run it at 576x704 with an idle gap between enqueues:

# HANGS: never terminates, must be killed
tensorrt_rtx --loadEngine=rife_v4.6_fp16.trt --shapes=input:1x11x576x704 \
             --iterations=800 --duration=0 --idleTime=30

Expected: completes 800 iterations (roughly 1.3 ms of compute each) and reports PASSED.

Actual: stops making progress after a few hundred iterations and hangs indefinitely. The last log line is [I] Starting inference.

The same command without the idle gap passes:

# PASSES (781 qps, exit 0). The GPU never drains between enqueues.
tensorrt_rtx --loadEngine=rife_v4.6_fp16.trt --shapes=input:1x11x576x704 \
             --iterations=300 --duration=0 --idleTime=0

The hang is random

It happens after roughly 1 in 600 to 1500 enqueues.

Two consecutive runs of the identical command (--iterations=1500 --idleTime=30) gave HANG then ok.

A single passing run therefore proves nothing. I recommend at least 8000 enqueues per configuration when verifying.

The original FP32 version may hang MUCH later but it WILL hang, and it may also PASS sometimes. generally this is very random! But IF it happens then the GPU is stuck!

What we ruled out (all measured)

Configuration Idle gap Result
TRT-RTX, v4.6 @ 1x11x576x704 10-30 ms HANG (also hangs at 8000 iterations)
TRT-RTX, v4.6 @ 1x11x576x704 none (back-to-back) ok, 781 qps
mainline TRT 11.1, v4.6 @ 1x11x576x704, identical ONNX 10 ms ok, 16,000 enqueues, twice
TRT-RTX, v4.6, engine built with optShapes=1x11x576x704 10 ms HANG (so it is NOT a bad opt shape issue!)
TRT-RTX, rife v4.26 (different graph, 7-channel) @ 1x7x576x704 10 ms ok
TRT-RTX, v4.6 @ various other shapes 10 ms ok

So the trigger is very narrow: this one input shape on this graph (of course there may be many more), plus an idle GPU between enqueues.

Neighbouring shapes (including the same height at other widths, and the same width at other heights) are good.

Additionally, from the application side (before we reduced it to trtexec), we ruled out:

  • Not our memory. The TRT workspace and all application buffers were verified non-overlapping.
  • Not a race with application kernels. A full cudaStreamSynchronize immediately before enqueueV3 (empty stream, cudaSuccess) still hangs. The stuck kernel belongs to the engine.
  • Not out-of-bounds access. compute-sanitizer memcheck reports zero errors.

Idle gap is important!

This is not a synthetic condition.

In our video pipeline, RIFE enqueues are separated by an idle GPU whenever a CPU-side stage is the bottleneck (software video decode, or an x265 CPU encode applying backpressure).

Under a saturated GPU pipeline (hardware decode and encode) the same shape runs fine indefinitely, which is why this only surfaced on one code path!!

Impact

Any application feeding this engine a 576x704 input on a non-saturated GPU hangs permanently, with no error, no exception, and no timeout.

It cannot be caught or recovered from in-process!

Our workaround, avoiding the shape, is not something an application can do in general, since the "bad" shape is not predictable.

Activity

  1. self-assigned this
    on Jul 22, 2026
  2. added theissue type on Jul 22, 2026
  3. tp5uiuc commented on Jul 22, 2026

    @tp5uiuc
    Contributor

    Thanks for the bug report @kar-dim, let me reproduce it and see what I can do.

    In our video pipeline, RIFE enqueues are separated by an idle GPU whenever a CPU-side stage is the bottleneck (software video decode, or an x265 CPU encode applying backpressure).
    That's good to know, thanks Dimitris.

    I am curious, are you testing out porting TensorRT-RTX to your pipelines? I would be interested to know if a) you are happy with the memory footprint, performance and portability offered by TensorRT-RTX and b) how you are using TensorRT-RTX in your pipelines. That way we can offer a better product that will suit your needs. Thanks!

  4. kar-dim commented on Jul 22, 2026

    @kar-dim
    Author

    Hello, yes exactly! I tried to port TensorRT-RTX instead of TensorRT simply because of its binary size and the interesting JIT cache thing, plus much faster compile times. But this bug is a blocker though. Regarding the question, it crashes with tensorrt_rtx only, not really related to the video pipeline. I currently only need the TensorRT in order to inference various models on a video pipeline which has custom libav code and interoperability with NVDEC + TensorRT.

  5. tp5uiuc commented on Jul 22, 2026

    @tp5uiuc
    Contributor

    ack, will get this resolved and get back to you with next steps. Thanks for your patience :)

  6. tp5uiuc commented on Sep 21, 2026

    @tp5uiuc
    Contributor

    Hi @kar-dim, and thank you for your patience. This took a tad too long, as this bug came right before we released TRT-RTX 1.6.

    The good news is that We reproduced your hang and it is fixed in later releases. On 1.5.0.114, the build you reported, your reproducer hangs in 17 of 18 runs at 1x11x576x704. On 1.6 and on the upcoming 1.7 release the same reproducer completes 80000 enqueues with no hang across eight runs. The control and the test runs between the two versions were interleaved on one machine, so it is not a test artefact issue.

    What the issue was. There was a device-side spin inside one convolution kernel that TensorRT-RTX uses. One thread polls a memory word, waiting for an integer flag that never arrives, because the value at that address is not the flag. It is shape dependent, which matches your finding that 1x11x576x704 hangs while its neighbours pass.

    So the recommendation is to please move to TensorRT-RTX 1.6.1 or newer. I would recommend the upcoming 1.7.1 version. Thanks for your bug report, and marking this bug as done. Feel free to re-open in case you have the same issue popping up.

  7. kar-dim commented on Sep 22, 2026

    @kar-dim
    Author

    I have confirmed that after upgrading on 1.6 it is OK now, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions