-
-
Notifications
You must be signed in to change notification settings - Fork 203
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
"GPU - DirectML" setting is broken in the latest release #272
Comments
|
It seems that DirectML.dll included in this plugin is too old |
@Sparronator9999 Can you try #274 build? |
@umireon we shuold anyway not crash... we need a try-catch to intercept the exception and fall back to CPU |
Please remove the following files:
Can you try this artifact after these files are removed? |
Please be sure to place DirectML.dll and onnxruntime.dll into the obs-plugins directory. |
@umireon, I just tested the linked artifact after removing the files you listed. It still doesn't work properly (the plugin will still blur everything if set to GPU on startup). I copied the contents of the zip file (the |
I have also just tested #279, which also currently doesn't appear to fix the problem. |
@Sparronator9999 Can you post the log here, please? |
Sure thing! I started OBS with GPU mode for the plugin, then switched to CPU and back to GPU. |
@Sparronator9999 Can you post the result of Dependencies here? Please start DependenciesGui and open C:\Program Files\obs-studio\obs-plugins\64bit\obs-backgroundremoval.dll The app of Dependencies is available on the following URL: |
Hmm... I don't see any problems |
I just re-installed OBS and the Background Removal plugin (from #279) and I'm still getting the same dependency error |
In the first screenshot, it shows |
obs.dll is okay to be missing |
OK... I guess? Anyways, I'm still having the same problem as before. |
I doubt the DirectML.dll is too old |
@Sparronator9999 Can you paste here the v0.5.16 log? Thanks! |
Here you go: |
Can you install the latest version and remove the following files C:\Program Files\obs-studio\obs-plugins\64bit\onnxruntime.dll and check if it works? |
Hello again, now the plugin isn't working at all. No options show up in the filter options now. Here's the log file: |
I tested on v0.5.17 with the two DLLs removed from your previous comment. |
@Sparronator9999 Can you try #280 ? |
The plugin still doesn't work at all. |
Can you post here the screenshot of DependenciesGui on C:\Program Files\obs-studio\obs-plugins\64bit\obs-backgroundremoval.dll again? |
@Sparronator9999 Can you restart the Windows and try again, please? I doubt some DLL caching causes this problem. |
@Sparronator9999 Please try #281. I'm sure this solves the problem. |
@royshil I sum the understanding of this issue up below. The root cause of this issueonnxruntime.dll try to delay load DirectML.dll and the Windows link the DirectML.dll under System32. How we can resolve this issue?Load DirectML.dll without delay loading or indicate the OS to load DLL from other directories than System32. DetailWindows 11 has a bit old onnxruntime.dll and DirectML.dll and they can be combined safely. Delay loading is another problem. My conclusionWe can fix the System32 delay loading problem by modifying the application-wise settings temporarily, but we have to link ONNX Runtime statically if we want to support Windows 10. I feel the statically-linking way is safer than the modifying-application-wise-settings way. |
the static link will require building ORT from scratch on Windows - which take ~45 minutes on CI another thing i think we can and should do is build ORT from scratch as a static link .lib binary and cache this build in the cloud which would be downloaded in CI instead of being built from scratch every time i can host it on my private S3 if needed, it's no big deal what do you think @umireon ? |
Can ccache which we had used be an option? |
yes it helps a bit - but it still does the "compilation" just the if you just build and cache the complete post-build folder, and then download in CI, you save up on all the build steps and jump right to building the plugin |
I suppose we can store the pre-built files on GitHub Releases or GitHub Packages for free because we are open-sourced. |
sounds great - how do we get started? |
@umireon It seems like ORT still isn't being detected by the plugin: I deleted all old plugin files before installing from #281 (including old onnxruntime.dll and DirectML.dll). Log file: |
I have to conclude that the modifying-application-wise-settings way is not our option. |
@Sparronator9999 Can you try #283? |
@umireon Good news, the plugin works again. Bad news, Log file: Dependencies screenshot: |
I forgot to include DirectML.dll sorry |
@Sparronator9999 Can you try #283 again? |
It works! |
@royshil I have started umireon/onnxruntime-static-win to store static ONNX Runtime |
that's great - thanks! we should integrate in the build scripts |
@umireon while you're at it - do you want to prebuild OpenCV static as well? |
I think building a pre-built binary by ourselves is the last resort. |
The maintenance cost of pre-built ONNX Runtime is also huge but it is worth doing because it saves us for hours. |
This is fixed by #286 |
Hello, everyone, I've found another solution to your problem. You can link your library with directml directly and call it with random data before using ONNX runtime
That will eliminate the need in statically linking |
Well, actually there's a better one https://github.com/dakenf/onnxruntime/blob/main/js/node/src/directml_load_helper.cc |
Describe the bug
When opening OBS with the inference mode set to GPU, the output will disappear (if background blur is off), or be entirely blurred (if background blur is on). Setting the inference mode back to CPU fixes this, but setting it back to GPU does nothing (this can be seen using Task Manager).
To Reproduce
Steps to reproduce the behavior:
Inference Device
set to GPUBackground Blur Factor
higher than 0, the output will be completely blurred)Inference Device
back to CPUInference Device
back to GPUExpected behavior
GPU inference works correctly
Screenshots
To demonstrate the issue, I switched between CPU and GPU inference modes every few seconds, starting in CPU mode from a fresh start of OBS in both cases.
You can see clearly in the left screenshot (Before) that the CPU usage drops significantly as the work is offloaded to a GPU. The right screenshot (After) shows no change in CPU resource usage.
This issues was tested with Background Blur off, because of another issue (see #271).
(as i'm writing this i realised i should have switched to the CPU tab, oops)
Log and Crash Report
2023-04-24 08-38-53.txt
2023-04-24 08-39-11.txt
Desktop (please complete the following information):
Additional context
Commit 322a098 (using prebuilt OnnxRuntime) appears to be the first commit where this problem occurs, as e2d9a11 does not have this issue.
The text was updated successfully, but these errors were encountered: