Skip to content

Commit 535e916

Browse files
author
ssjia
committed
[ET-VK][ez] Make pipeline executable properties be controlled by a different macro
Prevent the following validation layer errors when building with VULKAN_DEBUG ``` Validation Error: [ VUID-VkComputePipelineCreateInfo-None-09497 ] | MessageID = 0xde3918a7 vkCreateComputePipelines(): pCreateInfos[0].flags has VkPipelineCreateFlagBits values (VK_PIPELINE_CREATE_CAPTURE_STATISTICS_BIT_KHR|VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR) that requires the extensions VK_KHR_pipeline_executable_properties. The Vulkan spec states: If the pNext chain does not include a VkPipelineCreateFlags2CreateInfo structure, flags must be a valid combination of VkPipelineCreateFlagBits values (https://vulkan.lunarg.com/doc/view/1.4.321.0/mac/antora/spec/latest/chapters/pipelines.html#VUID-VkComputePipelineCreateInfo-None-09497) Validation 0 vkCreateComputePipelines(): pCreateInfos[0].flags has VkPipelineCreateFlagBits values (VK_PIPELINE_CREATE_CAPTURE_STATISTICS_BIT_KHR|VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR) that requires the extensions VK_KHR_pipeline_executable_properties. The Vulkan spec states: If the pNext chain does not include a VkPipelineCreateFlags2CreateInfo structure, flags must be a valid combination of VkPipelineCreateFlagBits values (https://vulkan.lunarg.com/doc/view/1.4.321.0/mac/antora/spec/latest/chapters/pipelines.html#VUID-VkComputePipelineCreateInfo-None-09497) Validation Error: [ VUID-VkComputePipelineCreateInfo-None-09497 ] | MessageID = 0xde3918a7 vkCreateComputePipelines(): pCreateInfos[0].flags has VkPipelineCreateFlagBits values (VK_PIPELINE_CREATE_CAPTURE_STATISTICS_BIT_KHR|VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR) that requires the extensions VK_KHR_pipeline_executable_properties. The Vulkan spec states: If the pNext chain does not include a VkPipelineCreateFlags2CreateInfo structure, flags must be a valid combination of VkPipelineCreateFlagBits values (https://vulkan.lunarg.com/doc/view/1.4.321.0/mac/antora/spec/latest/chapters/pipelines.html#VUID-VkComputePipelineCreateInfo-None-09497) Validation 0 vkCreateComputePipelines(): pCreateInfos[0].flags has VkPipelineCreateFlagBits values (VK_PIPELINE_CREATE_CAPTURE_STATISTICS_BIT_KHR|VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR) that requires the extensions VK_KHR_pipeline_executable_properties. The Vulkan spec states: If the pNext chain does not include a VkPipelineCreateFlags2CreateInfo structure, flags must be a valid combination of VkPipelineCreateFlagBits values (https://vulkan.lunarg.com/doc/view/1.4.321.0/mac/antora/spec/latest/chapters/pipelines.html#VUID-VkComputePipelineCreateInfo-None-09497) ``` Differential Revision: [D84716453](https://our.internmc.facebook.com/intern/diff/D84716453/) [ghstack-poisoned]
1 parent 0239e6e commit 535e916

File tree

5 files changed

+15
-18
lines changed

5 files changed

+15
-18
lines changed

backends/vulkan/runtime/api/Context.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,8 @@ Context* context() {
288288
return context.get();
289289
}
290290

291-
#ifdef VULKAN_DEBUG
292-
293-
#ifdef VK_KHR_pipeline_executable_properties
291+
#if defined(VK_KHR_pipeline_executable_properties) && \
292+
defined(ETVK_INSPECT_PIPELINES)
294293

295294
VkPipeline Context::get_shader_pipeline(
296295
const vkapi::ShaderInfo& shader,
@@ -502,9 +501,7 @@ void Context::print_shader_executable_properties(
502501
}
503502
}
504503

505-
#endif // VK_KHR_pipeline_executable_properties
506-
507-
#endif // VULKAN_DEBUG
504+
#endif // VK_KHR_pipeline_executable_properties && ETVK_INSPECT_PIPELINES
508505

509506
} // namespace api
510507
} // namespace vkcompute

backends/vulkan/runtime/api/Context.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,8 @@ class Context final {
234234

235235
void flush();
236236

237-
#ifdef VULKAN_DEBUG
238-
239-
#ifdef VK_KHR_pipeline_executable_properties
237+
#if defined(VK_KHR_pipeline_executable_properties) && \
238+
defined(ETVK_INSPECT_PIPELINES)
240239

241240
VkPipeline get_shader_pipeline(
242241
const vkapi::ShaderInfo& shader,
@@ -260,9 +259,7 @@ class Context final {
260259
const vkapi::ShaderInfo& shader,
261260
const vkapi::SpecVarList& spec_constants);
262261

263-
#endif // VK_KHR_pipeline_executable_properties
264-
265-
#endif // VULKAN_DEBUG
262+
#endif // VK_KHR_pipeline_executable_properties && ETVK_INSPECT_PIPELINES
266263
};
267264

268265
bool available();

backends/vulkan/runtime/vk_api/Adapter.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,10 @@ VkDevice create_logical_device(
113113
#ifdef VK_KHR_shader_integer_dot_product
114114
VK_KHR_SHADER_INTEGER_DOT_PRODUCT_EXTENSION_NAME,
115115
#endif /* VK_KHR_shader_integer_dot_product */
116-
#if defined(VK_KHR_pipeline_executable_properties) && defined(VULKAN_DEBUG)
116+
#if defined(VK_KHR_pipeline_executable_properties) && \
117+
defined(ETVK_INSPECT_PIPELINES)
117118
VK_KHR_PIPELINE_EXECUTABLE_PROPERTIES_EXTENSION_NAME,
118-
#endif /* VK_KHR_pipeline_executable_properties */
119+
#endif /* VK_KHR_pipeline_executable_properties && ETVK_INSPECT_PIPELINES */
119120
};
120121

121122
std::vector<const char*> enabled_device_extensions;

backends/vulkan/runtime/vk_api/Pipeline.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,11 @@ ComputePipeline::ComputePipeline(
298298
};
299299

300300
VkPipelineCreateFlags flags = 0u;
301-
#if defined(VULKAN_DEBUG) && defined(VK_KHR_pipeline_executable_properties)
301+
#if defined(VK_KHR_pipeline_executable_properties) && \
302+
defined(ETVK_INSPECT_PIPELINES)
302303
flags = VK_PIPELINE_CREATE_CAPTURE_STATISTICS_BIT_KHR |
303304
VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR | flags;
304-
#endif /* VULKAN_DEBUG && VK_KHR_pipeline_executable_properties */
305+
#endif // VK_KHR_pipeline_executable_properties && ETVK_INSPECT_PIPELINES
305306

306307
const VkComputePipelineCreateInfo compute_pipeline_create_info{
307308
VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO, // sType

backends/vulkan/test/vulkan_compute_api_test.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,15 @@ TEST_F(VulkanComputeAPITest, print_adapter) {
102102
std::cout << *(context()->adapter_ptr()) << std::endl;
103103
}
104104

105-
#if defined(VULKAN_DEBUG) && defined(VK_KHR_pipeline_executable_properties)
105+
#if defined(VK_KHR_pipeline_executable_properties) && \
106+
defined(ETVK_INSPECT_PIPELINES)
106107

107108
TEST_F(VulkanComputeAPITest, print_shader_executable_properties) {
108109
context()->print_shader_executable_properties(
109110
VK_KERNEL(binary_add_nobroadcast__test_half), {0});
110111
}
111112

112-
#endif // VULKAN_DEBUG && VK_KHR_pipeline_executable_properties
113+
#endif // VK_KHR_pipeline_executable_properties && ETVK_INSPECT_PIPELINES
113114

114115
std::vector<int64_t> get_reference_strides(
115116
const std::vector<int64_t>& sizes,

0 commit comments

Comments
 (0)