You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
⚠️ Make sure to load the self validation layer **after** the validation layer you work on, by putting its name in `VK_INSTANCE_LAYERS` after the validation layer you work on. Otherwise your Vulkan calls will not be intercepted by the self validation layer.
34
+
To make sure you did it properly, you can use the environment variable `VK_LOADER_DEBUG=layer` to see how the loader sets up layers.
35
+
36
+
## We generate our SPIR-V offline
37
+
38
+
There is a `scripts/generate_spirv.py` that will take GLSL (maybe Slang in the future) and creates SPIR-V blobs baked in a C++ file. [We have more details here](../layers/gpuav/shaders/README.md)
With the `khronos_validation.gpuav_select_instrumented_shaders`/`VK_LAYER_GPUAV_SELECT_INSTRUMENTED_SHADERS` feature, an application can control which shaders are instrumented and thus, will return GPU-AV errors.
4
+
5
+
With the feature enabled, all SPIR-V will not be modified by default.
6
+
7
+
Inside your `VkShaderModuleCreateInfo` or `vkCreateShadersEXT` pass in a `VkValidationFeaturesEXT` into the `pNext` with `VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT` to have the shader instrumented.
Copy file name to clipboardExpand all lines: docs/gpu_validation.md
+32-42Lines changed: 32 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,58 +37,48 @@ There are various other feature requirements, but if not met, GPU-AV will turn o
37
37
38
38
If a feature is not enabled, we will try to enable it for you at device creation time.
39
39
40
-
## Types of GPU-AV
40
+
## Reality
41
41
42
-
GPU-AV has many things it validates, all of which have different implementation designs.
42
+
There are 5 goals we constantly think about when developing GPU-AV
43
43
44
-
TODO - Add various internal sections
44
+
1. It is fast enough to use
45
+
3. It won't crash on you
46
+
2. It is accurate (no false positive!)
47
+
4. It has good error messages
48
+
5. It actually catches your invalid code
45
49
46
-
## Selective Shader Instrumentation
50
+
The development of GPU-AV has taught us showed that to perfectly validate your GPU workload, it can be painfully slow (like multiple seconds a frame slow).
47
51
48
-
With the `khronos_validation.gpuav_select_instrumented_shaders`/`VK_LAYER_GPUAV_SELECT_INSTRUMENTED_SHADERS` feature, an application can control which shaders are instrumented and thus, will return GPU-AV errors.
52
+
There are 2 main reasons people use GPU-AV: `regression mode`and `debug mode`
49
53
50
-
With the feature enabled, all SPIR-V will not be modified by default.
54
+
### Regression Mode
51
55
52
-
Inside your `VkShaderModuleCreateInfo` or `vkCreateShadersEXT` pass in a `VkValidationFeaturesEXT` into the `pNext` with `VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT`to have the shader instrumented.
56
+
If you find yourself turning on GPU-AV all the time to "make sure no hidden issues" then this is you. You likely want to have things fast and can compromise not having have try and track multiple error in a single shader.
**Please turn off Safe Mode**, this will sacrifice performance, but GPU-AV will try to stop things from crashing. We have a way to [select the bad shader](./gpu_av_selective_shader.md) as this will **greatly** improve performance if we only need to validate a smaller surface area.
⚠️ Make sure to load the self validation layer **after** the validation layer you work on, by putting its name in `VK_INSTANCE_LAYERS` after the validation layer you work on. Otherwise your Vulkan calls will not be intercepted by the self validation layer.
94
-
To make sure you did it properly, you can use the environment variable `VK_LOADER_DEBUG=layer` to see how the loader sets up layers.
70
+
There is also a "Force robustness on" setting we provide in GPU-AV, this has 2 main purposes
71
+
72
+
1. A way for developers to toggle this on and off
73
+
2. Improve GPU-AV performance by assuming the developer relies on [robust behavior to work](https://docs.vulkan.org/guide/latest/robustness.html)
74
+
75
+
## Internal Details
76
+
77
+
The state of GPU-AV is constantly evolving as we find out what does and doesn't work.
78
+
79
+
The following are extra information around GPU-AV for those who want to know:
80
+
81
+
-[General development advice](./gpu_av_development.md)
0 commit comments