0

I need to create a very, very large image on the gpu 8kx8k.

I need to fill that data with a large amount of data I have locally on my machine.

If I try to create a buffer large enough to hold onto the full amount of data, I get this error:

Message: Validation Error: [ VUID-vkAllocateMemory-pAllocateInfo-01713 ] Object 0: handle = 0x5555560fd9f0, name = Logical device: NVIDIA GeForce GTX 1070, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xe9a2b96f | vkAllocateMemory: attempting to allocate 268435456 bytes from heap 2,but size of that heap is only 257949696 bytes. The Vulkan spec states: pAllocateInfo->allocationSize must be less than or equal to VkPhysicalDeviceMemoryProperties::memoryHeaps[memindex].size where memindex = VkPhysicalDeviceMemoryProperties::memoryTypes[pAllocateInfo->memoryTypeIndex].heapIndex as returned by vkGetPhysicalDeviceMemoryProperties for the VkPhysicalDevice that device was created from (https://vulkan.lunarg.com/doc/view/1.3.211.0/linux/1.3-extensions/vkspec.html#VUID-vkAllocateMemory-pAllocateInfo-01713)
Severity: VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT

I assume that it;s because I am using the VMA flag VMA_MEMORY_USAGE_CPU_TO_GPU, which is needed to create buffers to copy data from the cpu to the gpu.

But only heap 2 has memory types that can actually hold host visible buffers.

What do I do?

Ken White
  • 123,280
  • 14
  • 225
  • 444
Makogan
  • 8,208
  • 7
  • 44
  • 112
  • According to the documentation, [that flag is obsolete](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/group__group__alloc.html#ggaa5846affa1e9da3800e3e78fae2305cca9066b52c5a7079bb74a69aaf8b92ff67). Also, why are you trying to make it host-visible? "*only heap 2 has memory types that can actually hold host visible buffers*" Nonsense. There's a heap between heap 0 and heap 2. – Nicol Bolas Aug 05 '22 at 02:16
  • Doesn;t the buffer need to be host visible to be able to map it and memcpy byte data onto it? – Makogan Aug 05 '22 at 02:21
  • Yes. And heap 1 is host visible too. – Nicol Bolas Aug 05 '22 at 02:21

0 Answers0