-
Notifications
You must be signed in to change notification settings - Fork 422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Frequent MVKCmdWaitEvents crashes #2319
Comments
The second validation error I mentioned,
occurs when diff --git a/MoltenVK/MoltenVK/Commands/MVKMTLResourceBindings.h b/MoltenVK/MoltenVK/Commands/MVKMTLResourceBindings.h
index 97ddf4ac..942b393b 100644
--- a/MoltenVK/MoltenVK/Commands/MVKMTLResourceBindings.h
+++ b/MoltenVK/MoltenVK/Commands/MVKMTLResourceBindings.h
@@ -89,7 +89,7 @@ typedef struct MVKMTLBufferBinding {
} else if (offset != other.offset || stride != other.stride) {
offset = other.offset;
stride = other.stride;
- justOffset = !isOverridden && (!isDirty || justOffset);
+ justOffset = false; //!isOverridden && (!isDirty || justOffset);
isOverridden = false;
isDirty = true;
} Obviously not the right solution, but maybe someone can figure out why Still digging into the first validation error, but it's harder to hit in debug builds. |
For the diff --git a/MoltenVK/MoltenVK/Commands/MVKCmdPipeline.mm b/MoltenVK/MoltenVK/Commands/MVKCmdPipeline.mm
index 697cca24..d750dcd6 100644
--- a/MoltenVK/MoltenVK/Commands/MVKCmdPipeline.mm
+++ b/MoltenVK/MoltenVK/Commands/MVKCmdPipeline.mm
@@ -617,6 +617,7 @@ VkResult MVKCmdWaitEvents<N>::setContent(MVKCommandBuffer* cmdBuff,
template <size_t N>
void MVKCmdWaitEvents<N>::encode(MVKCommandEncoder* cmdEncoder) {
+ cmdEncoder->endCurrentMetalEncoding();
for (MVKEvent* mvkEvt : _mvkEvents) {
mvkEvt->encodeWait(cmdEncoder->_mtlCmdBuffer);
} |
@billhollings Instead of fixing the links, here's some stack traces: M2 Ultra:
M3 Max:
Basically the previous encoder must be ended before an |
This is happening on an Apple M3 Max with MoltenVK rev dad3851, ANGLE rev d51c251604, macOS 15.0 Beta (24A5320a), Xcode 16.0 beta 6 (16A5230g).
A few different crashes happening in MVKCmdWaitEvents due to a null pointer dereference somewhere, somehow:
https://sentry.uplinklabs.net/share/issue/23d442788de24281a469520d0007b504/
https://sentry.uplinklabs.net/share/issue/6c38cdefc0994c4dbb83bcc3d1d9bb22/
https://sentry.uplinklabs.net/share/issue/3d30f207a90340a18b2ac9c771be4c48/
Also happens on an earlier game build with the same MVK revision on an Apple M2 Max:
https://sentry.uplinklabs.net/share/issue/791bf76a3dc64c93a90aa7e219d57c39/
(In the above stack traces click the "Show N more frames" link to see where it died within MVK.)
It seems pretty easy to repro, it happens on game startup. I'd be happy to share a game binary for developers to debug the issue, but I would need to share the build privately. The game demo builds which I could share publicly do not have the "bootloaders" which retail/debug builds have and are triggering the issue.
Running with
MTL_DEBUG_LAYER=1
in environment yields one of these two crashes:This didn't happen around a month ago when I last built MoltenVK + ANGLE. Not sure where the blame lies exactly but it has been stable on other platforms using ANGLE's Vulkan backend, so I suspect it's MVK breaking in some way.
The text was updated successfully, but these errors were encountered: