#GPU driver crash(?) on swapchain recreation

28 messages · Page 1 of 1 (latest)

opal talon
#

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.

#

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

ashen current
#

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)

opal talon
#

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

ashen current
#

You have an AMD and an nVidia gpu in the same system?!

opal talon
#

Yes

#

It's a laptop

#

Integrated AMD

#

It's not discrete

ashen current
#

That's a really weird combo. Wow

#

It's normally amd+amd or intel+nvidia when I've seen dual graphics setups

opal talon
#

Yeah it is kinda strange tbh

ashen current
#

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)

opal talon
#

Thanks

ashen current
#

vkconfig*

#

typo

opal talon
#

Using oldSwapchain fixed the crash, thanks

opal talon
#

nvm it still happens but more rarely

#

but I don't think the issue is in my code

#

It crashes even when resizing vkcube

#

Probably some dumb driver bug