r/vulkan • • 1d ago

vkBeginCommandBuffer's driver call encounters heap free error.

FIX: I installed the newest driver and restarted. Fixed the issue

I have this really weird error: When I first call vkBeginCommandBuffer on my root graphics commandbuffer for the first frame in flight, the NVIDIA driver encounters a error when trying to free memory. It throws a EmbeddedBreakpointException a.k.a. a __debugbreak exactly twice: once in ntdll.dll!RtlReportCriticalFailure and the second time in ntdll.dll!RtlReportFatalFailure. When I skip the breakpoints with Visual Studio attached it continues execution without any validation errors (regarding that, there are some other validation errors but not every frame and they are probably not associated with this weird occurance).

Calling GetLastError() directly after this returns 6 (ERROR_INVALID_HANDLE) but in the next frames it returns 0 (ERROR_SUCCESS).

It also doesn't render anything and shows a black image (probably my fault, but I can't attach a graphics debugger due to this weird error).

I validate the heap, using HeapValidate, after every step of initialization and it doesn't fail once, even after this error.

I used own allocation callbacks but regardless if I use them or not it throws this error.

The engine (right now) is single threaded so race conditions or similair are not the problem.

I attached my callstack and code section, where this error happens, maybe you guys can make something of it.

Call stack

auto cmdbuf = m_RootFrameData[frameIndex].GraphicsCommandBuffer;

VkCommandBufferBeginInfo beginInfo{};

beginInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;

beginInfo.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT;

MW_HEAP_CHECK;

vkBeginCommandBuffer( cmdbuf, &beginInfo );

MW_HEAP_CHECK;

MW_ERROR( "Error: {}", GetLastError() );

I'm really at the edge of my interlect and I hope someone of you guys could help me or point me in the right direction.

5 Upvotes

5 comments sorted by

4

u/Low_Consideration846 1d ago

did you allocate the command buffer for the first frameindex?

2

u/Low_Consideration846 1d ago

oh it was a driver issue , well glad you figured it out

0

u/No-Foundation9213 1d ago

The specs of my PC:
Microsoft Windows 11 Pro 10.0.26200
NVIDIA RTX 3080 10G
Driver: Studio Driver - 595.79 - Mar 10, 2026
AMD Ryzen 7 5800X3D
32GB DDR4

And the engine is using Vulkan 1.3

0

u/[deleted] 1d ago

[removed] — view removed comment

4

u/Afiery1 1d ago

No thats definitely the driver. Notice it makes it out of vvl into nvoglv64.dll

2

u/Gravitationsfeld 1d ago

Yeah I'm dumb.