[RESOLVED] Crash if graphics card is not available

Support forum for DGDecNV
Post Reply
DAE avatar
Zathor
Posts: 94
Joined: Sun Nov 28, 2010 5:06 am

[RESOLVED] Crash if graphics card is not available

Post by Zathor »

When opening a avisynth script which contains DGSource() and the nvidia graphics card is not available (e.g. in a RDP session) two error messages are shown ("cuInit() failed" and "Failed to create video decoder(100)") and afterwards the calling application will close silently. I tried this with MeGUI and MPC-HC and both programs closed themself silently without a message.

I am using DGDecodeNV 2036 & Windows 7 64bit & Nvidia 460 GTX & driver 260.99

AviSynth example script:

Code: Select all

LoadPlugin("E:\VideoTools\MeGUI\tools\dgindexnv\DGDecodeNV.dll")
DGSource("U:\recording\movie.dgi",fieldop=0)
If possible:
- please change it at least in the way that the calling application is not closed
- additionally I prefer that the two error messages are not shown in a message box and instead are shown as avisynth error messages so that for example the processing of jobs in MeGUI is not paused

Thanks in advance
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Crash if graphics card is not available

Post by admin »

I can't throw exceptions outside my filter constructor.

I can make the message boxes timeout (say 5-10 seconds) and I can just return garbage frames instead of committing hari kari.

Would that work for you?
DAE avatar
Zathor
Posts: 94
Joined: Sun Nov 28, 2010 5:06 am

Re: Crash if graphics card is not available

Post by Zathor »

The main problem for me is the crashing/closing of the parent process. Is it possible to output "garbage" in the way that AviSynth refuses to play it so that it will exit in a normal way (with an avisynth error message)?
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Crash if graphics card is not available

Post by admin »

I have done this:

1) At first start you get two error popups that timeout after 5 seconds each.
2) After that green frames are returned with the text "CUDA Error!" written on them with no further popups.

This way the encode will finish but with bad video.

I don't know how to signal you that things went wrong so that you can abort the job. Any ideas? Remember, I cannot throw exceptions in GetFrame(). If you don't mind inspecting the video I could signal it there.
DAE avatar
Zathor
Posts: 94
Joined: Sun Nov 28, 2010 5:06 am

Re: Crash if graphics card is not available

Post by Zathor »

Thank you very much. The "parent app crashing" is gone and this was the important part of my report.
neuron2 wrote:I don't know how to signal you that things went wrong so that you can abort the job. Any ideas? Remember, I cannot throw exceptions in GetFrame(). If you don't mind inspecting the video I could signal it there.
Sadly I have no good idea. I was thinking about calling DGIndexNV.exe with a special parameter. When everything is fine (license file, driver available, whatever) then the exit code is 0, if something is wrong the exit code is different from 0. Maybe the DGI can passed to DGIndexNV as a parameter so that this file can be checked also. A calling app of an avisynth script with a DGI call can then before opening the script check if everything is fine. More or less this is some kind of workaround, but if there is no other method directly in AviSynth available, then this could be a possible solution.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Crash if graphics card is not available

Post by admin »

I can do this: In the filter constructor try to open up CUDA and create a video decoder. If it fails, then throw you an exception. So you'll at least get an indication at filter startup that things are amiss. Can you catch an Avisynth exception and respond appropriately?
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Crash if graphics card is not available

Post by admin »

Marking as resolved due to non-response to my last question. It seems the main issue has been resolved in any case.
Post Reply