Skip to content

scene_detect not work: TensorRT EP execution context enqueue failed #74

@Sg4Dylan

Description

@Sg4Dylan

Environments:

  • os: ubuntu server 22.04 LTS
  • gpu: H100*2
  • docker-ce: 5:27.1.2
  • nvidia-container-toolkit: 1.16.1
  • image: styler00dollar/vsgan_tensorrt:latest (08/15/2024)
  • commit: 41f25e6

Code:

clip_sc = scene_detect(
    clip,
    fp16=True,
    thresh=0.985,
    model=3,  # same on model=12, recompiled engine still not work
    num_sessions=6  # same on num_sessions=1 or 2
)

Log:

2024-08-16 05:40:41.192673822 [E:onnxruntime:Default, tensorrt_execution_provider.h:84 log] [2024-08-16 05:40:41   ERROR] IExecutionContext::enqueueV3: Error Code 1: Cuda Runtime (invalid resource handle)
2024-08-16 05:40:41.192758318 [E:onnxruntime:, sequential_executor.cc:516 ExecuteKernel] Non-zero status code returned while running TRTKernel_graph_main_graph_3554867279417518500_0 node. Name:'TensorrtExecutionProvider_TRTKernel_graph_main_graph_3554867279417518500_0_0' Status Message: TensorRT EP execution context enqueue failed.
2024-08-16 05:40:41.261624123 [E:onnxruntime:Default, tensorrt_execution_provider.h:84 log] [2024-08-16 05:40:41   ERROR] IExecutionContext::enqueueV3: Error Code 1: Cuda Runtime (invalid resource handle)
2024-08-16 05:40:41.261704713 [E:onnxruntime:, sequential_executor.cc:516 ExecuteKernel] Non-zero status code returned while running TRTKernel_graph_main_graph_3554867279417518500_0 node. Name:'TensorrtExecutionProvider_TRTKernel_graph_main_graph_3554867279417518500_0_0' Status Message: TensorRT EP execution context enqueue failed.
2024-08-16 05:40:41.288012812 [E:onnxruntime:Default, tensorrt_execution_provider.h:84 log] [2024-08-16 05:40:41   ERROR] IExecutionContext::enqueueV3: Error Code 1: Cuda Runtime (invalid resource handle)
2024-08-16 05:40:41.288064561 [E:onnxruntime:, sequential_executor.cc:516 ExecuteKernel] Non-zero status code returned while running TRTKernel_graph_main_graph_3554867279417518500_0 node. Name:'TensorrtExecutionProvider_TRTKernel_graph_main_graph_3554867279417518500_0_0' Status Message: TensorRT EP execution context enqueue failed.
Error: Failed to retrieve frame 34 with error: 
Traceback (most recent call last):
  File "src/cython/vapoursynth.pyx", line 3216, in vapoursynth.publicFunction
  File "src/cython/vapoursynth.pyx", line 3218, in vapoursynth.publicFunction
  File "src/cython/vapoursynth.pyx", line 834, in vapoursynth.FuncData.__call__
  File "/workspace/tensorrt/src/scene_detect.py", line 175, in execute
    result = ort_session.run(None, {"input": in_sess})[0][0]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 220, in run
    return self._sess.run(output_names, input_feed, run_options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL : Non-zero status code returned while running TRTKernel_graph_main_graph_3554867279417518500_0 node. Name:'TensorrtExecutionProvider_TRTKernel_graph_main_graph_3554867279417518500_0_0' Status Message: TensorRT EP execution context enqueue failed.

It works when I uncommented CUDAExecutionProvider, but the speed is only half of trt8.6 :

providers=[
    ("TensorrtExecutionProvider", options),
    "CUDAExecutionProvider",
],

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions