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

Linux compilation and VMA issue #2

Open
rncar opened this issue Jan 10, 2023 · 6 comments
Open

Linux compilation and VMA issue #2

rncar opened this issue Jan 10, 2023 · 6 comments

Comments

@rncar
Copy link

rncar commented Jan 10, 2023

Hi, in linux I just get this easy fix issue:

vulkanizer/src/core/buffer.cpp: In function ‘Buffer createBuffer(Device&, BufferDesc)’:
vulkanizer/src/core/buffer.cpp:44:25: error: ‘memcpy’ was not declared in this scope
   44 |                         memcpy(buffer.pMappedData, _desc.pContents, buffer.byteSize);
      |                         ^~~~~~
vulkanizer/src/core/buffer.cpp:3:1: note: ‘memcpy’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’?
    2 | #include "buffer.h"
  +++ |+#include <cstring>
    3 |
make[3]: *** [CMakeFiles/vulkanizer.dir/build.make:109: CMakeFiles/vulkanizer.dir/src/core/buffer.cpp.o] Error 1

After adding the include all is fine. But I get this error from vma

$ ./build/vulkanizer 3rdparty/meshoptimizer/demo/pirate.obj

vulkanizer: vulkanizer/3rdparty/VulkanMemoryAllocator/src/../include/vk_mem_alloc.h:2780: void* vma_aligned_alloc(size_t, size_t): Assertion `0 && "Could not implement aligned_alloc automatically. Please enable C++17 or later in your compiler or provide custom implementation of macro VMA_SYSTEM_ALIGNED_MALLOC (and VMA_SYSTEM_ALIGNED_FREE if needed) using the API of your system."' failed. Aborted (core dumped)

any hint about it ?

@rncar
Copy link
Author

rncar commented Jan 10, 2023

I have fixed the vma issue touching the vma_mem_alloc.h header.

But now I get this:

$ ./build/vulkanizer 3rdparty/meshoptimizer/demo/pirate.obj 
vulkanizer: vulkanizer/src/utils.cpp:9: std::vector<char> readFile(const char*): Assertion `file != nullptr' failed. Aborted (core dumped)

Maybe a stupid error launching the application.

@rncar
Copy link
Author

rncar commented Jan 10, 2023

ok, the spv files were not generated by cmake.
Fixed with set(GLSL_COMPILER "/usr/bin/glslc")

Next stage:

$ ./vulkanizer ../3rdparty/meshoptimizer/demo/pirate.obj vulkanizer: 

vulkanizer/3rdparty/meshoptimizer/src/indexgenerator.cpp:190: size_t meshopt_generateVertexRemap(unsigned int*, const unsigned int*, size_t, const void*, size_t, size_t): Assertion `index_count % 3 == 0' failed. Aborted (core dumped)

Seems like the .obj I am using is not correct. I will look for one that only contains triangles.

@rncar
Copy link
Author

rncar commented Jan 10, 2023

Validation Error: [ VUID-VkSwapchainCreateInfoKHR-minImageCount-01271 ] Object 0: handle = 0x556bb3089fe0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xe18476f3 | vkCreateSwapchainKHR() called with minImageCount = 0, which is outside the bounds returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR() (i.e. minImageCount = 3, maxImageCount = 0). The
Vulkan spec states: minImageCount must be greater than or equal to the value returned in the minImageCount member of
the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface (https://github.com/KhronosGroup/Vulkan-Docs/search?q=)VUID-VkSwapchainCreateInfoKHR-minImageCount-01271)
vulkanizer: /home/vito/3ros/examples/vulkan/vulkanizer/src/core/device.cpp:76: VkBool32 debugMessageCallback(VkDebugUtilsMessageSeverityFlagBitsEXT, VkDebugUtilsMessageTypeFlagsEXT, const VkDebugUtilsMessengerCallbackDataEXT*, void*): Assertion `_messageSeverity != VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT' failed.
Aborted (core dumped)

I will try to fix it. The minImageCount in my card is 3.

@rncar
Copy link
Author

rncar commented Jan 10, 2023

I forced the value to 3, but now I get:

Validation Error: [ VUID-VkPushConstantRange-size-00298 ] Object 0: handle = 0x555785dd0b20, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xed1e4a95 | vkCreatePipelineLayout(): pCreateInfo->pPushConstantRanges[0] offset (0) and size (256) together exceeds this device's maxPushConstantSize of 128. The Vulkan spec states: size must be less than or equal to VkPhysicalDeviceLimits::maxPushConstantsSize minus offset (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkPushConstantRange-size-00298) vulkanizer: /home/vito/3ros/examples/vulkan/vulkanizer/src/core/device.cpp:76: VkBool32 debugMessageCallback(VkDebugUtilsMessageSeverityFlagBitsEXT, VkDebugUtilsMessageTypeFlagsEXT, const VkDebugUtilsMessengerCallbackDataEXT*, void*): Assertion `_messageSeverity != VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT' failed. Aborted (core dumped)

Ok, I am going to stop to put issues here, these errors are related to my integrated card (maxPushConstantsSize = 128).
Intel UHD Graphics 770 (ADL-S GT1)
Vulkan Instance Version: 1.3.235

Would be great to see an example with a simpler scene, just to play with the engine.
Thanks.

@milkru
Copy link
Owner

milkru commented Jan 11, 2023

Hello. You can post as many issues as you want and thank you for that. As I already mentioned in the readme file, Linux build is not working and I don't have Linux on my machine unfortunately. I also don't believe that vulkanizer works on integrated cards. If you manage to get Linux working, I'll be happy to integrate it.

@rncar
Copy link
Author

rncar commented Jan 11, 2023

All the extensions seems sopported, I will inform you if I do some advances.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants