System.AccessViolationException when reloading `TestSceneTextureUploadPerformance` on vulkan
Susko3 opened this issue · 1 comments
Renderer: Deferred / Vulkan, Windows 11, AMD gpu. The crash only happens on my PC and not my laptop.
Having TestSceneTextureUploadPerformance
open will consistently allocate 10 MB of memory (active private working set).
GPU memory usage doesn't seem to go up.
Pressing Ctrl-R to reload the test scene will consistently hard crash with AccessViolationException
:
Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at Veldrid.Vk.VkTexture..ctor(Veldrid.Vk.VkGraphicsDevice, Veldrid.TextureDescription ByRef)
at Veldrid.ResourceFactory.CreateTexture(Veldrid.TextureDescription ByRef)
at osu.Framework.Graphics.Veldrid.Textures.VeldridTexture.DoUpload(osu.Framework.Graphics.Textures.ITextureUpload)
at osu.Framework.Graphics.Veldrid.Textures.VeldridTexture.Upload()
at osu.Framework.Graphics.Rendering.Renderer.BindTexture(osu.Framework.Graphics.Textures.Texture, Int32, System.Nullable`1<osu.Framework.Graphics.Textures.WrapMode>, System.Nullable`1<osu.Framework.Graphics.Textures.WrapMode>)
at osu.Framework.Graphics.Rendering.RendererExtensions.DrawQuad(osu.Framework.Graphics.Rendering.IRenderer, osu.Framework.Graphics.Textures.Texture, osu.Framework.Graphics.Primitives.Quad, osu.Framework.Graphics.Colour.ColourInfo, System.Nullable`1<osu.Framework.Graphics.Primitives.RectangleF>, System.Action`1<osu.Framework.Graphics.Rendering.Vertices.TexturedVertex2D>, System.Nullable`1<osuTK.Vector2>, System.Nullable`1<osuTK.Vector2>, System.Nullable`1<osu.Framework.Graphics.Primitives.RectangleF>)
at osu.Framework.Graphics.Sprites.SpriteDrawNode.Blit(osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.Sprites.SpriteDrawNode.Draw(osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.DrawNode.DrawOther(osu.Framework.Graphics.DrawNode, osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.Containers.CompositeDrawable+CompositeDrawableDrawNode.Draw(osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.DrawNode.DrawOther(osu.Framework.Graphics.DrawNode, osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.Containers.CompositeDrawable+CompositeDrawableDrawNode.Draw(osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.DrawNode.DrawOther(osu.Framework.Graphics.DrawNode, osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.Containers.CompositeDrawable+CompositeDrawableDrawNode.Draw(osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.DrawNode.DrawOther(osu.Framework.Graphics.DrawNode, osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.BufferedDrawNode.Draw(osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.DrawNode.DrawOther(osu.Framework.Graphics.DrawNode, osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.Containers.CompositeDrawable+CompositeDrawableDrawNode.Draw(osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.DrawNode.DrawOther(osu.Framework.Graphics.DrawNode, osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.Containers.CompositeDrawable+CompositeDrawableDrawNode.Draw(osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.DrawNode.DrawOther(osu.Framework.Graphics.DrawNode, osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.Containers.CompositeDrawable+CompositeDrawableDrawNode.Draw(osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.DrawNode.DrawOther(osu.Framework.Graphics.DrawNode, osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.Containers.CompositeDrawable+CompositeDrawableDrawNode.Draw(osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.DrawNode.DrawOther(osu.Framework.Graphics.DrawNode, osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.Containers.CompositeDrawable+CompositeDrawableDrawNode.Draw(osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.DrawNode.DrawOther(osu.Framework.Graphics.DrawNode, osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.Containers.CompositeDrawable+CompositeDrawableDrawNode.Draw(osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.DrawNode.DrawOther(osu.Framework.Graphics.DrawNode, osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.Containers.CompositeDrawable+CompositeDrawableDrawNode.Draw(osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.DrawNode.DrawOther(osu.Framework.Graphics.DrawNode, osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.Containers.CompositeDrawable+CompositeDrawableDrawNode.Draw(osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.DrawNode.DrawOther(osu.Framework.Graphics.DrawNode, osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.Containers.CompositeDrawable+CompositeDrawableDrawNode.Draw(osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.DrawNode.DrawOther(osu.Framework.Graphics.DrawNode, osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.Containers.CompositeDrawable+CompositeDrawableDrawNode.Draw(osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.DrawNode.DrawOther(osu.Framework.Graphics.DrawNode, osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.Containers.CompositeDrawable+CompositeDrawableDrawNode.Draw(osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.DrawNode.DrawOther(osu.Framework.Graphics.DrawNode, osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.Containers.CompositeDrawable+CompositeDrawableDrawNode.Draw(osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.DrawNode.DrawOther(osu.Framework.Graphics.DrawNode, osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.Containers.CompositeDrawable+CompositeDrawableDrawNode.Draw(osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.DrawNode.DrawOther(osu.Framework.Graphics.DrawNode, osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.Containers.CompositeDrawable+CompositeDrawableDrawNode.Draw(osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.DrawNode.DrawOther(osu.Framework.Graphics.DrawNode, osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.Containers.CompositeDrawable+CompositeDrawableDrawNode.Draw(osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.DrawNode.DrawOther(osu.Framework.Graphics.DrawNode, osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.Containers.CompositeDrawable+CompositeDrawableDrawNode.Draw(osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.DrawNode.DrawOther(osu.Framework.Graphics.DrawNode, osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.Containers.CompositeDrawable+CompositeDrawableDrawNode.Draw(osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.DrawNode.DrawOther(osu.Framework.Graphics.DrawNode, osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.Containers.CompositeDrawable+CompositeDrawableDrawNode.Draw(osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.DrawNode.DrawOther(osu.Framework.Graphics.DrawNode, osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.Containers.CompositeDrawable+CompositeDrawableDrawNode.Draw(osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.DrawNode.DrawOther(osu.Framework.Graphics.DrawNode, osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.Containers.CompositeDrawable+CompositeDrawableDrawNode.Draw(osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Graphics.DrawNode.DrawOther(osu.Framework.Graphics.DrawNode, osu.Framework.Graphics.Rendering.IRenderer)
at osu.Framework.Platform.GameHost.DrawFrame()
at osu.Framework.Threading.GameThread.processFrame()
at osu.Framework.Threading.GameThread.RunSingleFrame()
at osu.Framework.Threading.GameThread.<createThread>g__runWork|66_0()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
This is related to many of the other Vulkan issues pointed out in ppy/osu#27659
I don't think Veldrid's implementation is salvageable, or it's out of scope, because it opts to implement its own memory managed instead of e.g. VulkanMemoryAllocator
(one of the most painful things about VK in general).
I have other efforts in mind to fix this, but I don't think we need to keep this issue around.