VulkanMod icon indicating copy to clipboard operation
VulkanMod copied to clipboard

Crash on startup with NVIDIA driver 560.xx (OutOfMemoryError: Out of stack space)

Open Damiqn1338 opened this issue 1 year ago • 8 comments

Minecraft version: 1.21.4
VulkanMod version: 0.5.6 (Fabric)
Java version: OpenJDK 21 (64-bit)
OS: Windows 11 Pro (64-bit)
GPU setup: NVIDIA GeForce RTX 5070 Laptop GPU + Integrated AMD Radeon Graphics (multi-GPU)
NVIDIA driver version: 560.xx (latest Game Ready Driver, August 2025)

Description: After updating NVIDIA drivers from an older version (worked fine before) to the latest Game Ready Driver (560.xx), VulkanMod crashes instantly on startup during Vulkan instance creation.
Game runs fine on OpenGL backend, but Vulkan backend triggers the crash every time.

Crash log excerpt:

Damiqn1338 avatar Aug 09 '25 08:08 Damiqn1338

same issue here, pretty much verbatim.

xAvocqdo avatar Aug 12 '25 21:08 xAvocqdo

will you fix it?

Damiqn1338 avatar Aug 12 '25 21:08 Damiqn1338

same crash UP UP

Moriggan avatar Aug 12 '25 22:08 Moriggan

will you fix it?

-Dorg.lwjgl.system.stackSize=256 write this in launcher settings if using normal minecraft launcher,or in curesforge additional jvms

Moriggan avatar Aug 12 '25 23:08 Moriggan

same issue here, pretty much verbatim.

-Dorg.lwjgl.system.stackSize=256 easy fix in Jvm options

Moriggan avatar Aug 12 '25 23:08 Moriggan

Do we know why this happens? I know you can set the stacksize to 256 in jvm but is the nvidia driver doing something to cause this?? I heard other people were getting issues in other games that were using vulkan, too..

firstpuppet avatar Aug 17 '25 21:08 firstpuppet

I encountered the same OutOfMemoryError: Out of stack space crash with VulkanMod on my system (Intel UHD + NVIDIA RTX 3060, Win 11). After analyzing the code and crash logs, I found the root cause and a reliable solution.

Root Cause & Analysis The crash happens in DeviceManager.isDeviceSuitable() at the line:

VkPhysicalDeviceFeatures supportedFeatures = VkPhysicalDeviceFeatures.malloc(stack);

This method is called in a loop for each GPU. The VkPhysicalDeviceFeatures struct is very large, and on some systems (especially with newer NVIDIA drivers like the 560.xx series), allocating it on the stack for each device can cause a stack overflow before the stack frame is popped.

This is not a heap memory issue (like -Xmx), but a stack size issue. It can affect both single and multi-GPU systems.

Solution 1: The Quick JVM Fix (Recommended) As mentioned by others, the easiest fix is to increase the LWJGL stack size by adding this JVM argument to your launcher:

-Dorg.lwjgl.system.stackSize=256 This gives the stack enough room to handle the large allocations.

Solution 2: The Code Fix (Permanent) If you are compiling VulkanMod from source, you can apply a more permanent fix. The device features check is not essential for the initial suitability test.

In DeviceManager.java, simply comment out or remove the three lines that cause the problem (around line 268):

// VkPhysicalDeviceFeatures supportedFeatures = VkPhysicalDeviceFeatures.malloc(stack);
// vkGetPhysicalDeviceFeatures(device, supportedFeatures);
// boolean anisotropicFilterSupported = supportedFeatures.samplerAnisotropy();

The device is still considered suitable based on its queue families, extension support, and swap chain capabilities. This change completely resolves the crash.

I hope this explanation helps! The JVM argument is a great workaround for everyone, while the code change could be considered for a future update to the mod.

By the way: This response was summarized and translated with the help of artificial intelligence based on the available methods that I found myself, since English is not my first language

MotWnb avatar Aug 24 '25 01:08 MotWnb

@Damiqn1338 This should be closed

Versatile-One avatar Dec 05 '25 13:12 Versatile-One