madshi bug tracker - madVR
View Issue Details
0000395madVRbugpublic2016-04-03 16:452016-04-08 18:52
windows windows 1010547
MPC HC 1.7.10
lav filter 68
lav filter 68
auto mode
all modes
0000395: memory leak with a 3D LUT
madVR is leaking or not freeing memory when a 3D LUT is used.
restart the PC
open GPU-Z. check the GPU memory usages.
use a refresh rate of 60 hz.
reset madVR to default settings.
select a 3D LUT.
enable smoothmotion.
set GPU queue to 4.
open a file and scale it to UHD.
close the media player.
the GPU ram usages should be a lot higher now. for me it's about 250 MB
i used a file with styled subtitles and i used xv subfilter.
No tags attached.
Issue History
2016-04-03 16:45huhnNew Issue
2016-04-03 16:48huhnNote Added: 0001300
2016-04-03 16:48madshiNote Added: 0001301
2016-04-03 17:50huhnNote Added: 0001302
2016-04-03 18:09madshiNote Added: 0001303
2016-04-04 02:50huhnNote Added: 0001304
2016-04-04 08:43madshiNote Added: 0001305
2016-04-04 17:55huhnNote Added: 0001306
2016-04-04 18:35madshiNote Added: 0001307
2016-04-04 19:19huhnNote Added: 0001308
2016-04-04 19:47madshiNote Added: 0001309
2016-04-04 20:05huhnNote Added: 0001310
2016-04-08 18:52huhnStatusnew => closed
2016-04-08 18:52huhnResolutionopen => fixed

2016-04-03 16:48   
i used madVR 90.17 not 90.16
2016-04-03 16:48   
If GPU RAM usage is still higher after closing the media player then madVR cannot be reponsible for that. The OS automatically cleans up all resources when a process closes down.

Or is the media player still hanging around in the task manager?
2016-04-03 17:50   
it is closed.
2016-04-03 18:09   
Then I don't see how it could be my fault.

Anyway, if you start (and stop) the media player multiple times to repeat this test, does the "leak" increase, until the GPU runs out of RAM?
2016-04-04 02:50   
no only up to 700 MB Vram usages.
2016-04-04 08:43   
Ok, thanks. Overall I don't think this is a bug in madVR. As mentioned before, even if madVR forgets to close the 3dlut (which I don't think is the case) the OS should cleanup when the media player closes. The GPU driver may delay cleanup for some unknown reason, maybe to save performance or something, but that's out of my control.
2016-04-04 17:55   
even an hour later it isn't cleaning the Vram.

if this is an OS or driver problem than there is nothing that can be done.

the only think i know was that after using madVR the GPU Vram usages gets higher.
2016-04-04 18:35   
Well, I don't know what I could do. My code looks ok to me, the 3dlut seems to be properly freed.

If you want to double check for a non-freed 3dlut: Every time you load a new video file into MPC-HC, madVR is destroyed and recreated. If madVR doesn't properly free the 3dlut, the GPU RAM consumption should steadily climb when loading multiple different video files in the media player *without* closing the media player. If that happens, madVR has a leak. If it doesn't happen, madVR doesn't seem to have a leak.
2016-04-04 19:19   
no that is clearly not happening.

it has something with scaling to do. a 3d LUT is just 100 mb how can it use up to 400 mb?

the biggest problem is for every new test i need to restart the PC i don't know another way to free the Vram.
2016-04-04 19:47   
Well, the 3dlut is RGB, but GPU textures require RGBA, so that's some percent more RAM. However, that doesn't explain the jump from 100MB to 400MB.

In any case, considering all the information I have right now, I'm pretty sure that all this behaviour is between the OS and the GPU driver, and madVR got nothing to do with it.
2016-04-04 20:05