I am following Learning Vulkan by Parminder Singh for learning graphics programming using Vulkan API. I have followed the guide for the device handshake correctly and the compilation is done. Only, it returns a segmentation fault at runtime. After debugging line by line, i have determined that the exact line at which this error occurs is in the Vulkan Application class’s member function where i call the vkEnumeratePhysicalDevice function :
VkResult VulkanApplication::enumeratePhysicalDevices(std::vector<VkPhysicalDevice>& gpuList)
{
uint32_t gpuDeviceCount {};
VkResult result = vkEnumeratePhysicalDevices(instanceObj.instance, &gpuDeviceCount, NULL);
assert(result == VK_SUCCESS);
gpuList.resize(gpuDeviceCount);
assert(gpuDeviceCount);
result = vkEnumeratePhysicalDevices(instanceObj.instance, &gpuDeviceCount, gpuList.data());
assert(result == VK_SUCCESS);
return result;
}
Here is the error message the debugger gives out:
82 VkResult result = vkEnumeratePhysicalDevices(instanceObj.instance, &gpuDeviceCount, NULL);
(gdb) s
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7f7fdfb in ?? () from /lib/x86_64-linux-gnu/libvulkan.so.1
I am using Vulkan 1.2.154.0, my system is Ubuntu 20.04, and the graphics card installed on my sydtem is Intel UHD Graphics 630
I can’t find any errors in the syntax or any other errors in the code, so I don’t know exctly how to rectify this. could use some help