cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

ashalah
Adept I

vkQueuePresentKHR() randomly returning VK_ERROR_INITIALIZATION_FAILED

I have a very simple Vulkan app that just clears the screen, it basically follows the samples, but on the current driver (Version 16.15.1009 Beta 5), and not on the previous version, when I run my app, vkQueuePresentKHR() randomly (10% of the time) returns VK_ERROR_INITIALIZATION_FAILED on the 2nd rendered frame. The value of VkPresentInfoKHR::pResults is unchanged by the call. (it should be written to)

I'm using semaphores to synchronize between vkAcquireNextImageKHR and my command buffer, and another semaphore between my command buffer and vkQueuePresentKHR. My code is attached. I've consulted the spec, and multiple samples, and have run out of ideas to try, so I'm reporting here in case this is a driver problem.

/edit: The validation layers report nothing.

OS: Win7 64bit

Visual Studio 2015

Building 64bit binary

0 Likes
1 Solution

The issue has been addressed. Once a new driver build is released to the public, I would appreciate if you could spend a minute and check if the problem continues to persist.

View solution in original post

0 Likes
11 Replies
ashalah
Adept I

Actually, the value pointed to by pResults is never written to even if there is no error/crash. The following code demonstrates:

VkResult presentResult = (VkResult)0xABABABABu;

VkPresentInfoKHR presentInfo = {};

presentInfo.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR;

presentInfo.pNext = nullptr;

presentInfo.waitSemaphoreCount = 1;

presentInfo.pWaitSemaphores = &renderingCompleteSemaphore;

presentInfo.swapchainCount = 1;

presentInfo.pSwapchains = &swapchain;

presentInfo.pImageIndices = &currentBufferIdx;

presentInfo.pResults = &presentResult;

res = vkQueuePresentKHR(graphicsQueue, &presentInfo);

When vkQueuePresentKHR returns, even if it succeeds and rendering is normal, presentResult still contains the debug value of 0xABABABAB, so it's not being written to. The spec says vkQueuePresentKHR should write a proper value here.

0 Likes
ashalah
Adept I

I've closely followed cube.c in the 1.0.5.0 LunarG SDK, and found that the reason I get the error I mentioned in the original post is because I am using VK_PRESENT_MODE_FIFO_KHR, unlike the cube.c sample. If I switch to VK_PRESENT_MODE_IMMEDIATE_KHR like the sample, that error never appears. My code is now nearly identical to the sample.

Sure enough, if I change the SDK sample to force it to use VK_PRESENT_MODE_FIFO_KHR, the sample now also runs into the same problem as I do in my original post.

Here is my updated code, and two executables. One that prefers to use VK_PRESENT_MODE_IMMEDIATE_KHR if it is available, and one that prefers VK_PRESENT_MODE_FIFO_KHR if it is available.

The error always appears on the second frame, sometimes when using the FIFO version, but never when using the IMMEDIATE version.

Given this, and the VK_PRESENT_MODE_FIFO_KHR bug in the previous beta driver version I reported, I'm guessing this is also a driver bug

/edit: I'm using an HD7770. Any other details please ask.

0 Likes
ashalah
Adept I

I've retested with the public 16.3.1 driver on two machines, with the same LunarG Vulkan SDK 1.0.5.0:

HD7770, Windows 7 64bit: Issue persists.

A6-6310 with R4 graphics, Windows 10 64bit: no issue, but presentResult remains un-written to as described above.

0 Likes

Thanks for reporting this. I'm going to have a try at reproducing this issue locally and will get back to you.

0 Likes

I can confirm that the presentResult bug has been recently fixed, so the issue should no longer be reproducible, starting with the next driver release.

As for the FIFO issue, we will need more time to investigate it.

0 Likes

Regarding the FIFO issue, can you please try doing the following:

1. Use the DDU device driver uninstaller to remove the currently installed driver.
2. Reinstall the latest public beta driver available (AMD Radeon™ Software Beta for Vulkan™ Release Notes )
3. Attempt to reproduce the problem you're seeing on HD 7770.

Thanks.

0 Likes

Followed the steps (using DDU in safe mode), but could still reproduce the issue.

0 Likes

Thank you for the report, I can confirm we can reproduce this issue internally and will be working on a fix.

The issue has been addressed. Once a new driver build is released to the public, I would appreciate if you could spend a minute and check if the problem continues to persist.

0 Likes

That's great news! No worries, I'll report back once a new driver is available.

0 Likes

I've tested with the Apr19 driver, and can no longer reproduce either issue. Cheers!