-
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
Triangle example triggers OutOfHostMemory with gtx 1080 #627
Comments
From my experience these out of memory errors are almost always a problem of some sort with the driver, but obviously I don't know if that's the case here. |
I've got a backtrace now, if it helps:
Looks like it can't create a new fence. Is this necessarily a driver issue? I'll admit to a lack of necessary experience to really debug this, but hypothetically, could there be no reason on the driver/GPU side to block, but my memory/CPU can't keep up. (It does pin a CPU to 100%, and the process as a whole uses a bit more than 1GB of memory before bailing out... not enough to use up all my memory, but maybe enough to max out some memory pool?) Shooting in the dark, really, but maybe the backtrace will help. |
Could you add a bunch of Knowing whether it panics at the first run, second run, third run, or afterwards, would be very useful. |
On my machine the loop runs anywhere from 900-1000 iterations before the OOM occurs. Specs: |
Right now vulkano creates and destroys many fences and semaphores, which is discouraged. |
That would make sense, though it's interesting that what should be a similar number of iterations does not expose this issue if a wait is included. (I'll try to show what I mean tomorrow - too late to work at this tonight, and I need to confirm that the iteration counts get high enough with waits) Assuming that waits do fix the issue and I haven't missed something, I'd suspect that something just doesn't get cleaned up soon enough, rather than a leak. The example uses FIFO present mode, which as far as I'm aware requires every frame to get displayed. There's no way my monitor can keep up with my graphics card for something this simple - could the example just be building up a massive chain of futures? I'll test if/when I get a chance, but please let me know if I'm completely on the wrong track. |
In FIFO mode the call to The call to On my machine (and on many people's machines I presume) I can let the examples run for a very long time with no increase in memory, so I don't think there's anything leaking in vulkano itself. |
Per this reddit thread and other searching it looks like this is an Nvidia driver bug - Experimentation indicates this can be worked around by either waiting on the fence returned by Anyway, for the time being I can work around this with a queue of futures and waiting for the oldest one when I've used all images (which I believe should approximate the behaviour I'd get with a properly blocking image acquire, though it's not really ideal). It would be nice if vulkano can expose the fence for |
Thanks for the investigation!
Note that you can do that in vulkano: https://docs.rs/vulkano/0.5.2/vulkano/sync/struct.FenceSignalFuture.html#method.wait
Yes, in general I think the |
Hmm, reading again my comment was a bit unclear. I meant non-vulkano as in the wait is outside of vulkano itself, and therefore doesn't require a change to the library. It still uses the API exposed by vulkano (the method you mentioned). I'd meant to highlight the difference in location compared to the second workaround, which worked by changing code in the vulkano library. |
Same here. I experience high (100%) CPU usage on the triangle example, as well with this system: Ubuntu 16.04; Intel i7; GTX 1060 I have another small PC with Arch and intel m5 (integrated graphics), and everything is swell. On the GTX 1060, I add this snippet of code just before here, and things settle down. // <hacks>
match future.wait(Some(Duration::from_millis(100))) {
Ok(x) => x, // type unit
Err(err) => println!("err: {:?}", err), // never see this
}
// </hacks>
previous_frame_end = Box::new(future) as Box<_>; Playing with the duration passed to
|
Updating the crossbeam dependency to 0.3 seems to have fixed the leaks I was having. |
I have the same problem (after ~500 iterations) with GeForce GTX 970. It would be indeed nice to have a way to wait on the next image to be acquired at each iteration instead of building a huge pile of futures. Artificially slowing down the loop (with 50ms pause) works for me as a workaround. |
Please refer to #1247 |
I'm running on an old box with an upgraded GPU. Some details:
Arch Linux
RAM: 12GB
CPU: i7-4770
GPU: GTX 1080
With 8-9GB of memory free, the triangle example runs rampant and triggers an OutOfHostMemory error within a few seconds (which seems fast, but I don't know enough to be sure).
Waiting for the fence at line 380 appears to fix the issue, presumably by letting things finish and be cleaned up at the top of the loop.
Not sure what the right fix (if any) is for this, but it certainly seems like a bug.
The text was updated successfully, but these errors were encountered: