Skip to content
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

Onnxruntime Error +CudaCall CUDNN failure using Reactor in SDNext #502

Open
3 tasks done
meredithincode opened this issue Aug 4, 2024 · 0 comments
Open
3 tasks done

Comments

@meredithincode
Copy link

First, confirm

  • I have read the instruction carefully
  • I have searched the existing issues
  • I have updated the extension to the latest version

What happened?

I have installed Reactor into the SDnext UI.

I am using img2img and get this error once it is time for the face to swap. I set up everything according to SDnext instructions.

Steps to reproduce the problem

  1. Hitting generate in img2img in SDNext.
  2. Enable reactor.
  3. Error spits out once face tries to swap.

Sysinfo

SDNext Web UI
GPU: AMD RX 7700 XT

Relevant console log

14:19:06-441159 TRACE    Analyzing Source Image...
2024-08-04 14:19:06.8553198 [E:onnxruntime:, inference_session.cc:2045 onnxruntime::InferenceSession::Initialize::<lambda_ac1b736d24ef6ddd1d25cf2738b937a9>::operator ()] Exception during initialization: D:\a\_work\1\s\onnxruntime\core\providers\cuda\cuda_call.cc:123 onnxruntime::CudaCall D:\a\_work\1\s\onnxruntime\core\providers\cuda\cuda_call.cc:116 onnxruntime::CudaCall CUDNN failure 4: CUDNN_STATUS_INTERNAL_ERROR ; GPU=0 ; hostname=MEREDITH ; file=D:\a\_work\1\s\onnxruntime\core\providers\cuda\cuda_execution_provider.cc ; line=182 ; expr=cudnnSetStream(cudnn_handle_, stream);


14:19:06-862967 ERROR    Running script postprocess image: extensions\sd-webui-reactor\scripts\reactor_faceswap.py:
                         RuntimeException
╭───────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────╮
│ C:\SD\automatic\modules\scripts.py:592 in postprocess_image                                                          │
│                                                                                                                      │
│   591 │   │   │   │   │   args = p.per_script_args.get(script.title(), p.script_args[script.args_from:script.args_to │
│ ❱ 592 │   │   │   │   │   script.postprocess_image(p, pp, *args)                                                     │
│   593 │   │   │   except Exception as e:                                                                             │
│                                                                                                                      │
│ C:\SD\automatic\extensions\sd-webui-reactor\scripts\reactor_faceswap.py:465 in postprocess_image                     │
│                                                                                                                      │
│   464 │   │   │   image: Image.Image = script_pp.image                                                               │
│ ❱ 465 │   │   │   result, output, swapped = swap_face(                                                               │
│   466 │   │   │   │   self.source,                                                                                   │
│                                                                                                                      │
│ C:\SD\automatic\extensions\sd-webui-reactor\scripts\reactor_swapper.py:544 in swap_face                              │
│                                                                                                                      │
│   543 │   │   │   │   │   │   logger.status("Analyzing Source Image...")                                             │
│ ❱ 544 │   │   │   │   │   │   source_faces = analyze_faces(source_img, det_thresh=detection_options.det_thresh, det_ │
│   545 │   │   │   │   │   │   SOURCE_FACES = source_faces                                                            │
│                                                                                                                      │
│ C:\SD\automatic\extensions\sd-webui-reactor\scripts\reactor_swapper.py:302 in analyze_faces                          │
│                                                                                                                      │
│   301 │   logger.info("Applied Execution Provider: %s", PROVIDERS[0])                                                │
│ ❱ 302 │   face_analyser = copy.deepcopy(getAnalysisModel())                                                          │
│   303 │   face_analyser.prepare(ctx_id=0, det_thresh=det_thresh, det_size=det_size)                                  │
│                                                                                                                      │
│ C:\SD\automatic\extensions\sd-webui-reactor\scripts\reactor_swapper.py:145 in getAnalysisModel                       │
│                                                                                                                      │
│   144 │   if ANALYSIS_MODEL is None:                                                                                 │
│ ❱ 145 │   │   ANALYSIS_MODEL = insightface.app.FaceAnalysis(                                                         │
│   146 │   │   │   name="buffalo_l", providers=PROVIDERS, root=os.path.join(models_path, "insightface") # note: allow │
│                                                                                                                      │
│                                               ... 1 frames hidden ...                                                │
│                                                                                                                      │
│ C:\SD\automatic\venv\lib\site-packages\insightface\model_zoo\model_zoo.py:96 in get_model                            │
│                                                                                                                      │
│   95 │   provider_options = kwargs.get('provider_options', get_default_provider_options())                           │
│ ❱ 96 │   model = router.get_model(providers=providers, provider_options=provider_options)                            │
│   97 │   return model                                                                                                │
│                                                                                                                      │
│ C:\SD\automatic\extensions\sd-webui-reactor\scripts\console_log_patch.py:21 in patched_get_model                     │
│                                                                                                                      │
│    20 def patched_get_model(self, **kwargs):                                                                         │
│ ❱  21 │   session = PickableInferenceSession(self.onnx_file, **kwargs)                                               │
│    22 │   inputs = session.get_inputs()                                                                              │
│                                                                                                                      │
│ C:\SD\automatic\venv\lib\site-packages\insightface\model_zoo\model_zoo.py:25 in __init__                             │
│                                                                                                                      │
│   24 │   def __init__(self, model_path, **kwargs):                                                                   │
│ ❱ 25 │   │   super().__init__(model_path, **kwargs)                                                                  │
│   26 │   │   self.model_path = model_path                                                                            │
│                                                                                                                      │
│ C:\SD\automatic\venv\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py:419 in __init__          │
│                                                                                                                      │
│    418 │   │   try:                                                                                                  │
│ ❱  419 │   │   │   self._create_inference_session(providers, provider_options, disabled_optimizers)                  │
│    420 │   │   except (ValueError, RuntimeError) as e:                                                               │
│                                                                                                                      │
│ C:\SD\automatic\venv\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py:483 in _create_inference │
│                                                                                                                      │
│    482 │   │   # initialize the C++ InferenceSession                                                                 │
│ ❱  483 │   │   sess.initialize_session(providers, provider_options, disabled_optimizers)                             │
│    484                                                                                                               │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: D:\a\_work\1\s\onnxruntime\core\providers\cuda\cuda_call.cc:123 onnxruntime::CudaCall D:\a\_work\1\s\onnxruntime\core\providers\cuda\cuda_call.cc:116 onnxruntime::CudaCall CUDNN failure 4: CUDNN_STATUS_INTERNAL_ERROR ; GPU=0 ; hostname=MEREDITH ; file=D:\a\_work\1\s\onnxruntime\core\providers\cuda\cuda_execution_provider.cc ; line=182 ; expr=cudnnSetStream(cudnn_handle_, stream);

Additional information

No response

@meredithincode meredithincode added bug Something isn't working new labels Aug 4, 2024
@meredithincode meredithincode changed the title Onnxruntime Error when trying to faceswap in SDnext Onnxruntime Error +CudaCall CUDNN failure using Reactor in SDNext Aug 4, 2024
@Gourieff Gourieff removed the new label Oct 7, 2024
@Gourieff Gourieff added ✔ fixed and removed bug Something isn't working labels Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants