Failed to allocate Device Memory leads to Fatal Error

Hi everyone,

I am working on a project in Ubuntu. And it has happened quite a few times already that the editor crashes and this is the last part of the log data:

[2025.06.23-01.14.17:544][  0]LogVulkanRHI: Warning: Failed to allocate Device Memory, Requested=524288.00Kb MemTypeIndex=1
[2025.06.23-01.14.17:662][  0]LogVulkanRHI: Warning: Failed to allocate Device Memory, Requested=87385.50Kb MemTypeIndex=1
[2025.06.23-01.14.17:682][  0]LogVulkanRHI: Warning: Failed to allocate Device Memory, Requested=131072.00Kb MemTypeIndex=1[2025.06.23-01.14.17:683][  0]LogVulkanRHI: Warning: Failed to allocate Device Memory, Requested=114688.00Kb MemTypeIndex=1
[2025.06.23-01.14.17:749][  0]LogVulkanRHI: Warning: Failed to allocate Device Memory, Requested=65536.00Kb MemTypeIndex=1
[2025.06.23-01.14.17:765][  0]LogVulkanRHI: Warning: Failed to allocate Device Memory, Requested=131072.00Kb MemTypeIndex=1
[2025.06.23-01.14.17:768][  0]LogConsoleManager: Warning: Console variable 'r.ShaderCompiler.JobCache' used in the render thread. Rendering artifacts could happen. Use ECVF_RenderThreadSafe or don't use in render thread.
[2025.06.23-01.14.17:787][  0]LogVulkanRHI: Warning: Failed to allocate Device Memory, Requested=16384.00Kb MemTypeIndex=1
[2025.06.23-01.14.17:798][  0]LogVulkanRHI: Warning: Failed to allocate Device Memory, Requested=32768.00Kb MemTypeIndex=1
[2025.06.23-01.14.17:812][  0]LogVulkanRHI: Warning: Failed to allocate Device Memory, Requested=65536.00Kb MemTypeIndex=1
[2025.06.23-01.14.17:836][  0]LogVulkanRHI: Warning: Failed to allocate Device Memory, Requested=73984.00Kb MemTypeIndex=1
[2025.06.23-01.14.17:863][  0]LogVulkanRHI: Warning: Failed to allocate Device Memory, Requested=131072.00Kb MemTypeIndex=1
[2025.06.23-01.14.17:865][  0]LogVulkanRHI: Warning: Failed to allocate Device Memory, Requested=131072.00Kb MemTypeIndex=1
[2025.06.23-01.14.17:865][  0]LogVulkanRHI: Warning: Failed to allocate Device Memory, Requested=21847.00Kb MemTypeIndex=1
[2025.06.23-01.14.17:952][  0]LogVulkanRHI: Warning: Failed to allocate Device Memory, Requested=131072.00Kb MemTypeIndex=1
Fatal error: [File:./Runtime/VulkanRHI/Private/VulkanMemory.cpp] [Line: 1995] 
Out of memory on Vulkan; MemoryTypeIndex=1, AllocSize=128.000MB
Signal 11 caught.
Malloc Size=262146 LargeMemoryPoolOffset=262162 
CommonUnixCrashHandler: Signal=11
[2025.06.23-01.14.18:967][  0]LogCore: === Critical error: ===
Unhandled Exception: SIGSEGV: invalid attempt to write memory at address 0x0000000000000003

[2025.06.23-01.14.18:967][  0]LogCore: Fatal error: [File:./Runtime/VulkanRHI/Private/VulkanMemory.cpp] [Line: 1995] 
Out of memory on Vulkan; MemoryTypeIndex=1, AllocSize=128.000MB

This in particular happened on the standard Blank Project (no assets, no code). And it happened when I launched UnrealEditor from the terminal.

I feel I need to run a few commands to get more information about Vulkan and my NVIDIA GPU but I am not sure which ones; and I am not sure if it will help me find a solution - thou I will try to update this with that info and see if someone else can help.

I really appreciate if you can help,

Hello there @pedroo-14041!

Indeed, your provided log shows a “Failed to allocate Device Memory” issue with Vulkan. Checking through the community, this is tied to VRAM problems, most likely related to drivers.

Please make sure you are usinge the latest, stable version of NVIDIA drivers for Vulkan stability. Additionally, check for any updates or hotfixes deployed for your Ubuntu build. Also, adjust your values for engine scalabillty, to ensure your equipment is not being exerted, specially your GPU.

Hello @brs-sebascova !

Thanks for reaching out and helping me with this.
I am pretty confident that I am using the latest and greatest but let’s clarify. According to the Linux Development Requirements page, I need:

  • Operating System: Ubuntu 22.04 (check)
  • Processor: Quad-core Intel or AMD, 2.5GHz or faster (Intel(R) Core™ Ultra 7 165H (specs below)
  • Memory: 32 GB RAM (check)
  • Graphics Card: GeForce 2080 (NVIDIA RTX 4060 laptop GPU (8GB GDDR6)
  • RHI Version: Vulkan: AMD (RADV 23.2.1+) and NVIDIA (535.86+)
    • Using NVIDIA Driver Version: 575.57.08
  • VulkanSDK: 1.4.304.1

The only thing I think can cause an issue is that my system is very close to the minimum requirements, which would not suffice if I am using an external monitor. But the problem with this statement is that even with single monitor, I am having the issue.

[EDIT 1]

I have set the performance to Low on every aspect. Let’s see how it goes.

[EDIT 2]

I have actually uninstalled NVIDIA drivers 575 and installed 535 to match the System Requirements - at this point, I believe anything is worth trying. I have also reduced the resolution of my laptop to 1920x1200 (16:10) ((default aspect ratio)).


References:

Additionally, I have gotten this as well:

[2025.06.24-04.31.38:100][  0]LogSlate: Took 0.000233 seconds to synchronously load lazily loaded font '../../../Engine/Content/Slate/Fonts/DroidSansMono.ttf' (77K)
[2025.06.24-04.31.38:566][  0]LogVulkanRHI: Display: Requested PixelFormat 18 not supported by this swapchain! Falling back to supported swapchain format...
[2025.06.24-04.31.38:566][  0]LogVulkanRHI: Display: Queue Family 0: Supports Present
[2025.06.24-04.31.38:566][  0]LogVulkanRHI: Display: Queue Family 0: Supports Present
[2025.06.24-04.31.38:566][  0]LogVulkanRHI: Display: Found 3 Surface present modes:
[2025.06.24-04.31.38:566][  0]LogVulkanRHI: Display: - VK_PRESENT_MODE_FIFO_KHR (2)
[2025.06.24-04.31.38:566][  0]LogVulkanRHI: Display: - VK_PRESENT_MODE_IMMEDIATE_KHR (0)
[2025.06.24-04.31.38:566][  0]LogVulkanRHI: Display: - VkPresentModeKHR 1000361000
[2025.06.24-04.31.38:566][  0]LogVulkanRHI: Display: Selected VkPresentModeKHR mode VK_PRESENT_MODE_FIFO_KHR
[2025.06.24-04.31.38:566][  0]LogVulkanRHI: Creating new VK swapchain with VK_PRESENT_MODE_FIFO_KHR, VK_FORMAT_B8G8R8A8_UNORM, VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, num images 3
[2025.06.24-04.31.38:580][  0]LogVulkanRHI: Error: Result failed, VkResult=-3
 at ./Runtime/VulkanRHI/Private/VulkanSwapChain.cpp:546 
 with error VK_ERROR_INITIALIZATION_FAILED
[2025.06.24-04.31.38:580][  0]LogOutputDevice: Warning: 

Script Stack (0 frames) :

Fatal error: [File:./Runtime/VulkanRHI/Private/VulkanUtil.cpp] [Line: 1137] 
Result failed, VkResult=-3
 at ./Runtime/VulkanRHI/Private/VulkanSwapChain.cpp:546 
 with error VK_ERROR_INITIALIZATION_FAILED


Hello again!

Thank you for the follow up. Your latest log includes a new error,VK_ERROR_INITIALIZATION_FAILED. This message suggests an issue with Vulkan initialization or compatibility, on top of the “out of memory” problems from the previous log.

Check your system for VRAM availability and use, to confirm if it’s being cut short:

vulkaninfo > vulkaninfo_output.txt 2>&1

The resulting file should contain the following:

  • apiVersion: Should be recent (e.g., 1.3 or 1.4, as the SDK is 1.4).
  • driverVersion: Should correspond to the NVIDIA driver.
  • deviceName: Ensure your NVIDIA RTX 4060 is listed as the primary Vulkan device.
  • memoryHeaps - memoryTypes: These sections describe the available GPU memory. Look for DEVICE_LOCAL memory types and their sizes. The MemTypeIndex=1 from the original log refers to one of these memory types.
  • VK_KHR_swapchain: This should be present and enabled.

Also, since you downgraded the drivers already, please make sure that the process includes a clea installation, meaning, removing all remnants from the previous drivers, as these could still interfiere in the process.

Additionally, you could test with an empty project, to ensure the issue is not isolated to your active project.

Thank you. Will try and update this question.

Apologies for deviating from the current issue. I’m also facing similar issue, when trying to generate images (from the shaders to rendertargets) at bit high frequency, I create separate instances of capture components and render targets, and free the render targets by doing (ReleaseResource)

[2025.06.25-04.06.15:447][321]LogVulkanRHI: Warning: Failed to allocate Device Memory, Requested=21960.00Kb MemTypeIndex=1

it doesn’t crash often, but sometimes, for more context I’m generating 12 images (512*512 pixels) every 1 second, and when I checked memoryHeaps-memoryTypes,

VkPhysicalDeviceMemoryProperties:
=================================
memoryHeaps: count = 3
	memoryHeaps[0]:
		size   = 8589934592 (0x200000000) (8.00 GiB)
		budget = 4553900032 (0x10f6f0000) (4.24 GiB)
		usage  = 0 (0x00000000) (0.00 B)
		flags: count = 1
			MEMORY_HEAP_DEVICE_LOCAL_BIT
	memoryHeaps[1]:
		size   = 25191573504 (0x5dd88e800) (23.46 GiB)
		budget = 25191573504 (0x5dd88e800) (23.46 GiB)
		usage  = 0 (0x00000000) (0.00 B)
		flags:
			None
	memoryHeaps[2]:
		size   = 257949696 (0x0f600000) (246.00 MiB)
		budget = 246677504 (0x0eb40000) (235.25 MiB)
		usage  = 11272192 (0x00ac0000) (10.75 MiB)
		flags: count = 1
			MEMORY_HEAP_DEVICE_LOCAL_BIT

I think the issue is with the 246 MB, when I see the requested memory reach near 200 MB, thats when it crashes, although there will a large number of the same warning before.

Appreciate for your time and effort.

Hi again,

I ran vulkaninfo and got these:

* apiVersion: 1.3.242
* driverVersion: 535.x.y.z
* deviceName: RTX 4060
* memoryHeaps: count = 2
* * [0] : 8.00 GiB
* * [1] : 23.09 GiB
* memoryTypes: count = 5
* * [1] : MEMORY_PROPERTY_DEVICE_LOCAL_BIT // the only .*_DEVICE_LOCAL_.*
* VK_KHR_swapchain: present 

UPDATE

Since I lowered the Scalability of the Editor and downgraded the NVIDIA driver to 535, I have been able to launch the Editor from VS Code, even on an external display (single display - external monitor only).

Wondering if it is a problem with resources or NVIDIA drivers…

Hello @dhashuml ,

I cannot help at the moment but I would recommend you getting as much information as I did (see above). Or at least, inform us if it is the same system, drivers, versions, etc.

That way, it will be easier for people following the question to understand if it is related or not. And if not, tell you what you can do to fix it.