View Issue Details

IDProjectCategoryView StatusLast Update
0000301madVRbugpublic2018-01-14 15:56
Reporterluc Assigned Tomadshi  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionno change required 
Summary0000301: OS restart when seek the video using SuperRes refinement
Description1. Setting initialized with restore default settings.bat.
2. Turn on the SuperRes in scaling algorithms\upscaling refinement.
3. Play 720p video in full screen 1080p display.
4. When several times seek the video, OS automatic restart.
TagsNo tags attached.
madVR Version0.88.8
Media Player (with version info)MPC-HC 1.7.8 x64
Splitter (with version info)MPC-HC internal LAV
Decoder (with version info)MPC-HC internal LAV
DecodingSoftware
Deinterlacingnone (progressive)
DXVA2 Scaling Activeno
Aero / Desktop CompositionOn
Problem occurs with modefullscreen exclusive mode
GPU ManufacturerAMD
GPU ModelRadeon HD5870
GPU Driver VersionCatalyst 14.12

Activities

madshi

2015-05-17 11:43

administrator   ~0001035

That sounds like a hard crash in the GPU drivers. Which OS are you on? You could try updating your GPU drivers to the latest version to see if that helps...

luc

2015-05-17 13:42

reporter   ~0001036

Windows 7 x64. Catalyst 14.12 is latest stable driver.
Unfortunately, update 15.4.1 Beta is not help.

madshi

2015-05-17 14:03

administrator   ~0001037

Can you try to narrow the circumstances down a bit? E.g. does it depend on whether you use NNEDI3? Or NEDI? Or no image doubling at all? Does the problem depend on the number SuperRes passes? Does the problem only occur when refining the image after every 2.0x upscaling step or also if you apply SuperRes only once after upscaling is complete? Does the same problem occur if you use FineSharp or LumaSharpen instead of SuperRes?

luc

2015-05-17 15:43

reporter   ~0001038

> E.g. does it depend on whether you use NNEDI3? Or NEDI? Or no image doubling at all?
At all. non-double, NEDI, NNEDI3 defaults.
> Does the problem depend on the number SuperRes passes?
Even 1 pass occur the problem.
In addition, error upscaling quality medium or high are occur the problem.
> Does the problem only occur when refining the image after every 2.0x upscaling step or also if you apply SuperRes only once after upscaling is complete?
Both are occur the problem.
> Does the same problem occur if you use FineSharp or LumaSharpen instead of SuperRes?
Only SuperRes. No problem use FineSharp and/or LumaSharpen.

madshi

2015-05-17 16:17

administrator   ~0001039

Wow, this is weird. And it happens with all video sources, too, e.g. SD and HD content, both 24fps and 60fps?

You don't have the "RenderScript.zip" extracted in the "madVR\legal stuff\Shiandow" folder, do you? There are no extracted *.hlsl files in that folder, right?

luc

2015-05-17 17:19

reporter   ~0001040

There are no extracted *.hlsl files in that folder.

It happens with all video sources.
It happens 720p@24fps when hit about 3times seekbar. (more worse 1time or during playback.)
It happens 480p@30fps when hit about 15times seekbar.
Something GPU perfomance or VRAM usage hit?

madshi

2015-05-18 11:58

administrator   ~0001041

Hmmmm... Does this also occur in windowed mode? If so, please have a look at the GPU RAM consumption. Does it increase every time you seek? If so, does the increase go back after a while or does it stay higher?

You could also try lowering the size of your GPU queue and the number of pre-presented frames. That should lower GPU RAM consumption.

luc

2015-05-18 19:51

reporter   ~0001042

It also occur in fullscreen windowed mode. I was monitored using the HWiNFO64 that setting scan interval 100ms, 720x480 source, enable SuperRes non-double defaults.
First I open the video in window: Dedicated 170MB, Dynamic 291MB
Go to the fullscreen(Alt+Enter): Dedicated 425MB, Dynamic 304MB
When I seek once Dynamic Memory is slightly increase and go back.
Sometimes several times seek I can see its increase to 335MB and stay. But this increase also occur in window or even disable SuperRes, I start playback and many times 5seconds skip(press the right arrow key) that OS is not restarted, so may be unrelated.

Ah I try 4 GPU queue and 1 pre-presented frames is not help, at least 720p source.

madshi

2015-05-18 23:17

administrator   ~0001044

How much RAM Does your GPU have? Does HWInfo64 show the GPU consumption in percent? How much % was used/free?

One more test: In the "legal stuff\Shiandow" folder there is a RenderScript.zip file. Please unzip the files "SuperRes.hlsl" and "SuperResDiff.hlsl" to the root of the "Shiandow" folder. This will make madVR read those files and compile them and use them instead of the SuperRes pixel shaders compiled into the madVR.ax file. I don't think this will make a difference, but it's worth a test. If the crash still occurs this way, the next step will be to modify/simplify the files and check if that helps. But maybe already just unzipping the files changes things?

luc

2015-05-19 20:30

reporter   ~0001051

My GPU RAM is 1024MB. HWInfo64 not show percentage, it shows "GPU D3D Memory Dedicated" and "GPU D3D Memory Dynamic". I believe Dedicated Memory is GPU RAM consumption because its increase when I increase pre-presented frames, and Dynamic Memory is not increase. As I wrote above, Dedicated Memory is 425MB in fullscreen so 40% used.

It also occur that I extracted *.hlsl files in "Shiandow" folder.
Mmmm... I had never change the hlsl files until now. I can see the files are similar to the C source code, but I don't know how to modify the files.

madshi

2015-05-19 20:49

administrator   ~0001052

I didn't ask you to modify the files just yet, I just mentioned that that might be the next step we could try. I'll guide you through that when we're there.

But first please do what I asked:

One more test: [...] But maybe already just unzipping the files changes things?

Does it? Or does it not? Please note, I was only talking about 2 HLSL files. Don't extract the others, it will only slow things down.

luc

2015-05-20 14:24

reporter   ~0001053

Oh I'm sorry, it was my lack of explanation. Of course I did it, but still happen.

madshi

2015-05-20 14:47

administrator   ~0001054

Ok, first try: In "SuperRes.hlsl" there's a very big "main" function. Please replace it with the following very short code:

float4 main(float2 tex : TEXCOORD0) : COLOR0
{
  float3 c0 = tex2D(src, tex).xyz;
  return float4(c0, 0);
}

Doing that will make SuperRes not work properly. But it would be interesting to know if this fixes the reboot?

luc

2015-05-20 17:55

reporter   ~0001055

Yes it fixes the reboot.

madshi

2015-05-20 18:07

administrator   ~0001056

Ok, next try. Does this one reboot?

float4 main(float2 tex : TEXCOORD0) : COLOR0
{
  float3 c0 = tex2D(src, tex).xyz;
  float3 stab = 0;
  float3 Ix = (Get(1, 0) - Get(-1, 0)) / (2.0*h);
  float3 Iy = (Get(0, 1) - Get(0, -1)) / (2.0*h);
  float3 Ixx = (Get(1, 0) - 2 * Get(0, 0) + Get(-1, 0)) / (h*h);
  float3 Iyy = (Get(0, 1) - 2 * Get(0, 0) + Get(0, -1)) / (h*h);
  float3 Ixy = (Get(1, 1) - Get(1, -1) - Get(-1, 1) + Get(-1, -1)) / (4.0*h*h);
  float3 N = rsqrt(Ix*Ix + Iy*Iy);
  Ix *= N; Iy *= N;
  stab -= anti_aliasing*(Ix*Ix*Iyy - 2*Ix*Iy*Ixy + Iy*Iy*Ixx);
  stab += sharpness*0.5*(Ixx + Iyy);
  float3 diff = (Diff(0, 0) - 0.5) * 0.125;
  c0 -= strength*(diff + stab);
  int2 pos = floor(tex * orgSize.xy - 0.5);
  float3 Min = min(min(Original(0, 0), Original(1, 0)), min(Original(0, 1), Original(1, 1)));
  float3 Max = max(max(Original(0, 0), Original(1, 0)), max(Original(0, 1), Original(1, 1)));
  float3 AR = c0 - clamp(c0, Min, Max);
  c0 -= AR*smoothstep(0, (Max - Min) / anti_ringing - (Max - Min) + pow(2,-16), abs(AR));
  return float4(c0, 0);
}

luc

2015-05-20 18:28

reporter   ~0001057

Its not reboot.

madshi

2015-05-20 18:49

administrator   ~0001058

Ok, then try the original code, just change one line from this:

  "[unroll] for( int k = 0; k < 8; k++)"

to this:

a) "for( int k = 0; k < 8; k++)"

or to this:

b) "for( int k = 0; k < 1; k++)"

Does either a) or b) or both reboot?

luc

2015-05-20 19:08

reporter   ~0001059

a) is reboot, b) is not reboot.

madshi

2015-05-20 23:36

administrator   ~0001060

Ok. I think we can stop the tests now. From what I can see, the drivers you've been using can't handle the SuperRes HLSL code properly, for some reason. It might be that the code is too long/complex, or something. Simply shorting the code seems to "fix" the problem. This very much looks like a bug in the GPU drivers.

The one thing that confuses me is that the problem only occurs when seeking. That is really weird. I don't know what seeking has to do with it. But then, it doesn't change the fact that shorting the HLSL code seems to fix the problem. So I can see no other reason for the reboot than a GPU driver problem.

I'm sorry, but at this point I've no clue what I could to fix this problem. You could use the b) variant. It mostly disables the "softness" part of the SuperRes algorithm, while keeping all other parts active. So you could use SuperRes this way, without softening.

luc

2015-05-21 18:43

reporter   ~0001061

OK. Thank you. I use SuperRes without softening, in 0000301:0001056.

I'm sorry, I was confusing you. It also occurred when I was playing not seek the video, using the original shader. I can reproduce the problem in quickly to seek the video.

Issue History

Date Modified Username Field Change
2015-05-17 11:12 luc New Issue
2015-05-17 11:43 madshi Note Added: 0001035
2015-05-17 11:43 madshi Assigned To => madshi
2015-05-17 11:43 madshi Status new => feedback
2015-05-17 13:42 luc Note Added: 0001036
2015-05-17 13:42 luc Status feedback => assigned
2015-05-17 14:03 madshi Note Added: 0001037
2015-05-17 14:03 madshi Status assigned => feedback
2015-05-17 15:43 luc Note Added: 0001038
2015-05-17 15:43 luc Status feedback => assigned
2015-05-17 16:17 madshi Note Added: 0001039
2015-05-17 16:17 madshi Status assigned => feedback
2015-05-17 17:19 luc Note Added: 0001040
2015-05-17 17:19 luc Status feedback => assigned
2015-05-18 11:58 madshi Note Added: 0001041
2015-05-18 19:51 luc Note Added: 0001042
2015-05-18 23:17 madshi Note Added: 0001044
2015-05-19 20:30 luc Note Added: 0001051
2015-05-19 20:49 madshi Note Added: 0001052
2015-05-20 14:24 luc Note Added: 0001053
2015-05-20 14:47 madshi Note Added: 0001054
2015-05-20 17:55 luc Note Added: 0001055
2015-05-20 18:07 madshi Note Added: 0001056
2015-05-20 18:28 luc Note Added: 0001057
2015-05-20 18:49 madshi Note Added: 0001058
2015-05-20 19:08 luc Note Added: 0001059
2015-05-20 23:36 madshi Note Added: 0001060
2015-05-21 18:43 luc Note Added: 0001061
2018-01-14 15:56 madshi Status assigned => closed
2018-01-14 15:56 madshi Resolution open => no change required