Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development
Register FAQ Calendar Today's Posts Search

Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 9th May 2016, 16:54   #1521  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by MysteryX View Post
Edit: It is InterFrame that AVS+ x64 doesn't like. If I comment out Interframe, I get this

Code:
Frames processed:               502 (0 - 501)
FPS (min | max | average):      0.766 | 194871 | 7.700
Memory usage (phys | virt):     2248 | 2696 MiB
Thread count:                   154
CPU usage (average):            10%
I wonder which filter in your script makes it so slow and keeps the CPU usage at 10% despite invoking 8 threads. There's clearly also a lot of internal multi-threading going on in some of your filters, otherwise you wouldn't end up with 154 threads.

I'd say it's one of (or the combinations of) these:
Code:
SuperResXBR()
ResizeX()
Groucho2004 is offline  
Old 9th May 2016, 16:55   #1522  |  Link
Nevilne
Registered User
 
Join Date: Aug 2010
Posts: 134
Do you not realize you're GPU constrained
Nevilne is offline  
Old 9th May 2016, 18:36   #1523  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by Nevilne View Post
Do you not realize you're GPU constrained
Care to elaborate? Do you know which GPU he's using?
Groucho2004 is offline  
Old 9th May 2016, 19:14   #1524  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,666
@MysteryX

The latest SVPflow (v4.0.0.128) states that all filters are compatible with MT mode 1 so you might want to add this:
Code:
SetFilterMTMode("SVSuper", 1)
SetFilterMTMode("SVAnalyse", 1)
SetFilterMTMode("SVSmoothFps", 1)
Also are you sure that your Shader plugin is compatible with mode 2? Add the following and see if it helps any (are these all the filters in your plugin?).

Code:
SetFilterMTMode("ConvertFromShader", 3)
SetFilterMTMode("ConvertToShader", 3)
SetFilterMTMode("ExecuteShader", 3)
SetFilterMTMode("Shader", 3)
Reel.Deel is offline  
Old 9th May 2016, 19:27   #1525  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Quote:
Originally Posted by Reel.Deel View Post
In the x64 support in core filters, part 1 PR tp7 mentioned that only planar and RGB32 turn functions were optimized. However, the turn filter was refactored.
No problem with Turnleft/TurnRight

Managed to invoke the problem as:
(clown.png is 192x256)
Code:
ImageSource("clown.png").ConvertToRGB24().Trim(0,49)
Spline16resize(Width(),Height(),-0.5,-0.5)
In AVS+ there is a shift, in avs 2.6 no shift.
Question: which is the correct one?
pinterf is offline  
Old 9th May 2016, 20:02   #1526  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Quote:
Originally Posted by MysteryX View Post
With AviSynth+ r1849 x64, it doesn't load at all. AvsMeter stays stuck at "Reading frames..."

Edit: It is InterFrame that AVS+ x64 doesn't like. If I comment out Interframe, I get this

Code:
Frames processed:               502 (0 - 501)
FPS (min | max | average):      0.766 | 194871 | 7.700
Memory usage (phys | virt):     2248 | 2696 MiB
Thread count:                   154
CPU usage (average):            10%
I also had this problem some days ago, without Interframe worked, with Interframe did not.
The last thing I saw in debugView:
Code:
[17364] Cache::GetFrame LRU_LOOKUP_NOT_FOUND: [ConvertToShader] n=     0 
child=0000000003A2F310 
frame=000000000A1BB2A0 
framebefore=000000000A1BB2A0 videoCacheSize=1 SeekTimeWithGetFrame:0.004151
and the process is stuck here. (Avsmeter64 says: reading frame)
But previously there were successful similar actions, such as:

Code:
[17364] Cache::GetFrame LRU_LOOKUP_NO_CACHE: [ConvertToShader] n=     0 
child=0000000003A2F3E0 
frame=000000000A145890 vfb=0000000005128F30 videoCacheSize=0 SeekTime            :0.818723
[17364] Cache::GetFrame LRU_LOOKUP_NO_CACHE: [ConvertToShader] n=     0 
child=0000000003A2F3E0 
frame=000000000A145610 vfb=0000000005128F90 videoCacheSize=0 SeekTime            :0.821725
[17364] Cache::GetFrame LRU_LOOKUP_FOUND_AND_READY: [ConvertToYV12] n=     0 
child=00000000036B8B10 
frame=000000000AF2A810 vfb=0000000005121F10 videoCacheSize=1 SeekTime            :0.000005
[17364] Cache::GetFrame LRU_LOOKUP_FOUND_AND_READY: [ConvertToYV12] n=     0 
child=00000000036B8B10 
frame=000000000AF2A810 vfb=0000000005121F10 videoCacheSize=1 SeekTime            :0.000003
etc...
so I cannot tell you what happened.

Then I disabled MT (no Prefetch line). It worked.
And re-enabled Prefetch(1) and now I got only:
(mostly) ExecuteShader: CopyInputClip failed
(rarely) ExecuteShader: ProcessFrame failed
pinterf is offline  
Old 9th May 2016, 20:13   #1527  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
Quote:
Originally Posted by Nevilne View Post
Do you not realize you're GPU constrained
Yes, I'm using AviSynthShader which I wrote myself. The bottleneck is memory transfers from the GPU back to the CPU.

Quote:
Originally Posted by Reel.Deel View Post
@MysteryX

The latest SVPflow (v4.0.0.128) states that all filters are compatible with MT mode 1 so you might want to add this:
Code:
SetFilterMTMode("SVSuper", 1)
SetFilterMTMode("SVAnalyse", 1)
SetFilterMTMode("SVSmoothFps", 1)
Also are you sure that your Shader plugin is compatible with mode 2? Add the following and see if it helps any (are these all the filters in your plugin?).

Code:
SetFilterMTMode("ConvertFromShader", 3)
SetFilterMTMode("ConvertToShader", 3)
SetFilterMTMode("ExecuteShader", 3)
SetFilterMTMode("Shader", 3)
Perhaps this "might" help, but it works perfectly in x86. There is no reason why the x64 code should be any less compatible.

Quote:
Originally Posted by pinterf View Post
In AVS+ there is a shift, in avs 2.6 no shift.
Question: which is the correct one?
AVS 2.6 is correct with no shift.

Quote:
Originally Posted by pinterf View Post
Then I disabled MT (no Prefetch line). It worked.
And re-enabled Prefetch(1) and now I got only:
(mostly) ExecuteShader: CopyInputClip failed
(rarely) ExecuteShader: ProcessFrame failed
That is strange. I wrote those myself. I haven't really tested the x64 version of AviSynthShader but some people tried it and said it works. Does it work with a previous build of AVS+?

Last edited by MysteryX; 9th May 2016 at 20:17.
MysteryX is offline  
Old 9th May 2016, 20:19   #1528  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Quote:
Originally Posted by Reel.Deel View Post
@MysteryX
Also are you sure that your Shader plugin is compatible with mode 2? Add the following and see if it helps any (are these all the filters in your plugin?).

Code:
SetFilterMTMode("ConvertFromShader", 3)
SetFilterMTMode("ConvertToShader", 3)
SetFilterMTMode("ExecuteShader", 3)
SetFilterMTMode("Shader", 3)
When I set either ConvertToShader _or_ ConvertFromShader to MT mode 3, it works.
If both of them are mode 2, it stucks.
pinterf is offline  
Old 9th May 2016, 21:55   #1529  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by pinterf View Post
the process is stuck here. (Avsmeter64 says: reading frame)
That simply means that Avisynth doesn't return from a "PVideoFrame::GetFrame()" call.
Groucho2004 is offline  
Old 10th May 2016, 04:51   #1530  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
Quote:
Originally Posted by pinterf View Post
When I set either ConvertToShader _or_ ConvertFromShader to MT mode 3, it works.
If both of them are mode 2, it stucks.
I could debug the DLL to see where it crashes, but the fact that it works with mode 2 in x86 and that it works with mode 3 in x64 indicates that the code itself is working.
MysteryX is offline  
Old 10th May 2016, 07:15   #1531  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
Every since I switched from AviSynth 2.6 to AviSynth+, with SVP, sometimes there is green bars artifacts. It happens rarely and only for a frame or two and then it's fine so it's hard to reproduce, but it would be something to keep an eye out for.
MysteryX is offline  
Old 10th May 2016, 13:05   #1532  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Quote:
Originally Posted by pinterf View Post
Managed to invoke the problem as:
(clown.png is 192x256)
Code:
ImageSource("clown.png").ConvertToRGB24().Trim(0,49)
Spline16resize(Width(),Height(),-0.5,-0.5)
In AVS+ there is a shift, in avs 2.6 no shift.
Question: which is the correct one?
Fixed

RGB24 and RGB32 resizers were shifting the image horizontally to the opposite direction.
The phenomenon became more pronounced when the crop values were much larger than MysteryX sample with 0.5.

Code:
b=ImageSource("clown.png").Trim(0,49).ConvertToRGB24()
a=b.Spline16resize(b.Width(),b.Height(),20,20)
b=b.Spline16resize(b.Width(),b.Height(),-20,-20)
StackHorizontal(a,b)
Now it looks the same as in other color spaces.
MysterX, thank you for the report. Release: later.
pinterf is offline  
Old 10th May 2016, 14:04   #1533  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,666
@Everyone using MT

Small update to the MT modes list. Added a handful of source filters, SVPflow, and a few corrections. Hopefully more to come.
Someone recently added LanczosResize to the list. I thought all the internal filters already register themselves?


@pinterf
Thanks for the fix!
Reel.Deel is offline  
Old 10th May 2016, 14:16   #1534  |  Link
BakaProxy
Registered User
 
Join Date: Jan 2015
Posts: 47
Idk if this has already been asked and/or answered but is it possible to use mvtools in mt? Uhh more like whenever I use mdegrain (and the vectors that come allong) cpu utilization is rather low, some scenarios even only 20%. I've tried every mt mode with mvtools but it either completely freezes the encode or it doesn't change anything performance wise. Prefetch amounts don't change anything as well, it just takes longer to start with large amounts.

Verstuurd vanaf mijn SM-A500FU met Tapatalk
BakaProxy is offline  
Old 10th May 2016, 14:47   #1535  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 595
Quote:
Originally Posted by Reel.Deel View Post
Someone recently added LanczosResize to the list. I thought all the internal filters already register themselves?
It's strange.
All internal resizers except PointResize are using common code.
The differences are just coefficients(calculated at the time of initialization of a script) and number of refference samples.
If LanczosResize is not MT_NICE_FILTER, then others are also same.
__________________
my repositories
Chikuzen is offline  
Old 10th May 2016, 15:16   #1536  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Only source filters (AVISource, AVIFileSource, WAVSource, OpenDMLSource) and ChangeFPS are MT_SERIALIZED, everything else is NICE_FILTER. They are registered inside Avisynth+
pinterf is offline  
Old 10th May 2016, 18:44   #1537  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,666
Quote:
Originally Posted by pinterf View Post
Only source filters (AVISource, AVIFileSource, WAVSource, OpenDMLSource) and ChangeFPS are MT_SERIALIZED, everything else is NICE_FILTER. They are registered inside Avisynth+
Thanks for the clarification, I'll add a note so people won't add internal filters to the MT modes list.

Quick question: there's a undocumented parameter in SetFilterMTMode (bool force). Do you have any idea what it does? Is the default false? I never got a chance to ask ultim when he was still around.
Reel.Deel is offline  
Old 10th May 2016, 20:00   #1538  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,666
Quote:
Originally Posted by Chikuzen View Post
According to avisynth.cpp, if 'force' is set to true, MTMode of the filter refuses to be overwritten by a script.
Thus, users cannot change MTMode of all internal filters.
Thanks Chikuzen, I first saw it used here, unfortunately I cannot read Japanese.

If I add force=true to the mt modes list would that prevent users from overwriting it in their scripts or does it only work for internal filters/ external filters that register themselves?
Reel.Deel is offline  
Old 10th May 2016, 20:38   #1539  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 595
Quote:
Originally Posted by Reel.Deel View Post
Thanks Chikuzen, I first saw it used here, unfortunately I cannot read Japanese.

If I add force=true to the mt modes list would that prevent users from overwriting it in their scripts or does it only work for internal filters/ external filters that register themselves?
oops, sorry. I was wrong.
If user set 'SetFilterMTMode("somefilter", mode, force=true)', he can overwrite the MTMode.
__________________
my repositories
Chikuzen is offline  
Old 11th May 2016, 04:35   #1540  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
Quote:
Originally Posted by Reel.Deel View Post
@MysteryX

The latest SVPflow (v4.0.0.128) states that all filters are compatible with MT mode 1 so you might want to add this:
Code:
SetFilterMTMode("SVSuper", 1)
SetFilterMTMode("SVAnalyse", 1)
SetFilterMTMode("SVSmoothFps", 1)
Adding this causes the x86 script to freeze on start.

Last edited by MysteryX; 11th May 2016 at 04:38.
MysteryX is offline  
Closed Thread


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 21:07.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.