CUDASynth

These CUDA filters are packaged into DGDecodeNV, which is part of DGDecNV.
User avatar
hydra3333
Distinguished Aussie Member
Distinguished Aussie Member
Posts: 134
Joined: Wed Oct 06, 2010 3:34 am
Contact:

Re: CUDASynth

Post by hydra3333 » Tue Oct 09, 2018 6:31 pm

DJATOM wrote:
Tue Oct 09, 2018 5:56 pm
Yeah, it's possible to make autoloading with hand-written python module (as I did before native DGSource version came out), but it's, say, wasting a time to type another line in the script. So I'd like to have native versions if possible. I almost don't use avs+ nowadays, moved to VS about 1 year ago :lol:
Being a control freak from way back (too many systems went belly up if decent control was omitted during development) I always manually load everything and don't begrudge a line or 20 of code :) Personal preference.

rar ? google tells me
What does RAR stand for in finance?
Abbr. Meaning
RAR Revenue Agent Report (US IRS)
RAR Refund-Anticipated Return
RAR Run At Risk
RAR Regulatory Asset Ratio (finance)
3rd seems about right given the vsrepo experience with 7z :D

User avatar
gonca
Distinguished Member
Distinguished Member
Posts: 619
Joined: Sun Apr 08, 2012 6:12 pm

Re: CUDASynth

Post by gonca » Tue Oct 09, 2018 8:11 pm

If you go this route all I really need to do is change my templates to be avs compatible.
So, all is good
Now that I think about it, the only reason I moved to vs was the lack of high bit depth support in the avisynth chain (NVEncC)
That has been corrected though

User avatar
admin
Site Admin
Posts: 4046
Joined: Thu Sep 09, 2010 3:08 pm

Re: CUDASynth

Post by admin » Tue Oct 09, 2018 8:22 pm

Good points, guys, thanks.

I have found a simple script that runs perfect in Avisynth+ but runs at half speed and then stops completely in Vapoursynth native (no CUDASynth for both). I want to check a few things first and then I'll give you the script to see if you can replicate it. Then we'll have to try to figure out what is going wrong.

User avatar
admin
Site Admin
Posts: 4046
Joined: Thu Sep 09, 2010 3:08 pm

Re: CUDASynth

Post by admin » Wed Oct 10, 2018 4:32 pm

I found the cause of the Vapoursynth slowdown and stoppage. DGHDRtoSDR was missing a freeFrame(src) call (affecting only the Vapoursynth code) and so memory was being exhausted. I'll release a fix later today and then get back to proper benchmarking.

User avatar
gonca
Distinguished Member
Distinguished Member
Posts: 619
Joined: Sun Apr 08, 2012 6:12 pm

Re: CUDASynth

Post by gonca » Thu Oct 11, 2018 7:23 pm

Good to hear you are making headway

User avatar
admin
Site Admin
Posts: 4046
Joined: Thu Sep 09, 2010 3:08 pm

Re: CUDASynth

Post by admin » Thu Oct 11, 2018 7:50 pm

Yup. I also got things going with my test script in avscompat mode. I had an earlier version of Vapoursynth and when I upgraded to R44 everything started working.

User avatar
admin
Site Admin
Posts: 4046
Joined: Thu Sep 09, 2010 3:08 pm

Re: CUDASynth

Post by admin » Fri Oct 12, 2018 11:22 am

Following are performance results with a simple script with just DGSource() followed by DGHDRtoSDR() for 3840x2160. I won't give the exact scripts right now as I need to give you a revised DGHDRtoSDR.dll and a revised AvsCompat.dll to enable you to duplicate my results. I'll give you those things in a while. Benchmarked with AVSMeter and VSEdit.

The change made to AvsCompat.dll for the results below was to add PREFETCHR1(DGHDRtoSDR). DGHDRtoSDR() is not temporal but the prefetching helps Vapoursynth to parallelize things.

Native Avisynth+: 80.4 fps / 14% CPU
Native Avisynth+ with pipeline: 181.7 / 8% CPU

Native Vapoursynth: 79.8 fps
AvsCompat Vapoursynth: 80.2 fps
AvsCompat Vapoursynth with pipeline: 181.7 fps

These results support my proposed plan to not make Vapoursynth native versions but rather to ship an optimized AvsCompat.dll instead. I'm also thinking of revising AvsCompat.dll to be able to read from a file of prefetch values, so users can tweak things. Or, maybe better, add a prefetch parameter to the filter itself for use by AvsCompat.dll. Always thinking outside the box. :twisted:

User avatar
gonca
Distinguished Member
Distinguished Member
Posts: 619
Joined: Sun Apr 08, 2012 6:12 pm

Re: CUDASynth

Post by gonca » Fri Oct 12, 2018 4:03 pm

Or, maybe better, add a prefetch parameter to the filter itself for use by AvsCompat.dll.
This sounds like a great idea.
Allows to tweak the performance by filter instead of entire script

User avatar
hydra3333
Distinguished Aussie Member
Distinguished Aussie Member
Posts: 134
Joined: Wed Oct 06, 2010 3:34 am
Contact:

Re: CUDASynth

Post by hydra3333 » Sat Oct 13, 2018 9:15 pm

Very nice, yes.
I wonder, the vs author may accept a patch :) https://github.com/vapoursynth/vapoursynth

User avatar
admin
Site Admin
Posts: 4046
Joined: Thu Sep 09, 2010 3:08 pm

Re: CUDASynth

Post by admin » Wed Oct 17, 2018 4:43 pm

Just thought to let you guys know I managed to place an order for a 2080 Ti Founders Edition with the nVidia store. It's estimated to ship between 10/19/2018 and 10/26/2018. It's financed from donations so thank you to my users! :salute: You know I will use it to make DG tools greater than ever before for all of us.

https://www.nowinstock.net/computers/vi ... rtx2080ti/

Meanwhile, on the CUDASynth front, I have discovered some very interesting things focused around what Prefetch() does in Avisynth+, and what the PREFETCH macro does in Vapoursynth, and how they interact with CUDASynth. It opens a possible avenue for further performance gains. I'll write a post about it when I get an energy burst. Right now I am working on DGIndex MKV support. I have decoded and displayed a frame from an MKV but have loads of things to do to complete MKV support. Fortunately, most of it can be pulled from DGDecNV.

@hydra3333

A patch would likely not be accepted as similar ideas have been rejected. No problem; it's easy to replace AvisynthCompat.dll.

Post Reply