I just tried my Vulkan program on a different computer and my display completely freezes until I reboot (using the power button) when I attempt to resize the window. This only happens on Linux, and doesn't happen on AMD. The same code works perfectly fine on my other machine, also using NVIDIA and Linux. Also works fine on the same machine on Windows. No validation errors.
#GPU driver crash(?) on swapchain recreation
28 messages · Page 1 of 1 (latest)
Resize code:
fn resize(&mut self) {
unsafe {
self.swapchain_info
.loader
.destroy_swapchain(self.swapchain_info.swapchain, None)
};
for view in &self.swapchain_info.swapchain_views {
unsafe { self.device_info.device.destroy_image_view(*view, None) }
}
self.swapchain_info = create_swapchain(
self.device_info.clone(),
self.surface_info.clone(),
&self.instance,
);
for framebuffer in &self.framebuffers {
unsafe {
self.device_info
.device
.destroy_framebuffer(*framebuffer, None)
}
}
self.framebuffers = create_framebuffers(
self.swapchain_info.clone(),
self.pipeline_info.clone(),
&self.device_info.device,
);
}
Same driver version on both machines
I think it might be a similar issue to https://discord.com/channels/427551838099996672/1070995886764720199
What are you using for windowing (glfw or another framework or hand rolled. If hand rolled which API)
You're destroying the swapchain before creating the new one, not passing it as oldSwapchain. That's going to waste a lot of time destroying and recreating buffers internally instead of reusing them.
And of course, have you enabled validation and sync validation. (As this hard crashes, it might be hard to get the output. Redirect to a file and hope it syncs to disk before you power off)
I am using Winit
I tried redirecting to a file and there's no errors or anything. I have validation enabled, I don't know what sync validation is.
Also the crash does not happen if I disable the AMD GPU, however it happens when I have the AMD GPU enabled but use the NVIDIA one
I tried passing as oldSwapchain before but something didn't work, don't exactly remember. I will try again
You have an AMD and an nVidia gpu in the same system?!
That's a really weird combo. Wow
It's normally amd+amd or intel+nvidia when I've seen dual graphics setups
Yeah it is kinda strange tbh
Sync validation is an additional validation option you can enable. It's off by default.
I find it easiest to use the vconfig tool. For enabling both normal validation and the additional features (sync, gpu assist, shader printf)
Thanks
Using oldSwapchain fixed the crash, thanks