Skip to content

VkVideoEncoder: clean the deinit when the encode codec extension is not supported by the driver#218

Open
dabrain34 wants to merge 1 commit into
KhronosGroup:mainfrom
dabrain34:dab_check_code_supported
Open

VkVideoEncoder: clean the deinit when the encode codec extension is not supported by the driver#218
dabrain34 wants to merge 1 commit into
KhronosGroup:mainfrom
dabrain34:dab_check_code_supported

Conversation

@dabrain34

@dabrain34 dabrain34 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Description

As h26x codec might be not supported by the driver, CreateVideoEncoder already returns a correct error result with a not supported status but fails to exit properly as the deInit runs into an assert due to a non existing queue.

Indeed with a driver not supporting h265 encode queue for example, the encode tests are failing and do not report/exit properly when detecting the missing queue. On deinit of the video encoder, there is an assert such as:

$ ./tests/vvs_test_runner.py -t encode_h265_default

...

*** The video codec encode h.265 is not supported! ***
STDERR:
     
ERROR: InitEncoder() failed with ret(-1000023004)
vk-video-enc-test: /home/scerveau/DEV/IGALIA/PROJECTS/VALVE/DEV/Vulkan-Video-Samples/common/libs/VkCodecUtils/VulkanDeviceContext.h:138: VulkanDeviceContext::MtQueueMutex::MtQueueMutex(const VulkanDeviceContext*, VulkanDeviceContext::QueueFamilySubmitType, int32_t): Assertion `(queueIndex >= 0) && (queueIndex < devCtx->m_videoEncodeNumQueues)' failed.

To avoid this issue, MultiThreadedQueueWaitIdle should retrieve a null queue seen that no queue has been initialized.

Type of change

bug fix

Issue (optional)

Tests

Intel(R) Iris(R) Xe Graphics (ADL GT2) / Intel open-source Mesa driver Mesa 26.2.0-devel (git-2b62ef1a3e) / Ubuntu 24.04.4 LTS

Total Tests: 83
Passed: 57
Crashed: 0
Failed: 0
Not Supported: 23
Skipped: 3 (in skip list)
Success Rate: 100.0%

Additional Details (optional)

@dabrain34 dabrain34 force-pushed the dab_check_code_supported branch 2 times, most recently from 45a628a to 01ca36a Compare June 30, 2026 16:38
When the encoder does not find an available queue for
the given codec, the encoder init exits and deinit the encoder
calling MultiThreadedQueueWaitIdle. But in that method it requires
to get the given queue (0) which failed to init.
Validate first that there is an existing queue before trying
to retrieve it.
@dabrain34 dabrain34 force-pushed the dab_check_code_supported branch from 01ca36a to 0939368 Compare July 1, 2026 09:08
@dabrain34 dabrain34 changed the title VkVideoEncoder: validate that the codec is supported VkVideoEncoder: clean the deinit when the encode codec extension is not supported by the driver Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant