Skip to content

physicalDevice selection issue #2

@joeholley

Description

@joeholley

Was compiling a few vulkan tutorials I found on the web and came across yours. Line 73-76 in main.cpp:

    auto physicalDevice = physicalDevices[std::distance(physicalDevices.begin(),
        std::find_if(physicalDevices.begin(), physicalDevices.end(), [](const vk::PhysicalDevice& physicalDevice) {
            return strstr(physicalDevice.getProperties().deviceName, "Intel");
        }))];

This crashes the program with a 'vector subscript out of range' when there's only one device in the enumeration and it doesn't matchs the substring you've defined ("Intel").

Built with cmake + ninja in VS2022 on Windows 10v19044.2846, with an nVidia 1070 using driver version 528.33. Just selecting the first physical device using auto physicalDevice = physicalDevices[0] was a workaround for this system, which only enumerates a single physical device (the 1070).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions