-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Is there an existing issue for this?
- I have searched the existing issues
- I have read the guide to filing a bug
Steps to reproduce
I am receiving a validation error with my custom embedder that uses vulkan. I think this happens when flutter loads image content to a texture though I am not sure.
Expected results
vkQueueSubmit must only be called on the rendering thread (which is the application main thread in my case)
Actual results
vkQueueSubmit is sometimes called from the IO thread which is not controlled by the embedder.
Validation Error: [ UNASSIGNED-Threading-MultipleThreads ] Object 0: handle = 0x1b322e39ac0, type = VK_OBJECT_TYPE_QUEUE; | MessageID = 0x141cb623 | THREADING
ERROR : vkQueueSubmit(): object of type VkQueue is simultaneously used in thread 55012 and thread 48720
Code sample
The relevant code is in the flutter engine, here is the callstack:
ultra.api.dll!ultra::vulkan::DebugMessengerCallback(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, unsigned int __formal, const VkDebugUtilsMessengerCallbackDataEXT * pCallbackData, void * __formal) Line 52 C++
VkLayer_khronos_validation.dll!debug_log_msg(const _debug_report_data * debug_data, unsigned int msg_flags, const LogObjectList & objects, const char * message, const char * text_vuid, const char *) Line 209 C++
VkLayer_khronos_validation.dll!LogMsg(const _debug_report_data * debug_data, unsigned int msg_flags, const LogObjectList & objects, const std::string & vuid_text, const char * format, char * argptr) Line 445 C++
VkLayer_khronos_validation.dll!ValidationObject::LogError(const LogObjectList & objlist, const std::string & vuid_text, const char * format, ...) Line 4045 C++
VkLayer_khronos_validation.dll!counter<VkQueue_T *>::StartWrite(VkQueue_T * object, const char * api_name) Line 172 C++
[Inline Frame] VkLayer_khronos_validation.dll!ThreadSafety::StartWriteObject(VkQueue_T *) Line 477 C++
VkLayer_khronos_validation.dll!ThreadSafety::PreCallRecordQueueSubmit(VkQueue_T * queue, unsigned int submitCount, const VkSubmitInfo * pSubmits, VkFence_T * fence) Line 961 C++
VkLayer_khronos_validation.dll!vulkan_layer_chassis::QueueSubmit(VkQueue_T * queue, unsigned int submitCount, const VkSubmitInfo * pSubmits, VkFence_T * fence) Line 1139 C++
flutter_engine.dll!submit_to_queue(GrVkGpu * gpu, VkQueue_T * queue, VkFence_T * fence, unsigned int waitCount, VkSemaphore_T * const * waitSemaphores, const unsigned int * waitStages, unsigned int commandBufferCount, VkCommandBuffer_T * const * commandBuffers, unsigned int signalCount, VkSemaphore_T * const * signalSemaphores, skgpu::Protected protectedContext) Line 561 C++
flutter_engine.dll!GrVkPrimaryCommandBuffer::submitToQueue(GrVkGpu * gpu, VkQueue_T * queue, skia_private::TArray<GrVkSemaphore::Resource *,1> & signalSemaphores, skia_private::TArray<GrVkSemaphore::Resource *,1> & waitSemaphores) Line 597 C++
flutter_engine.dll!GrVkGpu::submitCommandBuffer(GrVkGpu::SyncQueue sync) Line 411 C++
flutter_engine.dll!GrGpu::submitToGpu(bool syncCpu) Line 760 C++
flutter_engine.dll!GrVkGpu::prepareTextureForCrossContextUsage(GrTexture * texture) Line 2769 C++
flutter_engine.dll!SkImages::CrossContextTextureFromPixmap(GrDirectContext * dContext, const SkPixmap & originalPixmap, bool buildMips, bool limitToMaxTextureSize) Line 418 C++
[External Code]
[Inline Frame] flutter_engine.dll!std::_Func_class<void>::operator()() Line 874 C++
flutter_engine.dll!fml::SyncSwitch::Execute(const fml::SyncSwitch::Handlers & handlers) Line 27 C++
[External Code]
[Inline Frame] flutter_engine.dll!std::_Func_class<void>::operator()() Line 874 C++
> flutter_engine.dll!fml::MessageLoopImpl::FlushTasks(fml::FlushType type) Line 127 C++
flutter_engine.dll!fml::MessageLoopWin::Run() Line 39 C++
flutter_engine.dll!fml::MessageLoopImpl::DoRun() Line 94 C++
[External Code]
flutter_engine.dll!thread_start<unsigned int (__cdecl*)(void *),1>(void * const parameter) Line 97 C++
[External Code]
Screenshots or Video
Logs
Logs
[Paste your logs here]Flutter Doctor output
$ flutter doctor -v
[!] Flutter (Channel [user-branch], 3.12.0-11.0.pre.11, on Microsoft Windows [Version 10.0.19045.3324], locale en-IL)
! Flutter version 3.12.0-11.0.pre.11 on channel [user-branch] at C:\libs\flutter
Currently on an unknown channel. Run flutter channel to switch to an official channel.
If that doesn't fix the issue, reinstall Flutter by following instructions at
https://flutter.dev/docs/get-started/install.
! Upstream repository unknown source is not a standard remote.
Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
• Framework revision 176f7e6 (2 months ago), 2023-06-25 00:00:25 -0400
• Engine revision 100f6fc854
• Dart version 3.1.0 (build 3.1.0-246.0.dev)
• DevTools version 2.24.0
• If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly
to perform update checks and upgrades.
[✓] Windows Version (Installed version of Windows is version 10 or higher)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
flutter config --android-sdk to update to that location.
[✓] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[✓] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.5.1)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.5.33424.131
• Windows 10 SDK version 10.0.22000.0
[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
[✓] VS Code, 64-bit edition (version 1.81.1)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 3.58.0
[✓] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19045.3324]
• Chrome (web) • chrome • web-javascript • Google Chrome 114.0.5735.199
• Edge (web) • edge • web-javascript • Microsoft Edge 115.0.1901.203
[✓] Network resources
• All expected network resources are available.
! Doctor found issues in 3 categories.
