Bug 104346 - Crash in vkCmdPipelineBarrier on ANV vulkan driver
Summary: Crash in vkCmdPipelineBarrier on ANV vulkan driver
Status: RESOLVED NOTOURBUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Vulkan/intel (show other bugs)
Version: 17.3
Hardware: x86-64 (AMD64) Linux (All)
: high critical
Assignee: Intel 3D Bugs Mailing List
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-20 10:38 UTC by hrydgard
Modified: 2017-12-20 21:30 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Stack trace of crash (3.54 KB, text/plain)
2017-12-20 10:38 UTC, hrydgard
Details

Description hrydgard 2017-12-20 10:38:58 UTC
Created attachment 136315 [details]
Stack trace of crash

My PSP emulator PPSSPP has supported Vulkan for a while, working successfully on many GPUs on Android and Windows. Recently started implementing support for using Vulkan on Linux, which is of course just a matter of initializing it properly, and then using the same code.

Only, it appears to crash on Intel ANV: https://github.com/hrydgard/ppsspp/pull/10413#issuecomment-352527802 

The emulator manages to render the UI correctly but crashes when trying to go in-game.

It crashes directly when calling vkCmdPipelineBarrier, transitioning an image from UNDEFINED to TRANSFER_DST_OPTIMAL which should be a pretty standard operation, so it's quite strange.

I've also attached that full stack trace to this bug as an attachment. Top 2 frames are:

#0  anv_reloc_list_add (list=list@entry=0x555556d62338, alloc=<optimized out>, 
    offset=16420, target_bo=0x0, delta=0) at vulkan/anv_batch_chain.c:159
#1  0x00007fffddaf9f6c in blorp_surface_reloc (batch=0x7fffffffc860, delta=0, 
    ss_offset=<optimized out>, address=...) at vulkan/genX_blorp_exec.c:60

To reproduce, clone (recursively) ppsspp from the branch referred to in the pull request above, build, and run, on a machine with the Intel ANV vulkan driver. Free homebrew games to try can be installed from the "Homebrew & Demos" tab once the emulator is running.

Driver version in the bug report is 17.3.99.
Comment 1 Jason Ekstrand 2017-12-20 14:57:05 UTC
Blind guess based on nothing but the backtrace, but it looks like you're trying to build a command buffer to transition an image that does not yet have any memory bound to it.  The spec requires non-sparse resources to have memory bound to them *before* they are referenced by anything else.  This includes creating image views and doing blit/copy commands.
Comment 2 hrydgard 2017-12-20 15:34:26 UTC
That's a very plausible explanation - seems that's exactly what we're doing, by accident. Strange that it passes all validation layers - might need to submit a bug to the validation project so it can catch this in the future. I'm going to submit a fix, and I will close this if the problem goes away for the reporting user.

Thanks for the quick reply by the way!
Comment 3 hrydgard 2017-12-20 19:35:51 UTC
Yup, confirmed. Closing, and will go file a bug against the validation layers.
Comment 4 hrydgard 2017-12-20 21:30:50 UTC
For future reference, here is the corresponding validation layer issue:

https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/issues/2289


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.