WASasquatch / was-node-suite-comfyui

An extensive node suite for ComfyUI with over 210 new nodes
MIT License
1.15k stars 170 forks source link

Error when TensorRT is loaded for RemBG #413

Closed MattRM2 closed 3 months ago

MattRM2 commented 3 months ago

Hi,

I have an error when I try to use "Image Rembg" node : `2024-06-03 12:26:18.3178859 [E:onnxruntime:Default, provider_bridge_ort.cc:1534 onnxruntime::TryGetProviderInfo_TensorRT] D:\a_work\1\s\onnxruntime\core\session\provider_bridge_ort.cc:1209 onnxruntime::ProviderLibrary::Get [ONNXRuntimeError] : 1 : FAIL : LoadLibrary failed with error 126 "" when trying to load "E:\00_ComfyUI_Fooocus\python_embeded\lib\site-packages\onnxruntime\capi\onnxruntime_providers_tensorrt.dll"

EP Error EP Error D:\a_work\1\s\onnxruntime\python\onnxruntime_pybind_state.cc:456 onnxruntime::python::RegisterTensorRTPluginsAsCustomOps Please install TensorRT libraries as mentioned in the GPU requirements page, make sure they're in the PATH or LD_LIBRARY_PATH, and that your GPU is supported. when using ['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider'] Falling back to ['CUDAExecutionProvider', 'CPUExecutionProvider'] and retrying. ****`

I have two graphics cards. One, my primary, is a GTX 1070 Ti for the display and the second one is an RTX 4070 Super for computation (3D, compositing and AI).

What I need to do to avoid this error and use the RTX 4070 Super TensorRT ? Of course, the node switch back to cuda and compute the node.

Thank you,

Matt

bobcate commented 3 months ago

https://github.com/comfyanonymous/ComfyUI/issues/2823

pip uninstall rembg
pip uninstall onnxruntime
pip install rembg[gpu] onnxruntime-gpu

This gets rid of the error but no idea how to select which gpu to use.

MattRM2 commented 3 months ago

Thank you for your answer ;) I think is doing this in the embedded python from ComfyUI ?

Matt

bobcate commented 3 months ago

I guess so? I launched CMD in the ..\ComfyUI\venv\Scripts directory and called the activate.bat. Then I entered those lines in order.

MattRM2 commented 3 months ago

Oki, thank you very much ;)

904557558 commented 3 months ago

What is your cudnn version? onnxruntime-gpu does not support cudnn version 9.x yet. Reducing your cudnn version to 8.9.x may solve your problem.

MattRM2 commented 3 months ago

Hi all,

Thx for your answers, the solution of Bobcate solved my problems and another ;) Thank you again,

Matt