diff --git a/sycl/test-e2e/bindless_images/vulkan_interop/mipmaps.cpp b/sycl/test-e2e/bindless_images/vulkan_interop/mipmaps.cpp index 91fea94aa6e17..7cac3cce862a6 100644 --- a/sycl/test-e2e/bindless_images/vulkan_interop/mipmaps.cpp +++ b/sycl/test-e2e/bindless_images/vulkan_interop/mipmaps.cpp @@ -444,11 +444,10 @@ int main() { return EXIT_FAILURE; } - const char *devices[] = {"Intel", "NVIDIA"}; - if (std::none_of(std::begin(devices), std::end(devices), - [](const char *device) { - return vkutil::setupDevice(device) == VK_SUCCESS; - })) { + sycl::device dev; + + if (vkutil::setupDevice(dev.get_info()) != + VK_SUCCESS) { std::cerr << "Device setup failed!\n"; return EXIT_FAILURE; } diff --git a/sycl/test-e2e/bindless_images/vulkan_interop/sampled_images.cpp b/sycl/test-e2e/bindless_images/vulkan_interop/sampled_images.cpp index 5c4332809bf12..4afaff48b466b 100644 --- a/sycl/test-e2e/bindless_images/vulkan_interop/sampled_images.cpp +++ b/sycl/test-e2e/bindless_images/vulkan_interop/sampled_images.cpp @@ -364,11 +364,10 @@ int main() { return EXIT_FAILURE; } - const char *devices[] = {"Intel", "NVIDIA"}; - if (std::none_of(std::begin(devices), std::end(devices), - [](const char *device) { - return vkutil::setupDevice(device) == VK_SUCCESS; - })) { + sycl::device dev; + + if (vkutil::setupDevice(dev.get_info()) != + VK_SUCCESS) { std::cerr << "Device setup failed!\n"; return EXIT_FAILURE; } diff --git a/sycl/test-e2e/bindless_images/vulkan_interop/unsampled_images.cpp b/sycl/test-e2e/bindless_images/vulkan_interop/unsampled_images.cpp index 62b9e5208d706..9b609df39380f 100644 --- a/sycl/test-e2e/bindless_images/vulkan_interop/unsampled_images.cpp +++ b/sycl/test-e2e/bindless_images/vulkan_interop/unsampled_images.cpp @@ -622,11 +622,10 @@ int main() { return EXIT_FAILURE; } - const char *devices[] = {"Intel", "NVIDIA"}; - if (std::none_of(std::begin(devices), std::end(devices), - [](const char *device) { - return vkutil::setupDevice(device) == VK_SUCCESS; - })) { + sycl::device dev; + + if (vkutil::setupDevice(dev.get_info()) != + VK_SUCCESS) { std::cerr << "Device setup failed!\n"; return EXIT_FAILURE; } diff --git a/sycl/test-e2e/bindless_images/vulkan_interop/vulkan_common.hpp b/sycl/test-e2e/bindless_images/vulkan_interop/vulkan_common.hpp index 85f49847c715e..096f11dd50369 100644 --- a/sycl/test-e2e/bindless_images/vulkan_interop/vulkan_common.hpp +++ b/sycl/test-e2e/bindless_images/vulkan_interop/vulkan_common.hpp @@ -232,6 +232,11 @@ VkResult setupDevice(std::string device) { #endif }; + // Make lowercase to fix inconsistent capitalization between SYCL and Vulkan + // device naming. + std::transform(device.begin(), device.end(), device.begin(), + [](unsigned char c) { return std::tolower(c); }); + // From all physical devices, find the first one that supports all our // required device extensions. for (int i = 0; i < physicalDeviceCount; i++) { @@ -240,6 +245,10 @@ VkResult setupDevice(std::string device) { vkGetPhysicalDeviceProperties(vk_physical_device, &props); std::string name(props.deviceName); + // Make lowercase for comparision. + std::transform(name.begin(), name.end(), name.begin(), + [](unsigned char c) { return std::tolower(c); }); + if (name.find(device) == std::string::npos) { continue; } @@ -261,7 +270,8 @@ VkResult setupDevice(std::string device) { } foundDevice = true; - std::cout << "Found suitable Vulkan device: " << name << std::endl; + std::cout << "Found suitable Vulkan device: " << props.deviceName + << std::endl; break; }