Skip to content

Commit

Permalink
[NFC][SYCL Bindless] Fix device and layer in vulkan_interop tests for…
Browse files Browse the repository at this point in the history
… intel gpu (intel#14210)

Add 'Intel' to device search. Check if VK_LAYER_KHRONOS_validation
exists since it doesn't exist on a DG2 linux machine.
  • Loading branch information
wenju-he authored Jun 24, 2024
1 parent 9800153 commit f917e3b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
6 changes: 5 additions & 1 deletion sycl/test-e2e/bindless_images/vulkan_interop/mipmaps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,11 @@ int main() {
return EXIT_FAILURE;
}

if (vkutil::setupDevice("NVIDIA") != VK_SUCCESS) {
const char *devices[] = {"Intel", "NVIDIA"};
if (std::none_of(std::begin(devices), std::end(devices),
[](const char *device) {
return vkutil::setupDevice(device) == VK_SUCCESS;
})) {
std::cerr << "Device setup failed!\n";
return EXIT_FAILURE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,11 @@ int main() {
return EXIT_FAILURE;
}

if (vkutil::setupDevice("NVIDIA") != VK_SUCCESS) {
const char *devices[] = {"Intel", "NVIDIA"};
if (std::none_of(std::begin(devices), std::end(devices),
[](const char *device) {
return vkutil::setupDevice(device) == VK_SUCCESS;
})) {
std::cerr << "Device setup failed!\n";
return EXIT_FAILURE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -621,8 +621,11 @@ int main() {
return EXIT_FAILURE;
}

// Currently only Nvidia devices are tested
if (vkutil::setupDevice("NVIDIA") != VK_SUCCESS) {
const char *devices[] = {"Intel", "NVIDIA"};
if (std::none_of(std::begin(devices), std::end(devices),
[](const char *device) {
return vkutil::setupDevice(device) == VK_SUCCESS;
})) {
std::cerr << "Device setup failed!\n";
return EXIT_FAILURE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,13 @@ VkResult setupInstance() {
ci.pApplicationInfo = &ai;
ci.enabledExtensionCount = requiredInstanceExtensions.size();
ci.ppEnabledExtensionNames = requiredInstanceExtensions.data();
std::vector<const char *> layers = {"VK_LAYER_KHRONOS_validation"};
std::vector<const char *> layers;
if (std::any_of(availableLayers.begin(), availableLayers.end(),
[](auto &layer) {
return layer.layerName == "VK_LAYER_KHRONOS_validation";
})) {
layers.push_back("VK_LAYER_KHRONOS_validation");
}
ci.enabledLayerCount = layers.size();
ci.ppEnabledLayerNames = layers.data();

Expand Down

0 comments on commit f917e3b

Please sign in to comment.