-
Notifications
You must be signed in to change notification settings - Fork 437
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
PushConstants causes ram usage to increase every command buffer #1118
Comments
I cant reproduce on Linux + Nvidia GTX 960, Linux + AMD or Windows + AMD. Could you possibly be encountering #923 ? |
tldr: future.wait(None).unwrap() with push constants enhances the issues with push_constantsI thought "future.wait(None).unwrap()" was in examples by default for some reason xD I first experienced this in my own project, which does incorporate future.wait(None).unwrap() work around, as i needed it long time ago vulkano 0.7.0 or something. Once i remove the push constants it stops leaking (in my project). Ok so far trial and error with triangle and project it seems the combination of
On both tests (push constants with future.wait and just push constants) ram usage starts at approximately 20.3mb Push Constants + future.wait(None).unwrap()Causes it to leak substantially (5gb in 4min, 20mb/s) As can be seen after approximately 4min it was still running and had taken up 4GB of ram memory. Push ConstantsHowever without the future.wait(None).unwrap() Another note when i had a look at the memory maps, there was a singular anonymous mapped region that had a VM size of 6gb. Don't have access to other computers to test currently. Edit: Same across PresentModes Immediate, Fifo and Relaxed (Mailbox not supported) so i don't think its related directly to #923 Edit 2: I just tested on my desktop with fresh install of Ubuntu 18.10 GTX 770, I didn't see any leak with push constants alone with the modified triangle, but when it was run with future.wait(None).unwrap() the issue was present. |
I was testing with |
After further testing, and thought I do believe it is part of issue #923 but because my laptop has the Nvidia optimus technology that forces Nvidia to go through the Intel gpu, vulkan believes its using the INTEL-MESA driver, but then picks the GTX770 card for vulkan rendering (only one available with the optimus workaround), so that the memory checks don't apply correctly, thus leading no Oom errors etc. Output at launch:
future.wait(None).unwrap(), does fix the issue when no pushconstants are used. Although I do still get a memory leak on my desktop when using both (future.wait(None).unwrap() + PushConstants), where it just uses the standard Nvidia setup provided by Ubuntu 18.10. I can test later tonight if removing future.wait(None).unwrap(), with the push constants on my desktop still causes the leak. |
I'm also running into host memory leaks (~1mb/s) on my GTX 1070 (notably no Optimus) using only a storage
Using Edit: I replaced the push constants with |
I also found that the |
also running into this issue on windows 10 with nvidia rtx 2070 mobile. (intel gpu doesnt leak tho) i tried to play with runtime-shader example with the push constant added into vertex shader same as above and got some results
not sure whether this is a nvidia driver bug but i think we need some workarounds as currently push constants is just unusable.. edit: confirmed changing this solved the issue on triangle example for me, but then compute shaders are just broken...
|
Tried to reproduce on Windows 10 with NV 1080 Ti (driver 527.56), added push constants as illustrated by Owlkaline@20c7fb0 (using 10d7349) , but can not observe a memory leak. |
Using a very slightly modified version of triangle example from latest repo (and vulkano 0.10.0 and 0.11.0). Cause ram usage to seemingly infinity increase ram usage.
By pushing a simple identity matrix into the vs shader as a pushconstant
Owlkaline@20c7fb0
This has happened on all computers i have been able to test (Both debug and release modes)
Ubuntu 18.10 GTX 950m Nvidia Driver 387.92 and 290.87
Ubuntu 18.10 GTX 770oc Nvidia Drive 390
Windows 10 AMD R280
It will fill the ram until system freezes/crashes from running out of ram (Tested up to 12GB).
That is if that my understanding on how to use push_constants should be used, that they are similar to uniform but are allocated every commandbuffer so is good for data that will change every frame such as a transformation matrix and that you are limited to (~128 bytes, approx 32 floats) but has much faster transfer rate than an ordinary uniform buffer.
Thus leading me to believe that the increase in ram usage is unintended.
The validation layers under release spam this output
The text was updated successfully, but these errors were encountered: