acomminos / wine-pba

Patches to add a persistent buffer allocator for faster dynamic geometry in Direct3D games.
GNU Lesser General Public License v2.1
138 stars 6 forks source link

High Virtual Memory Use (32bit apps) #35

Open mrdeathjr28 opened 6 years ago

mrdeathjr28 commented 6 years ago

After test various titles virtual memory on pba is more higher than vanilla

2.0gb in vanilla with/without csmt

2.6-2.7gb in vanilla + pba with/without csmt

Remember Me

Vanilla

https://i.imgur.com/aRwgKWr.jpg

Vanilla + CSMT

https://i.imgur.com/5igjxZt.jpg

Vanilla + PBA

https://i.imgur.com/KOCIo7Y.jpg

Vanilla + PBA + CSMT

https://i.imgur.com/KjnLJq6.jpg

This situation can be detonate various games crashing for 4096mb limit case: assasins creed 1, mass effect, farcry 2, farcry 3, test drive unlimited 2 and others

ghost commented 6 years ago

yeah, that will be the 512 + 128 + (( VRam / 4 ))

GloriousEggroll commented 6 years ago

looks like path of exile is also having this problem with 32 bit dx9. port to the crystal vein then going to kaom's dream results in a crash. non-pba staging loads fine. launching the game with --noasync fixes the crash.

Saroufim commented 6 years ago

Path of Exile is performing worse with pba. All in all, Path of Exile has been playing less and less nicely with wine in general.

jrugia commented 6 years ago

I don't see this issue being resolved any time soon. The problem is present for many years, it seems to come with the way Wine and graphics interact with each other, the higher the graphic detail the faster virtual memory fills up. Probably the reason why PBA triggers this much sooner is because of the improved performance.

The only high graphic game I know that doesn't do it is Crysis, the 32bit version keeps it's cool with 2.1GB even when you're blowing maximum details.

Regarding Path of Exile: Afaik, the game plays fine with the 32bit client and normal Wine with just CSMT on and easily hits 100fps+. The last time I played took me like 3 hours marathon before the virtual memory hit 4GB.

acomminos commented 6 years ago

This should be reduced significantly in 87307b1b9093c769d21d0803bb122b9866bb887c by properly unmapping the buffer if multiple libs load the PBA.

mirh commented 6 years ago

The problem is present for many years, it seems to come with the way Wine and graphics interact with each other, the higher the graphic detail the faster virtual memory fills up.

I saw this (badly titled) ticket about it the other day.

mrdeathjr28 commented 6 years ago

Tested with wine 3.4 and virtual memory remains similar

Remember me still show 2.6gb and other games with 3.5gb crash case mass effect 1 + mods, test drive unlimited 2 + mods and others

Thaodan commented 6 years ago

For anno 1404 (which is already bad cause of the memory issue), it makes it outright crash after loading a game. debug.log

ghost commented 6 years ago

How much video ram do you have @Thaodan ? PBA failed to create the buffer heaps, but it should fail back to none PBA. Does anno 1404 work 'ok' with wine-staging or wine ( i.e. none PBA )?

have you tried pba with my envvar patch? https://github.com/Firerat/wine-pba/ you will only need to apply the patches/0010-wined3d-knobs-and-switches.patch over existing PBA code

It will try to use PBA with low vram ( I created it for my laptop )

Thaodan commented 6 years ago

How much video ram do you have @Thaodan ? About 11gb

Does anno 1404 work 'ok' with wine-staging or wine ( i.e. none PBA )? Yes but it crashes after a few hours.

ghost commented 6 years ago

well, in that case I have no idea why PBA would fail to create the heaps

maybe the game consumes most of the 32bit address space, and when pba tries to address more it is exhausted. you could reduce the heap sizes, but it would still crash eventually and probably sooner

ghost commented 6 years ago

I checked game specs, very low seems a demo is available , so I might look at that

ghost commented 6 years ago

meh, apparently demo is garbage https://appdb.winehq.org/objectManager.php?sClass=application&iId=9887 but, have you set d3d to 9 explicitly in Engine.ini ?

Thaodan commented 6 years ago

meh, apparently demo is garbage The test is very old, I think it should work.

https://appdb.winehq.org/objectManager.php?sClass=application&iId=9887 but, have you set d3d to 9 explicitly in Engine.ini ? Yes I have.

ghost commented 6 years ago

ok @Thaodan So with a 32bit prefix winetricks directx9 WINEARCH=win32 __PBA_GEO_HEAP=128 __PBA_CB_HEAP=32 wine ./Addon.exe

it seems to behave as well as setting dx9 in Engine.ini also consider changing quality to 0 ( i.e. low ) That should give you more time I can get it to crash sooner by setting higher HEAPs and setting highest quality, and it does seem to be when the virt mem use goes beyond 4gb ( the 32bit address space barrier )

another option is to disable PBA with PBA_DISABLE=1 but that seems stutter a little You will need my Knobs_and_switches patch ( just 0010 over existing pba ) for the HEAP knobs PBA_DISABLE is part of vanilla PBA

btw, geo 256 cb 64 also works, just play around with those numbers for ref 512/128 is current PBA defaults

Thaodan commented 6 years ago

another option is to disable PBA with PBA_DISABLE=1 but that seems stutter a little That helped.

A little OT but how does windows avoid these issues?

mirh commented 6 years ago

As I linked, this is probably a bug with upstream... (that pba may particularly trigger, but that's outside the point)

edit: uh, and ffs, comparisons with windows are completely IT in wine

Thaodan commented 6 years ago

IT? I just asked how windows prevents this. These issues are far more common in wine.

mirh commented 6 years ago

In-topic. And of course, if somebody knew what's there in windows wine is doing differently that makes heap fly down, the problem would have been fixed.