Skip to content

Vulkan Renderer Mod causes OutOfMemoryError: Out of stack space on Minecraft 1.21.1 (RTX 4060, Fabric) #665

Description

@HoneyBerries

Summary:
When enabling the Vulkan Renderer Mod (vulkanmod 0.5.5), Minecraft 1.21.1 crashes on startup with java.lang.OutOfMemoryError: Out of stack space during Vulkan initialization. Removing the mod allows the game to launch normally with the default OpenGL renderer.

Environment:

  • Minecraft: 1.21.1
  • Fabric Loader: 0.17.2
  • Java: OpenJDK 21.0.8.0 (Eclipse Adoptium)
  • OS: Windows 11
  • GPU: NVIDIA GeForce RTX 4060 (latest drivers)
  • VulkanMod: 0.5.5 (bundles LWJGL 3.3.3-snapshot)
  • 119 mods loaded (see log excerpt below for key mods)

Steps to reproduce:

  1. Install Vulkan Renderer Mod (vulkanmod 0.5.5) into a Fabric 1.21.1 instance.
  2. Launch Minecraft with Fabric Loader 0.17.2 and Java 21.
  3. Observe crash during renderer initialization.

Expected behavior:
Minecraft initializes the Vulkan renderer and proceeds to the main menu.

Actual behavior:
Crash on startup with:

java.lang.OutOfMemoryError: Out of stack space
    at knot//org.lwjgl.system.MemoryStack.nmalloc(MemoryStack.java:322)
    at knot//org.lwjgl.vulkan.VkExtensionProperties.malloc(VkExtensionProperties:210)
    at knot//org.lwjgl.vulkan.VkInstance.getAvailableDeviceExtensions(VkInstance.java:82)
    at knot//org.lwjgl.vulkan.VkInstance.getInstanceCapabilities(VkInstance.java:45)
    at knot//org.lwjgl.vulkan.VkInstance.<init>(VkInstance.java:29)
    at knot//net.vulkanmod.vulkan.Vulkan.createInstance(Vulkan.java:244)
    at knot//net.vulkanmod.vulkan.Vulkan.initVulkan(Vulkan.java:139)
    at knot//net.vulkanmod.vulkan.VRenderSystem.initRenderer(VRenderSystem:63)
    at knot//com.mojang.blaze3d.systems.RenderSystem.initRenderer(RenderSystem:1004)
    at knot//net.minecraft.class_310.<init>(class_310:524)

Startup log excerpt:

[14:15:13] [main/INFO]: Loading Minecraft 1.21.1 with Fabric Loader 0.17.2
...
[14:15:14] [main/INFO]: Loading 119 mods:
  - vulkanmod 0.5.5
     |-- org_lwjgl_lwjgl-shaderc 3.3.3
     |-- org_lwjgl_lwjgl-vma 3.3.3
     |-- org_lwjgl_lwjgl-vulkan 3.3.3
...
[14:15:25] [Render thread/INFO]: == VulkanMod ==
[14:15:25] [Render thread/INFO]: Selecting Platform: WIN32
[14:15:25] [Render thread/INFO]: GLFW: 3.4.0 Win32 WGL Null EGL OSMesa VisualC DLL
[14:15:27] [Render thread/INFO]: Backend library: LWJGL version 3.3.3-snapshot

Attempts and workarounds tried:

  • Closed OBS (graphics-hook previously present in modules) — no effect.
  • Increased JVM stack size (e.g., -Xss2M / -Xss4M) — no effect.
  • Removed Vulkan mod — game launches normally (OpenGL renderer).
  • Verified GPU drivers are the latest for RTX 4060.
  • Verified Vulkan support via driver install (vulkan runtime present).

Notes / Hypothesis:

  • The stack trace shows the failure occurs inside LWJGL's MemoryStack allocation when enumerating Vulkan extensions. This suggests an issue in the way the mod/LWJGL is allocating stack memory or handling the returned extension list (possible bug in the mod or an LWJGL binding mismatch).
  • The environment uses LWJGL 3.3.3-snapshot packaged by vulkanmod; consider testing with a stable LWJGL or reviewing MemoryStack usage in Vulkan.createInstance.
  • There may be interactions with the large mod list or specific mods — testing with only vulkanmod + Fabric was not yet performed.

Workaround:

  • Remove vulkanmod to use default OpenGL renderer.

Please investigate potential improper MemoryStack usage when enumerating Vulkan extensions or any mod conflicts that could cause inflated stack usage during instance creation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions