Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vmaCreateBuffer() fails on Raspberry Pi with Mesa drivers when called with VMA_MEMORY_USAGE_AUTO and VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT. #362

Closed
cos-public opened this issue Aug 17, 2023 · 4 comments
Labels
bug Something isn't working compatibility Compatibility with some platforms next release To be done as soon as possible

Comments

@cos-public
Copy link

Call to vmaCreateBuffer() fails when called with VMA_MEMORY_USAGE_AUTO and VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT as random host access requires VK_MEMORY_PROPERTY_HOST_CACHED_BIT. However, there is no memory type with such properties available on Raspberry Pi. Here is an excerpt from vulkaninfo:

==========
VULKANINFO
==========

Vulkan Instance Version: 1.3.250
...
Device Properties and Extensions:
=================================
GPU0:
VkPhysicalDeviceProperties:
---------------------------
	apiVersion        = 1.2.246 (4202742)
	driverVersion     = 23.1.3 (96473091)
	vendorID          = 0x14e4
	deviceID          = 0xbe485fd3
	deviceType        = PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU
	deviceName        = V3D 4.2
	pipelineCacheUUID = aeb6494b-3e65-2f07-0af0-8fa9e0b21377
...
VkPhysicalDeviceMemoryProperties:
=================================
memoryHeaps: count = 1
	memoryHeaps[0]:
		size   = 969521152 (0x39c9b800) (924.61 MiB)
		budget = 969521152 (0x39c9b800) (924.61 MiB)
		usage  = 0 (0x00000000) (0.00 B)
		flags: count = 1
			MEMORY_HEAP_DEVICE_LOCAL_BIT
memoryTypes: count = 1
	memoryTypes[0]:
		heapIndex     = 0
		propertyFlags = 0x0007: count = 3
			MEMORY_PROPERTY_DEVICE_LOCAL_BIT
			MEMORY_PROPERTY_HOST_VISIBLE_BIT
			MEMORY_PROPERTY_HOST_COHERENT_BIT
		usable for:
			IMAGE_TILING_OPTIMAL:
				color images
				FORMAT_D16_UNORM
				FORMAT_X8_D24_UNORM_PACK32
				FORMAT_D32_SFLOAT
				FORMAT_D24_UNORM_S8_UINT
				(non-sparse)
			IMAGE_TILING_LINEAR:
				color images
				(non-sparse)

I would expect that such a broad request would return something usable on any platform.
Is this the intended behaviour?

@adam-sawicki-a adam-sawicki-a added bug Something isn't working next release To be done as soon as possible compatibility Compatibility with some platforms labels Aug 17, 2023
@adam-sawicki-a
Copy link
Contributor

Thank you for reporting this problem. You are right - Vulkan specification doesn't guarantee that a memory type with HOST_CACHED flag exists, while VMA_MEMORY_USAGE_AUTO should work on any platform. It will be fixed ASAP.

adam-sawicki-a added a commit that referenced this issue Aug 22, 2023
In function FindMemoryPreferences, not requiring HOST_CACHED memory, as some platforms may not have it. See #362 - thanks @cos-public
@adam-sawicki-a
Copy link
Contributor

I've pushed a fix. Please let me know if it works on your platform.

@adam-sawicki-a adam-sawicki-a added the input needed Waiting for more information label Aug 22, 2023
@cos-public
Copy link
Author

Sorry for the delay. Just got back to the next iteration with the project. Yes, it's working as expected now. Thank you.

@adam-sawicki-a
Copy link
Contributor

Thank you for confirmation. I assume I can close the ticket now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compatibility Compatibility with some platforms next release To be done as soon as possible
Projects
None yet
Development

No branches or pull requests

2 participants