-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consistent 'Out of video memory' issues #24
Comments
The Out of Memory issue is an issue on which we don't have much solution to offer except: |
I'm also getting this with Borderlands 2, crash when loading a save with the GALLIUM_HUD states that my VRAM usage is only ~1.4GB when it crashes, despite my card having 8GB of available VRAM. VRAM usage without Gallium (just wined3d) easily goes above 1.5GB as expected, though I'm wondering if this could be an engine problem rather than a Gallium one and there's somewhere in the game's configs that I can set the max allowable VRAM or something... Uninstalling the HD texture pack resolves the issue for me, and I no longer crash even with Texture Quality set to High in game options. However, as I clearly have more than enough VRAM, I feel this isn't really a solution & I should be able to use the higher res textures. CPU: Ryzen 2700X Happens with both Wine 4.2 and 3.16 Edit: Unfortunately, I get severe FPS drops with Gallium whenever I move my mouse (see Proton#2455). This is mitigated when using Proton/wined3d by turning my mouse polling rate to 500Hz instead of 1000Hz, however this does not work with Gallium and my FPS will drop by ~70-80 regardless of mouse polling rate any time I touch the mouse. |
If you can play with recompiling mesa, you can try in state_trackers/nine/device9.c to replace
with
The detected available_texture_mem should be high enough (capped to 4GB), but who knows. |
This didn't seem to help at all, still had the game crashing at the same points, maybe limiting it more would help but I didn't get to investigate it more yet. |
Can you check: https://github.com/kakra/wine-proton/blob/rebase/proton_3.16/README.md#hints-to-32-bit-users-applies-also-to-syswow64 |
I used the standard wine from archlinux, and I could play with the 4K texture pack dlc and textures set to high without issues. |
I would suggest to try installing the native d3dx9_* libs with winetricks. |
Just to be sure, did you try to get into Sanctuary? I some other areas also worked fine for but Sanctuary was always crashing (at least in BO2, didn't test The Pre Sequel). I won't be able to do any testing myself before Tuesday or so. |
No, I'm not very advanced in the game. But I had the 4K patch, textures set to high, and the menu was fine |
I did some more testing with ( |
Could you guys try if 'AMD_DEBUG=nodma' variable helps preventing going out of memory with Borderlands? |
Nope, exited immediately after getting in-game. CPU: Core i7 3770 Maybe it's doing a stupid here and mapping the utilized VRAM into its address space? |
Same Out of Video Memory problem with RE6.exe from Steam running all under wine-4.17 (Staging). Native Direct3D 9 v0.5.0.0-release is active. I can play the game without wine nine, now I am testing it with wine nine. When I receive the dialog of "Out of video memory" the game is using only 500 MB. Here are some from console:
As I can see it says "LLVM ERROR: out of memory" and I don't know why LLVM gets out of memory. Maybe it is limited to use only the real memory not the virtual. Or it is limited to allocate a fixed amount. |
Another idea, could it have something to do with windows considering previous allocations automatically freed on their overwrite, while linux drivers usually require an explicit clear (so virtual memory always builds up)? |
I have 8 GB of RAM so for me I easily end using swap specially opening a lot of tabs on Chrome plus compiling something. But as the logs show I suspect too about the compilation of shaders. As llvm is a low level virtual machine I suspect of that executing or compiling shaders. So, there are some bug in some place related to llvm. But I cannot found no one reference about llvm in the source code. So, where is using it? |
Nine compiles to TGSI (which depending on your driver may be further compiled to NIR), that's in turn compiled by LLVM to whatever the magic hardware assembly is. |
@Anyeos : You have several times the message "Encountered buggy shader". This is suspicious. Maybe the game says out of memory, but actually it's just a generic error path. If I recall correctly, the buggy shader message is when we encouter something forbiden. The shader is then not compiled and we return an error code. |
@axeldavy I just think that may be the problem. A buggy shader get out of memory, I guess. But I don't know why it is so anyway. There are a lot of situations with buggy shaders in games and they are simply ignored (think about some unsopported feature of your videocard, that does not mean you cannot actually play the game, but not with full shader support). That can produce graphics artifacts or featureless but not neccesary fill the memory. So I just suspect of LLVM doing something bad with memory. But maybe the problem is how LLVM is used and not LLVM itself. I have no time to investigate deeper for now but I will try when have the time. |
These has been some leaks with nir (radeonsi switched from tgsi to nir more than a year ago). This issue might be fixed by https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4980 |
The mentioned leak fix is part of mesa-20.1.0 |
@dhewg Edit: Cannot confirm if fixed. Issue appears to have gotten worse. Game won't start with Gallium Nine enabled. Immediate Out of video memory error. Kernel: 5.0.6 -> 5.8.5 Log is consistent across both Proton 5.0-9 and Wine-git (5.16.r53.g00a0e2cd8c-1) Here's a snippet of the terminal.
|
I do not have that version of mesa and the time to build one and test. But I think the problem is not LLVM neither Mesa, I guess there had some problem in wine-nine. There are some discussions about LLVM taking a lot of memory but it is expected behaviour if you are compiling a lot of parallel code. The fact shows that only wine-nine is failing. LLVM is working as expected on all other programs. The Mesa and open source radeon drivers are working as expected on my computer and I use it a lot (don't turn off but suspend, and I do it for weeks), I use Blender and it works as expected. I have no fails neither on Steam (native) or wine games. So, why we think that the problem is Mesa or the drivers but not wine-nine? I don't know who is developing wine-nine but I think it need more testing. I think it need an application specially designed for the sole purpose of testing. |
I can confirm having the same issue, I specifically tested Borderlands 2 with the HD Texture Pack installed and all the visuals cranked up to 11. I'm using an AMD RX 5700 gfx card with 8 gb of ram. Kernel: 5.10.7 |
https://github.com/iXit/Mesa-3D experimental patches reduce issues with high RAM usage (enables to allocate more than 4GB with 32 bits apps). This might help. EDIT: I also just added a patch that should enable to use more than 4GB of vram, and it is possible previous code had overflow issues with 4GB cards in a function a few apps use to retrieve memory availability. |
Overflowing is kind-of the expected behaviour tbh as far as I can tell (in GTA 4 for example, this seems to happen already over 2GB) But is this shared memory magic to be considered a fix, or just a workaround for the driver still leaking? |
There's three memory issues: |
Lol, this sounds like the wet dream @starkgate has been pursuing since years, exactly with that game. Anyhow, you can read some stuff here I collected during the years about VRAM limits. |
If you try out our Ixit/Mesa-3D, it should have all three issues I mentioned in my last post fixed. I plan to submit the patches very soon to main mesa (except for the shader cache one which deserves more work). |
@axeldavy Do you have a link to a prs? I would like to test them on top of mesa-git. EDIT: OK looking inside the commit history of nine shows your commits, thanks for your work. |
The patches are already merged in mesa-git. There is an additionnal unmerged one that will be sent in a different form that helps especially when the CPU has a lot of cores: iXit/Mesa-3D@0a7e69e |
I read your comment about that in: How can I check the game use software rendering? I remember some games like Warhammer online (which I play) need software vertex blending implementation (https://bugs.winehq.org/show_bug.cgi?id=6955). |
That sounds like it could help when using a threadripper with 32 cores. |
llvmpipe is only used if game uses software rendering for EVERYTHING or if it uses the ProcessVertices function (The Sims2, but basically almost nothing else). In addition if llvmpipe is not available, the hardware is used as fallback. So you are fully safe disabling it. |
Why does it create issues even if the games does not use software rendering? |
Because we just initialize llvmpipe. Apparently that's enough... |
Seams better now my games only crashes very late at 1556MB of RAM instead of
much earlier.
|
I noticed that I get memory corruption now when reaching around 1550-1650MB
RAM usage by the game I run.
Message are something like:
```
Corrupted size vs. prev_size
double free or corruption (fasttop)
07f0:fixme:crypt:SystemFunction041 (06B7624C, 10, 0): stub [RtlDecryptMemory]
07f0:fixme:crypt:SystemFunction040 (06B7624C, 10, 0): stub [RtlEncryptMemory]
0344:fixme:exec:SHELL_execute flags ignored: 0x00000100
012c:fixme:heap:RtlSetHeapInformation 01190000 0 0118FE28 4 stub
012c:err:virtual:try_map_free_area mmap() error Nicht genügend Hauptspeicher
verfügbar, range 0xfcff0000-0x1cff0000, unix_prot 0x3.
```
Note the lines without an address or fixme are probably from nine.
|
I don't think these error messages are from nine. If you relaunch the game, do you get the same error at the same point ? I've had a similar issue with a game due to probable multithreading race issue in llvm radeonsi shader compilation. I've made a merge request with the last improvements: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160 |
Using Wine 4.2 (Proton 4.2-2) with the latest Gallium Nine Standalone installed using winetricks. The games Borderlands 2 and Borderlands Pre-Sequel consistently crash while Gallium Nine is enabled in two specific places, depending on whether or not the 4K texture pack is enabled. If the texture pack isn't enabled both games will crash with an 'Out of video memory' error when loading into a level. If the texture pack is enabled, it will crash right as the main menu loads.
CPU: Ryzen 7 1700X
GPU: Vega 64 8GB
RAM: 24GB
OS: Arch Linux
Kernel: 5.0.6
Mesa: 19.0.1-1
LLVM: 8
Note: Using the environment variable
PROTON_FORCE_LARGE_ADDRESS_AWARE=1
delays the issue for 1-3 minutes without the texture pack. Crashing still occurs.steam-261640.log
The text was updated successfully, but these errors were encountered: