blob: 537f3c9a0d9597985b1cfac51d0a0b499d1441fc [file] [log] [blame] [view]
Nicolas Capensfe5861b2018-08-03 16:01:48 -04001dEQP
2====
3
Nicolas Capens75665e52022-02-04 10:34:13 -05004These steps are specifically for testing SwiftShader's Vulkan implementation using dEQP on Windows (steps for Linux below the Windows instructions).
Nicolas Capensfe5861b2018-08-03 16:01:48 -04005
6Prerequisites
7-------------
8
Nicolas Capens8875d252020-12-10 04:22:23 +000091. Install the latest [Python 3](https://www.python.org/downloads/)
Nicolas Capensfe5861b2018-08-03 16:01:48 -0400102. Install [Visual Studio](https://visualstudio.microsoft.com/vs/community/)
113. Install [CMake](https://cmake.org/download/)
Nicolas Capens8875d252020-12-10 04:22:23 +0000124. Install [Go](https://golang.org/doc/install)
135. Install [MinGW-W64](http://mingw-w64.org/doku.php/download)
14 * Select 'x86_64' as Architecture during setup
Nicolas Capensfe5861b2018-08-03 16:01:48 -0400156. Install [Git](https://git-scm.com/download/win)
Nicolas Capens75665e52022-02-04 10:34:13 -0500167. Set environment variables: Config Panel -> System and Security -> System -> Advanced system settigns -> Environment Variables
Nicolas Capensfe5861b2018-08-03 16:01:48 -040017 * Add `<path to python>` to your PATH environment variable
Nicolas Capens8875d252020-12-10 04:22:23 +000018 * Add `<path to MinGW-W64>\bin` to your PATH environment variable
Nicolas Capensfe5861b2018-08-03 16:01:48 -040019
Nicolas Capens75665e52022-02-04 10:34:13 -0500208. (Optional) Install [TortoiseGit](https://tortoisegit.org/)
Nicolas Capensfe5861b2018-08-03 16:01:48 -040021
22Getting the Code
23----------------
24
2512. Get dEQP (either in 'cmd' or by using TortoiseGit):
26
Nicolas Capens5a5ffe52019-08-09 13:12:27 -040027 `git clone https://github.com/KhronosGroup/VK-GL-CTS`
28
29 You may wish to check out a stable vulkan-cts-* branch.
Nicolas Capensfe5861b2018-08-03 16:01:48 -040030
3113. Get dEQP's dependencies. In your dEQP root directory, open 'cmd' and run:
32
Nicolas Capens8875d252020-12-10 04:22:23 +000033 `python3 external\fetch_sources.py`
Nicolas Capensfe5861b2018-08-03 16:01:48 -040034
3514. Get Cherry (either in 'cmd' or by using TortoiseGit):
36
37 `git clone https://android.googlesource.com/platform/external/cherry`
38
3915. Set environment variable (see point 9):
40
41 Add new variable GOPATH='`<path to cherry>`'
42
43Building the code
44-----------------
45
4616. Build dEQP's Visual Studio files using the CMake GUI, or, in the dEQP root dir, run:
47 ```
Ben Claytond9ce2582019-02-06 11:54:15 +000048 mkdir build
Nicolas Capensfe5861b2018-08-03 16:01:48 -040049 cd build
Nicolas Capens8875d252020-12-10 04:22:23 +000050 cmake ..
Nicolas Capensfe5861b2018-08-03 16:01:48 -040051 ```
Nicolas Capens8875d252020-12-10 04:22:23 +000052 Note: don't call 'cmake .' directly in the root directory. It will make things fails later on. If you do, simply erase the files created by CMake and follow the steps above.
Nicolas Capensfe5861b2018-08-03 16:01:48 -040053
5417. Build dEQP:
55
56 Open `<path to dEQP>\build\dEQP-Core-default.sln` in Visual Studio and Build Solution
57
Nicolas Capens75665e52022-02-04 10:34:13 -050058 Note: Choose a 'Debug' build.
Nicolas Capensfe5861b2018-08-03 16:01:48 -040059
6018. Generate test cases:
61 ```
62 mkdir <path to cherry>\data
63 cd <path to dEQP>
Nicolas Capens8875d252020-12-10 04:22:23 +000064 python3 scripts\build_caselists.py <path to cherry>\data
Nicolas Capensfe5861b2018-08-03 16:01:48 -040065 ```
66
Nicolas Capens8875d252020-12-10 04:22:23 +000067 Note: you need to run `python3 scripts\build_caselists.py <path to cherry>\data` every time you update dEQP.
Sean Risserbd3af852019-04-03 11:39:57 -040068
Nicolas Capensfe5861b2018-08-03 16:01:48 -040069Preparing the server
70--------------------
71
7219. Edit `<path to cherry>\cherry\data.go`
Nicolas Capens9b493552018-11-23 10:29:44 -050073* Search for `../candy-build/deqp-wgl` and replace that by `<path to deqp>/build`
Nicolas Capensfe5861b2018-08-03 16:01:48 -040074* Just above, add an option to CommandLine: `--deqp-gl-context-type=egl`
Nicolas Capensaf6471b2021-09-26 20:51:13 +000075* Remove `--deqp-watchdog=enable` to avoid timeouts during debugging.
Nicolas Capensfe5861b2018-08-03 16:01:48 -040076
Nicolas Capens75665e52022-02-04 10:34:13 -050077 Note: If you chose a Release build at step 17, modify the BinaryPath from 'Debug' to 'Release'.
Nicolas Capensfe5861b2018-08-03 16:01:48 -040078
Nicolas Capens9b493552018-11-23 10:29:44 -050079Testing Vulkan
80--------------
81
Nicolas Capens75665e52022-02-04 10:34:13 -05008220. Assuming you already built SwiftShader, copy and rename this file:
Nicolas Capens9b493552018-11-23 10:29:44 -050083
Dan Sinclair1b8cd2d2019-03-14 10:51:05 -040084 `<path to SwiftShader>\build\Release_x64\vk_swiftshader.dll` or\
85 `<path to SwiftShader>\build\Debug_x64\vk_swiftshader.dll`
Nicolas Capens9b493552018-11-23 10:29:44 -050086
87 To:
88
Nicolas Capens75665e52022-02-04 10:34:13 -050089 `<path to dEQP>\build\external\vulkancts\modules\vulkan\Debug\vulkan-1.dll`
Nicolas Capens9b493552018-11-23 10:29:44 -050090
91 This will cause dEQP to load SwiftShader's Vulkan implementatin directly, without going through a system-provided [loader](https://github.com/KhronosGroup/Vulkan-Loader/blob/master/loader/LoaderAndLayerInterface.md#the-loader) library or any layers.
92
Nicolas Capens75665e52022-02-04 10:34:13 -050093 This step can also be automated by setting the `SWIFTSHADER_VULKAN_API_LIBRARY_INSTALL_PATH` environment variable to a path where we'd like the drop-in API library to be installed. For example `<path to dEQP>/build/external/vulkancts/modules/vulkan/Debug/`.
94
Nicolas Capens9b493552018-11-23 10:29:44 -050095 To use SwiftShader as an [Installable Client Driver](https://github.com/KhronosGroup/Vulkan-Loader/blob/master/loader/LoaderAndLayerInterface.md#installable-client-drivers) (ICD) instead:
96 * Edit environment variables:
97 * Define VK_ICD_FILENAMES to `<path to SwiftShader>\src\Vulkan\vk_swiftshader_icd.json`
98 * If the location of `vk_swiftshader.dll` you're using is different than the one specified in `src\Vulkan\vk_swiftshader_icd.json`, modify it to point to the `vk_swiftshader.dll` file you want to use.
99
Nicolas Capensfe5861b2018-08-03 16:01:48 -0400100Running the tests
101-----------------
102
10321. Start the test server. Go to `<path to cherry>` and run:
104
105 `go run server.go`
106
10722. Open your favorite browser and navigate to `localhost:8080`
108
Nicolas Capens75665e52022-02-04 10:34:13 -0500109 Get Started -> Choose Device 'localhost' -> Select Tests 'dEQP-VK' -> Execute tests!
Nicolas Capensfe5861b2018-08-03 16:01:48 -0400110
111Mustpass sets
112-------------
113
Nicolas Capens75665e52022-02-04 10:34:13 -0500114dEQP contains more tests than what is expected to pass by a conformant implementation (e.g. some tests are considered too strict, or assume certain undefined behavior). The [android/cts/master/vk-master.txt](https://android.googlesource.com/platform/external/deqp/+/master/android/cts/master/vk-master.txt) text file which can be loaded in Cherry's 'Test sets' tab to only run the latest tests expected to pass by certified Android devices.
Nicolas Capensfe5861b2018-08-03 16:01:48 -0400115
Sean Risserbd3af852019-04-03 11:39:57 -0400116Linux
117-----
Nicolas Capensfe5861b2018-08-03 16:01:48 -0400118
Nicolas Capensaf6471b2021-09-26 20:51:13 +0000119The Linux process is similar to Windows. However it doesn't use Release or Debug variants, paths use forward slashes, and it uses shared object files instead of DLLs.
Nicolas Capensfe5861b2018-08-03 16:01:48 -0400120
Nicolas Capens8875d252020-12-10 04:22:23 +00001211. Install the latest [Python 3](https://www.python.org/downloads/)
Sean Risserbd3af852019-04-03 11:39:57 -04001222. Install GCC and Make. In a terminal, run:
Ben Claytond9ce2582019-02-06 11:54:15 +0000123
Sean Risserbd3af852019-04-03 11:39:57 -0400124 `sudo apt-get install gcc make`
Ben Claytond9ce2582019-02-06 11:54:15 +0000125
Sean Risserbd3af852019-04-03 11:39:57 -04001263. Install [CMake](https://cmake.org/download/)
Nicolas Capens8875d252020-12-10 04:22:23 +00001274. Install [Go](https://golang.org/doc/install)
Sean Risserbd3af852019-04-03 11:39:57 -04001285. Install Git. In a terminal, run:
Ben Claytond9ce2582019-02-06 11:54:15 +0000129
Sean Risserbd3af852019-04-03 11:39:57 -0400130 `sudo apt-get install git`
Ben Claytond9ce2582019-02-06 11:54:15 +0000131
Sean Risserbd3af852019-04-03 11:39:57 -04001326. Download the [Vulkan SDK](https://vulkan.lunarg.com/) and unpack it into a location you like.
Ben Claytond9ce2582019-02-06 11:54:15 +0000133
Sean Risserbd3af852019-04-03 11:39:57 -0400134Getting the Code
135----------------
Ben Claytond9ce2582019-02-06 11:54:15 +0000136
Sean Risserbd3af852019-04-03 11:39:57 -04001377. Get Swiftshader. In a terminal, go to the location you want to keep Swiftshader, and run:
Ben Claytond9ce2582019-02-06 11:54:15 +0000138
Sean Risserbd3af852019-04-03 11:39:57 -0400139 ```
140 git clone https://swiftshader.googlesource.com/SwiftShader && (cd SwiftShader && curl -Lo `git rev-parse --git-dir`/hooks/commit-msg https://gerrit-review.googlesource.com/tools/hooks/commit-msg ; chmod +x `git rev-parse --git-dir`/hooks/commit-msg)
141 ```
Ben Claytond9ce2582019-02-06 11:54:15 +0000142
Sean Risserbd3af852019-04-03 11:39:57 -0400143 This will also install the commit hooks you need for committing to SwiftShader.
Ben Claytond9ce2582019-02-06 11:54:15 +0000144
Sean Risserbd3af852019-04-03 11:39:57 -04001458. Get dEQP:
Ben Claytond9ce2582019-02-06 11:54:15 +0000146
Nicolas Capens75665e52022-02-04 10:34:13 -0500147 `git clone https://github.com/KhronosGroup/VK-GL-CTS`
Ben Claytond9ce2582019-02-06 11:54:15 +0000148
Sean Risserbd3af852019-04-03 11:39:57 -04001499. Get dEQP's dependencies. In your dEQP root directory, run:
Ben Claytond9ce2582019-02-06 11:54:15 +0000150
Nicolas Capens8875d252020-12-10 04:22:23 +0000151 `python3 external/fetch_sources.py`
Ben Claytond9ce2582019-02-06 11:54:15 +0000152
Sean Risserbd3af852019-04-03 11:39:57 -040015310. Get Cherry, similar to step 8:
Ben Claytond9ce2582019-02-06 11:54:15 +0000154
Sean Risserbd3af852019-04-03 11:39:57 -0400155 `git clone https://android.googlesource.com/platform/external/cherry`
Ben Claytond9ce2582019-02-06 11:54:15 +0000156
Sean Risserbd3af852019-04-03 11:39:57 -040015711. Set environment variable. Open ~/.bashrc in your preferred editor and add the following line:
Ben Claytond9ce2582019-02-06 11:54:15 +0000158
Sean Risserbd3af852019-04-03 11:39:57 -0400159 GOPATH='`<path to cherry>`'
Ben Claytond9ce2582019-02-06 11:54:15 +0000160
Sean Risserbd3af852019-04-03 11:39:57 -0400161Building the code
162-----------------
Ben Claytond9ce2582019-02-06 11:54:15 +0000163
Sean Risserbd3af852019-04-03 11:39:57 -040016412. Build Swiftshader. In the Swiftshader root dir, run:
165 ```
166 cd build
167 cmake ..
168 make --jobs=$(nproc)
169 ```
Ben Claytond9ce2582019-02-06 11:54:15 +0000170
Sean Risserbd3af852019-04-03 11:39:57 -040017113. Set your environment variables. In the terminal in which you'll be building dEQP, run the following commands:
172
173 ```
174 export LD_LIBRARY_PATH="<Vulkan SDK location>/x86_64/lib:$LD_LIBRARY_PATH"
175 export LD_LIBRARY_PATH="<Swiftshader location>/build:$LD_LIBRARY_PATH"
176 ```
177
Sean Risserbd3af852019-04-03 11:39:57 -040017814. Build dEQP. In the dEQP root dir, run:
179 ```
180 mkdir build
181 cd build
182 cmake ..
183 make --jobs=$(nproc)
184 ```
185
Nicolas Capens8875d252020-12-10 04:22:23 +0000186 Also: don't call 'cmake .' directly in the root directory. It will make things fails later on. If you do, simply erase the files created by CMake and follow the steps above.
Sean Risserbd3af852019-04-03 11:39:57 -0400187
18815. Generate test cases:
189 ```
190 mkdir <path to cherry>/data
191 cd <path to dEQP>
Nicolas Capens8875d252020-12-10 04:22:23 +0000192 python3 scripts/build_caselists.py <path to cherry>/data
Sean Risserbd3af852019-04-03 11:39:57 -0400193 ```
194
Nicolas Capens8875d252020-12-10 04:22:23 +0000195 Note: you need to run `python3 scripts/build_caselists.py <path to cherry>/data` every time you update dEQP.
Sean Risserbd3af852019-04-03 11:39:57 -0400196
197Preparing the server
198--------------------
199
20016. Edit `<path to cherry>/cherry/data.go`
201* Search for ".exe" and remove all instances.
Nicolas Capensaf6471b2021-09-26 20:51:13 +0000202* Search for `../candy-build/deqp-wgl/execserver/Release` and replace that by `<path to deqp>/build/execserver/execserver`
Sean Risserbd3af852019-04-03 11:39:57 -0400203* Just above, add an option to CommandLine: `--deqp-gl-context-type=egl`
204* Just below, remove 'Debug/' from the BinaryPath.
Nicolas Capensaf6471b2021-09-26 20:51:13 +0000205* Just one more line below, replace `../candy-build/deqp-wgl/` with `<path to deqp>/build/modules/${TestPackageDir}`.
206* Remove `--deqp-watchdog=enable` to avoid timeouts during debugging.
Sean Risserbd3af852019-04-03 11:39:57 -0400207
Sean Risserbd3af852019-04-03 11:39:57 -0400208Testing Vulkan
209--------------
210
Nicolas Capens75665e52022-02-04 10:34:13 -050021117. Use SwiftShader as an [Installable Client Driver](https://github.com/KhronosGroup/Vulkan-Loader/blob/master/loader/LoaderAndLayerInterface.md#installable-client-drivers) (ICD). Add the following line to your `~/.bashrc`:
Sean Risserbd3af852019-04-03 11:39:57 -0400212
213 `export VK_ICD_FILENAMES="<path to SwiftShader>/build/Linux/vk_swiftshader_icd.json"`
214
Nicolas Capens75665e52022-02-04 10:34:13 -0500215 Then run `source ~/.bashrc` in the terminal(s) you'll be running tests from.
Sean Risserbd3af852019-04-03 11:39:57 -0400216
217
218Running the tests
219-----------------
220
22118. Start the test server. Go to `<path to cherry>` and run:
222
223 `go run server.go`
224
22519. Open your favorite browser and navigate to `localhost:8080`
226
Nicolas Capens75665e52022-02-04 10:34:13 -0500227 Get Started -> Choose Device 'localhost' -> Select Tests 'dEQP-VK' -> Execute tests!
Sean Risserbd3af852019-04-03 11:39:57 -0400228
Nicolas Capens75665e52022-02-04 10:34:13 -050022920. To make sure that you're running SwiftShader's drivers, select only the dEQP-VK->info->device test. In the next window, click on these tests in the left pane. If you see SwiftShader in the deviceName field, then you've set your suite up properly.
Sean Risserbd3af852019-04-03 11:39:57 -0400230
23121. If you want to run Vulkan tests in the command line, go to the build directory in dEQP root. Then run the following command:
232
233 `external/vulkanacts/modules/vulkan/deqp-vk`
234
235 You can also run individual tests with:
236
237 `external/vulkanacts/modules/vulkan/deqp-vk --deqp-case=<test name>`
238
239 And you can find a list of the test names in `<Swiftshader root>/tests/regres/testlists/vk-master.txt` However, deqp-vk will cease upon the first failure. It's recommended that you use cherry for your testing needs unless you know what you're doing.
240
24122. To check that you're running SwiftShader in cherry, start the server
242
243Mustpass sets
244-------------
245
Nicolas Capens75665e52022-02-04 10:34:13 -0500246dEQP contains more tests than what is expected to pass by a conformant implementation (e.g. some tests are considered too strict, or assume certain undefined behavior). The [android/cts/master/vk-master.txt](https://android.googlesource.com/platform/external/deqp/+/master/android/cts/master/vk-master.txt) text file which can be loaded in Cherry's 'Test sets' tab to only run the latest tests expected to pass by certified Android devices.