• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

data/vulkan/23-Nov-2023-197,554151,375

doc/23-Nov-2023-397287

framework/vulkan/23-Nov-2023-81,54070,069

modules/vulkan/23-Nov-2023-623,142495,798

mustpass/23-Nov-2023-528439

scripts/23-Nov-2023-18,62015,535

LICENSED23-Nov-202311.1 KiB203169

README.mdD23-Nov-202317.1 KiB499327

README.md

1Vulkan CTS README
2=================
3
4This document describes how to build and run Vulkan Conformance Test suite.
5
6Vulkan CTS is built on dEQP framework. dEQP documentation is available
7at http://source.android.com/devices/graphics/testing.html
8
9
10Requirements
11------------
12
13### Common
14
15The following tools must be installed and present in the PATH variable:
16
17 * Git (for checking out sources)
18 * Python 3.x (for the build related scripts, some other scripts still use Python 2.7.x)
19 * CMake 3.10.2 or newer
20
21### Win32
22
23 * Visual Studio 2015 or newer (glslang uses several C++11 features)
24
25### Linux
26
27 * Standard toolchain (make, gcc/clang)
28 * If you have X11 installed, then the build assumes you also have the `GL/glx.h` header
29   file.
30    * You can get this from the `mesa-common-dev` Ubuntu package.
31
32### Android
33
34 * Android NDK r17c or later.
35 * Android SDK with: SDK Tools, SDK Platform-tools, SDK Build-tools, and API 28
36 * Java Development Kit (JDK)
37 * Windows: either NMake or Ninja in PATH
38
39If you have downloaded the Android SDK command line tools package (25.2.3 or higher) then
40you can install the necessary components by running:
41
42	tools/bin/sdkmanager tools platform-tools 'build-tools;25.0.2' 'platforms;android-28'
43
44
45Building CTS
46------------
47
48To build dEQP, you need first to download sources for zlib, libpng, glslang,
49spirv-headers, and spirv-tools.
50
51To download sources, run:
52
53	python external/fetch_sources.py
54
55You may need to re-run `fetch_sources.py` to update to the latest glslang and
56spirv-tools revisions occasionally.
57
58With CMake out-of-source builds are always recommended. Create a build directory
59of your choosing, and in that directory generate Makefiles or IDE project
60using cmake.
61
62
63### Windows x86-32
64
65	cmake <path to vulkancts> -G"Visual Studio 14"
66	start dEQP-Core-default.sln
67
68### Windows x86-64
69
70	cmake <path to vulkancts> -G"Visual Studio 14 Win64"
71	start dEQP-Core-default.sln
72
73### Linux 32-bit Debug
74
75	cmake <path to vulkancts> -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32
76	make -j
77
78Release build can be done by using -DCMAKE_BUILD_TYPE=Release
79
80If building for 32-bit x86 with GCC, you probably also want to add `-msse2
81-mfpmath=sse` to ensure that you get correct IEEE floating-point behavior.
82
83### Linux 64-bit Debug
84
85	cmake <path to vulkancts> -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS=-m64 -DCMAKE_CXX_FLAGS=-m64
86	make -j
87
88### Android
89
90Following command will build dEQP.apk:
91
92	python scripts/android/build_apk.py --sdk <path to Android SDK> --ndk <path to Android NDK>
93
94By default the CTS package will be built for the Android API level 28.
95Another API level may be supplied using --native-api command line option.
96
97The package can be installed by either running:
98
99	python scripts/android/install_apk.py
100
101By default the CTS package will contain libdeqp.so built for armeabi-v7a, arm64-v8a,
102x86, and x86_64 ABIs, but that can be changed at build time by passing the --abis command line
103option to `scripts/android/build_apk.py`.
104
105To pick which ABI to use at _install time_, use the following command instead:
106
107	adb install -g --abi <ABI name> <build-root>/package/dEQP.apk
108
109
110Building Mustpass
111-----------------
112
113Current mustpass is checked into repository and can be found at:
114
115	external/vulkancts/mustpass/master/vk-default.txt
116
117Vulkan CTS mustpass can be re-generated by running:
118
119	python <vulkancts>/external/vulkancts/scripts/build_mustpass.py
120
121
122Running CTS
123-----------
124
125Following command line options MUST be used when running CTS:
126
127	--deqp-caselist-file=<vulkancts>/external/vulkancts/mustpass/master/vk-default.txt
128	--deqp-log-images=disable
129	--deqp-log-shader-sources=disable
130
131In addition on multi-device systems the device for which conformance is claimed
132can be selected with:
133
134	--deqp-vk-device-id=<value>
135
136To speed up the conformance run on some platforms the following command line
137option may be used to disable frequent fflush() calls to the output logs:
138
139	--deqp-log-flush=disable
140
141By default, the test log will be written into the path "TestResults.qpa". If the
142platform requires a different path, it can be specified with:
143
144	--deqp-log-filename=<path>
145
146By default, the CTS will expect to find its test resource files in the current
147working directory. This can be overridden with:
148
149	--deqp-archive-dir=<path>
150
151By default, the shader cache will be written into the path "shadercache.bin". If the
152platform requires a different path, it can be specified with:
153
154	--deqp-shadercache-filename=<path>
155
156If the shader cache is not desired, it can be disabled with:
157
158	--deqp-shadercache=disable
159
160CTS execution may be split into N fractions ( for the purpose of running it in parallel ) using
161
162	--deqp-fraction=I,N
163
164where I denotes index of current CTS execution ( I=[0..N-1], N=[1..8] )
165
166When collecting results for a Conformance Submission Package the number of fractions must not exceed 8,
167and a list of mandatory information tests for each fraction must be supplied:
168
169	--deqp-fraction-mandatory-caselist-file=<vulkancts>external/vulkancts/mustpass/master/vk-fraction-mandatory-tests.txt
170
171To specify file containing waived tests that are omitted only by specified vendor and renderer/device
172the following command line option may be used:
173
174	--deqp-waiver-file=<path>
175
176Some CTS tests use third-party runners. By default all tests are executed
177regardless of runner type (`any`). To exclude all tests using any of the
178external runners (`none`) or to only include tests using a certain runner:
179
180	--deqp-runner-type=(any|none|amber)
181
182No other command line options are allowed.
183
184### Win32
185
186	cd <builddir>/external/vulkancts/modules/vulkan
187	Debug\deqp-vk.exe --deqp-caselist-file=...
188
189Test log will be written into TestResults.qpa
190
191### Linux
192
193	cd <builddir>/external/vulkancts/modules/vulkan
194	./deqp-vk --deqp-caselist-file=...
195
196### Android
197
198	adb push <vulkancts>/external/vulkancts/mustpass/master/vk-default.txt /sdcard/vk-default.txt
199	adb shell
200
201In device shell:
202
203	am start -n com.drawelements.deqp/android.app.NativeActivity -e cmdLine "deqp --deqp-caselist-file=/sdcard/vk-default.txt --deqp-log-images=disable --deqp-log-shader-sources=disable --deqp-log-filename=/sdcard/TestResults.qpa"
204
205Test progress will be written to device log and can be displayed with:
206
207	adb logcat -s dEQP
208
209Test log will be written into `/sdcard/TestResults.qpa`.
210
211
212Conformance Submission Package Requirements
213-------------------------------------------
214
215The conformance submission package must contain the following:
216
2171. Full test logs (`TestResults.qpa`) from CTS runs against all driver builds and all fractions
2182. Result of `git status` and `git log` from CTS source directory
2193. Any patches used on top of release tag
2204. Conformance statement
221
222Test logs (1) should be named `<submission pkg dir>/TestResults-<driver build type>-<fraction id>-of-<total fractions>.qpa`,
223for example `TestResults-armeabi-v7a-1-of-8.qpa`. On platforms where multiple different driver
224builds (for example 64-bit and 32-bit) are present, CTS logs must be provided
225for each driver build as part of the submission package. If CTS run was split into multiple
226fractions then result files for all fractions must be provided, each file must
227contain results of the mandatory information tests.
228
229Fractions may be run on different physical devices but each device must represent
230the same Conformant Product.
231
232Test logs generated on a system which exposes more than one physical device
233in a device group can be used for products that expose one or more physical
234devices in their device group.
235
236The CTS build must always be done from clean git repository that doesn't have any
237uncommitted changes. Thus it is necessary to run and capture output of `git
238status` and `git log` (2) in the source directory:
239
240	git status > <submission pkg dir>/git-status.txt
241	git log --first-parent <release tag>^..HEAD > <submission pkg dir>/git-log.txt
242
243Any changes made to CTS must be committed to the local repository, and provided
244as part of the submission package (3). This can be done by running:
245
246	git format-patch -o <submission pkg dir> <release tag>..HEAD
247
248Changes to platform-specific code (mostly under `framework/platform`)
249are allowed. The commit message for each change must include a clear
250description of the change and why it is necessary.
251
252Bugfixes to the tests are allowed. Before being used for a submission,
253bugfixes must be accepted and merged into the CTS repository.
254`git cherry-pick` is strongly recommended as a method of applying bug fixes.
255
256Other changes must be accompanied by a waiver (see below).
257
258NOTE: When cherry-picking patches on top of release tag, please use `git cherry-pick -x`
259to include original commit hash in the commit message.
260
261Conformance statement (4) must be included in a file called `STATEMENT-<adopter>`
262and must contain following:
263
264	CONFORM_VERSION:         <git tag of CTS release>
265	PRODUCT:                 <string-value>
266	CPU:                     <string-value>
267	OS:                      <string-value>
268
269Note that product/cpu/os information is also captured in `dEQP-VK.info.*` tests
270if `vk::Platform::describePlatform()` is implemented.
271
272If the submission package covers multiple products, you can list them by appending
273additional `PRODUCT:` lines to the conformance statement. For example:
274
275	CONFORM_VERSION:         vulkan-cts-1.2.6.0
276	PRODUCT:                 Product A
277	PRODUCT:                 Product B
278	...
279
280The actual submission package consists of the above set of files which must
281be bundled into a gzipped tar file named `VK<API major><API minor>_<adopter><_info>.tgz`.
282`<API major>` is the major version of the Vulkan API specification, `<API minor>`is the minor
283version of the Vulkan API specification.
284`<adopter>` is the name of the Adopting member company, or some recognizable abbreviation.
285The `<_info>` field is optional. It may be used to uniquely identify a submission
286by OS, platform, date, or other criteria when making multiple submissions.
287For example, a company XYZ may make a submission for a Vulkan 1.1 implementation named
288`VK11_XYZ_PRODUCTA_Windows10.tgz`
289
290One way to create a suiteable gzipped tar file is to execute the command:
291
292	tar -cvzf <filename.tgz> -C <submission pkg dir> .
293
294where `<submission pkg dir>` is the directory containing the files from (1)-(4)
295from above. A submission package must contain all of the files listed above,
296and only those files.
297
298As an example submission package could contain:
299
300	STATEMENT-Khronos
301	git-log.txt
302	git-status.txt
303	0001-Remove-Waived-Filtering-Tests.patch
304	0002-Fix-Pipeline-Parameters.patch
305	TestResults-armeabi-v7a.qpa
306	TestResults-arm64-v8a.qpa
307
308
309Waivers
310-------
311
312The process for requesting a waiver is to report the issue by filing a bug
313report in the Gitlab VulkanCTS project (TODO Github?). When creating the
314submission package, include references to the waiver in the commit message of
315the relevant change. Including as much information as possible in your bug
316report (including a unified diff or a merge request of suggested file changes)
317will ensure the issue can be progressed as rapidly as possible. Issues must
318be labeled "Waiver" (TODO!) and identify the version of the CTS and affected
319tests.
320
321Conformance Criteria
322--------------------
323
324Conformance run is considered passing if all tests finish with allowed result
325codes. Test results are contained in the TestResults.qpa log. Each
326test case section contains XML tag Result, for example:
327
328	<Result StatusCode="Pass">Not validated</Result>
329
330The result code is the value of the StatusCode attribute. Following status
331codes are allowed:
332
333	Pass
334	NotSupported
335	QualityWarning
336	CompatibilityWarning
337	Waiver
338
339Submission package can be verified using `verify_submission.py`
340script located in [VK-GL-CTS-Tools](https://github.com/KhronosGroup/VK-GL-CTS-Tools).
341
342Vulkan platform port
343--------------------
344
345Vulkan support from Platform implementation requires providing
346`getVulkanPlatform()` method in `tcu::Platform` class implementation.
347
348See `framework/common/tcuPlatform.hpp` and examples in
349`framework/platform/win32/tcuWin32Platform.cpp` and
350`framework/platform/android/tcuAndroidPlatform.cpp`.
351
352If any WSI extensions are supported, platform port must also implement
353methods for creating native display (`vk::Platform::createWsiDisplay`)
354and window handles (`vk::wsi::Display::createWindow`). Otherwise tests
355under `dEQP-VK.wsi` will fail.
356
357
358Null (dummy) driver
359-------------------
360
361For testing and development purposes it might be useful to be able to run
362tests on dummy Vulkan implementation. One such implementation is provided in
363vkNullDriver.cpp. To use that, implement `vk::Platform::createLibrary()` with
364`vk::createNullDriver()`.
365
366
367Validation Layers
368-----------------
369
370Vulkan CTS framework includes first-party support for validation layers, that
371can be turned on with `--deqp-validation=enable` command line option.
372
373When validation is turned on, default instance and device will be created with
374validation layers enabled and debug callback is registered to record any
375messages. Debug messages collected during test execution will be included at
376the end of the test case log.
377
378In addition, when the `--deqp-print-validation-errors` command line option is
379used, validation errors are additionally printed to standard error in the
380moment they are generated.
381
382If any validation errors are found, test result will be set to `InternalError`.
383
384By default `VK_DEBUG_REPORT_INFORMATION_BIT_EXT` and `_DEBUG_BIT_EXT` messages
385are excluded from the log, but that can be customized by modifying
386`vk::DebugReportMessage::shouldBeLogged()` in `vkDebugReportUtil.hpp`.
387
388On the Android target, layers can be added to the APK during the build process
389by setting the `--layers-path` command line option to point into the NDK or to
390a locally-built layers tree. The layers are expected to be found under $abi/
391under the layers path.
392
393
394Cherry GUI
395----------
396
397Vulkan test module can be used with Cherry (GUI for test execution and
398analysis). Cherry is available at
399https://android.googlesource.com/platform/external/cherry. Please follow
400instructions in README to get started.
401
402Before first launch, and every time test hierarchy has been modified, test
403case list must be refreshed by running:
404
405	python scripts/build_caselists.py path/to/cherry/data
406
407Cherry must be restarted for the case list update to take effect.
408
409
410Shader Optimizer
411----------------
412
413Vulkan CTS can be optionally run with the shader optimizer enabled. This
414is an experimental feature which can be used to further stress both the
415drivers as well as the optimizer itself. The shader optimizer is disabled
416by default.
417
418The following command line options can be used to configure the shader
419optimizer:
420
421	--deqp-optimization-recipe=<number>
422
423The list of the optimization recipes can be found and customized in the
424`optimizeCompiledBinary()` function in `vkPrograms.cpp`.
425
426As of this writing, there are 2 recipes to choose from:
427
428	0. Disabled (default)
429	1. Optimize for performance
430	2. Optimize for size
431
432The performance and size optimization recipes are defined by the spir-v
433optimizer, and will change from time to time as the optimizer matures.
434
435	--deqp-optimize-spirv=enable
436
437This option is not required to run the optimizer. By default, the shader
438optimizer only optimizes shaders generated from GLSL or HLSL, and leaves
439hand-written SPIR-V shaders alone.
440
441Many of the hand-written SPIR-V tests stress specific features of the
442SPIR-V which might get optimized out. Using this option will enable the
443optimizer on the hand-written SPIR-V as well, which may be useful in
444finding new bugs in drivers or the optimizer itself, but will likely
445invalidate the tests themselves.
446
447
448Shader Cache
449------------
450
451The Vulkan CTS framework contains a shader cache for speeding up the running
452of the CTS. Skipping shader compilation can significantly reduce runtime,
453especially for repeated runs.
454
455Default behavior is to have the shader cache enabled, but truncated at the
456start of the CTS run. This still gives the benefit of skipping shader
457compilation for identical shaders in different tests (which there are many),
458while making sure that the shader cache file does not grow indefinitely.
459
460The shader cache identifies the shaders by hashing the shader source code
461along with various bits of information that may affect the shader compilation
462(such as shader stage, CTS version, possible compilation flags, etc). If a
463cached shader with matching hash is found, a byte-by-byte comparison of the
464shader sources is made to make sure that the correct shader is being
465retrieved from the cache.
466
467The behavior of the shader cache can be modified with the following command
468line options:
469
470	--deqp-shadercache=disable
471
472Disable the shader cache. All shaders will be compiled every time.
473
474	--deqp-shadercache-filename=<filename>
475
476Set the name of the file where the cached shaders will be stored. This
477option may be required for the shader cache to work at all on Android
478targets.
479
480	--deqp-shadercache-truncate=disable
481
482Do not truncate the shader cache file at startup. No shader compilation will
483occur on repeated runs of the CTS.
484
485
486RenderDoc
487---------
488The RenderDoc (https://renderdoc.org/) graphics debugger may be used to debug
489Vulkan tests.
490
491Following command line option should be used when launching tests from
492RenderDoc UI:
493
494	--deqp-renderdoc=enable
495
496This causes the framework to interface with the debugger and mark each dEQP
497test case as a separate 'frame', just for the purpose of capturing. The frames
498are added using RenderDoc 'In-Application API', instead of swapchain operations.
499