blob: ac2167b5bf40d378fc313832b4475fc1dd5d6d85 [file] [log] [blame] [view]
Nicolas Capensfe5861b2018-08-03 16:01:48 -04001dEQP
2====
3
Sean Risserbd3af852019-04-03 11:39:57 -04004These steps are specifically for testing SwiftShader's OpenGL ES 3.0 implementation using dEQP on Windows (steps for Linux below the Windows instructions).
Nicolas Capensfe5861b2018-08-03 16:01:48 -04005
6Prerequisites
7-------------
8
Nicolas Capens9b493552018-11-23 10:29:44 -050091. Install the latest [Python 2.X](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 Capens9b493552018-11-23 10:29:44 -0500124. Install [Go](https://golang.org/doc/install) 32-bit (Important: must be 32 bit)
Nicolas Capensfe5861b2018-08-03 16:01:48 -0400135. Install [MinGW](http://www.mingw.org/)
146. Install [Git](https://git-scm.com/download/win)
157. Install [Android Studio](https://developer.android.com/studio/index.html)
168. Run Android Studio and install Android SDK.
179. Set environment variables: Config Panel -> System and Security -> System -> Advanced system settigns -> Environment Variables
18 * Add `<path to python>` to your PATH environment variable
19 * Add `<path to MinGW>\bin` to your PATH environment variable
Ben Claytond9ce2582019-02-06 11:54:15 +000020 * Add `<path to adb>` to your PATH environment variable
Nicolas Capensfe5861b2018-08-03 16:01:48 -040021
22 Note: abd is in the Android SDK, typically in `C:\Users\<username>\AppData\Local\Android\sdk\platform-tools`
23
2410. Install GCC. In 'cmd', run:
25
26 `mingw-get install gcc`
27
28 Note: Using Cygwin GCC currently doesn't work.
29
3011. (Optional) Install [TortoiseGit](https://tortoisegit.org/)
31
32Getting the Code
33----------------
34
3512. Get dEQP (either in 'cmd' or by using TortoiseGit):
36
Nicolas Capens5a5ffe52019-08-09 13:12:27 -040037 `git clone https://github.com/KhronosGroup/VK-GL-CTS`
38
39 You may wish to check out a stable vulkan-cts-* branch.
Nicolas Capensfe5861b2018-08-03 16:01:48 -040040
4113. Get dEQP's dependencies. In your dEQP root directory, open 'cmd' and run:
42
43 `python external\fetch_sources.py`
44
4514. Get Cherry (either in 'cmd' or by using TortoiseGit):
46
47 `git clone https://android.googlesource.com/platform/external/cherry`
48
4915. Set environment variable (see point 9):
50
51 Add new variable GOPATH='`<path to cherry>`'
52
53Building the code
54-----------------
55
5616. Build dEQP's Visual Studio files using the CMake GUI, or, in the dEQP root dir, run:
57 ```
Ben Claytond9ce2582019-02-06 11:54:15 +000058 mkdir build
Nicolas Capensfe5861b2018-08-03 16:01:48 -040059 cd build
Sean Risserbd3af852019-04-03 11:39:57 -040060 cmake .. -G "Visual Studio 15 2017 Win64"
Nicolas Capensfe5861b2018-08-03 16:01:48 -040061 ```
62 Note: If you have multiple versions of Visual Studio installed and you want to make sure cmake is using the correct version of Visual Studio, you can specify it by calling, for example:
63
Sean Risserbd3af852019-04-03 11:39:57 -040064 `cmake .. -G "Visual Studio <version> Win64"`
Nicolas Capensfe5861b2018-08-03 16:01:48 -040065
66 Also 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.
67
6817. Build dEQP:
69
70 Open `<path to dEQP>\build\dEQP-Core-default.sln` in Visual Studio and Build Solution
71
72 Note: Choose a 'Release' build, unless you really mean to debug dEQP
73
7418. Generate test cases:
75 ```
76 mkdir <path to cherry>\data
77 cd <path to dEQP>
78 python scripts\build_caselists.py <path to cherry>\data
79 ```
80
Sean Risserbd3af852019-04-03 11:39:57 -040081 Note: you need to run `python scripts\build_caselists.py <path to cherry>\data` every time you update dEQP.
82
Nicolas Capensfe5861b2018-08-03 16:01:48 -040083Preparing the server
84--------------------
85
8619. Edit `<path to cherry>\cherry\data.go`
Nicolas Capens9b493552018-11-23 10:29:44 -050087* Search for `../candy-build/deqp-wgl` and replace that by `<path to deqp>/build`
Nicolas Capensfe5861b2018-08-03 16:01:48 -040088* Just above, add an option to CommandLine: `--deqp-gl-context-type=egl`
89* Just below, modify the BinaryPath from 'Debug' to 'Release' if you did a Release build at step 17
90
91Testing OpenGL ES
92-----------------
93
Dan Sinclair1b8cd2d2019-03-14 10:51:05 -04009420. a) Assuming you already built SwiftShader in the `build` folder, copy these two files:
Nicolas Capensfe5861b2018-08-03 16:01:48 -040095
Ben Claytond9ce2582019-02-06 11:54:15 +000096 `libEGL.dll`\
Nicolas Capens9b493552018-11-23 10:29:44 -050097 `libGLESv2.dll`
Nicolas Capensfe5861b2018-08-03 16:01:48 -040098
99 From:
100
Dan Sinclair1b8cd2d2019-03-14 10:51:05 -0400101 `<path to SwiftShader>\build\Release_x64` or\
102 `<path to SwiftShader>\build\Debug_x64`
Nicolas Capensfe5861b2018-08-03 16:01:48 -0400103
104 To:
105
106 `<path to dEQP>\build\modules\gles3\Release` (Again, assuming you did a Release build at step 17)
107
Nicolas Capens9b493552018-11-23 10:29:44 -0500108Testing Vulkan
109--------------
110
11120. b) Assuming you already built SwiftShader, copy and rename this file:
112
Dan Sinclair1b8cd2d2019-03-14 10:51:05 -0400113 `<path to SwiftShader>\build\Release_x64\vk_swiftshader.dll` or\
114 `<path to SwiftShader>\build\Debug_x64\vk_swiftshader.dll`
Nicolas Capens9b493552018-11-23 10:29:44 -0500115
116 To:
117
118 `<path to dEQP>\build\external\vulkancts\modules\vulkan\vulkan-1.dll`
119
120 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.
121
122 To use SwiftShader as an [Installable Client Driver](https://github.com/KhronosGroup/Vulkan-Loader/blob/master/loader/LoaderAndLayerInterface.md#installable-client-drivers) (ICD) instead:
123 * Edit environment variables:
124 * Define VK_ICD_FILENAMES to `<path to SwiftShader>\src\Vulkan\vk_swiftshader_icd.json`
125 * 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.
126
Nicolas Capensfe5861b2018-08-03 16:01:48 -0400127Running the tests
128-----------------
129
13021. Start the test server. Go to `<path to cherry>` and run:
131
132 `go run server.go`
133
13422. Open your favorite browser and navigate to `localhost:8080`
135
136 Get Started -> Choose Device 'localhost' -> Select Tests 'dEQP-GLES3' -> Execute tests!
137
138Mustpass sets
139-------------
140
141dEQP 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\gles3-master.txt](https://android.googlesource.com/platform/external/deqp/+/master/android/cts/master/gles3-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.
142
Sean Risserbd3af852019-04-03 11:39:57 -0400143Linux
144-----
Nicolas Capensfe5861b2018-08-03 16:01:48 -0400145
Sean Risserbd3af852019-04-03 11:39:57 -0400146The Linux process is similar to Windows. However it doesn't use Release or Debug variants and it uses shared object files instead of DLLs.
Nicolas Capensfe5861b2018-08-03 16:01:48 -0400147
Sean Risserbd3af852019-04-03 11:39:57 -04001481. Install the latest [Python 2.X](https://www.python.org/downloads/)
1492. Install GCC and Make. In a terminal, run:
Ben Claytond9ce2582019-02-06 11:54:15 +0000150
Sean Risserbd3af852019-04-03 11:39:57 -0400151 `sudo apt-get install gcc make`
Ben Claytond9ce2582019-02-06 11:54:15 +0000152
Sean Risserbd3af852019-04-03 11:39:57 -04001533. Install [CMake](https://cmake.org/download/)
1544. Install [Go](https://golang.org/doc/install) 32-bit (Important: must be 32 bit)
1555. Install Git. In a terminal, run:
Ben Claytond9ce2582019-02-06 11:54:15 +0000156
Sean Risserbd3af852019-04-03 11:39:57 -0400157 `sudo apt-get install git`
Ben Claytond9ce2582019-02-06 11:54:15 +0000158
Sean Risserbd3af852019-04-03 11:39:57 -04001596. Download the [Vulkan SDK](https://vulkan.lunarg.com/) and unpack it into a location you like.
Ben Claytond9ce2582019-02-06 11:54:15 +0000160
Sean Risserbd3af852019-04-03 11:39:57 -0400161Getting the Code
162----------------
Ben Claytond9ce2582019-02-06 11:54:15 +0000163
Sean Risserbd3af852019-04-03 11:39:57 -04001647. Get Swiftshader. In a terminal, go to the location you want to keep Swiftshader, and run:
Ben Claytond9ce2582019-02-06 11:54:15 +0000165
Sean Risserbd3af852019-04-03 11:39:57 -0400166 ```
167 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)
168 ```
Ben Claytond9ce2582019-02-06 11:54:15 +0000169
Sean Risserbd3af852019-04-03 11:39:57 -0400170 This will also install the commit hooks you need for committing to SwiftShader.
Ben Claytond9ce2582019-02-06 11:54:15 +0000171
Sean Risserbd3af852019-04-03 11:39:57 -04001728. Get dEQP:
Ben Claytond9ce2582019-02-06 11:54:15 +0000173
Sean Risserbd3af852019-04-03 11:39:57 -0400174 `git clone sso://googleplex-android/platform/external/deqp`
Ben Claytond9ce2582019-02-06 11:54:15 +0000175
Sean Risserbd3af852019-04-03 11:39:57 -04001769. Get dEQP's dependencies. In your dEQP root directory, run:
Ben Claytond9ce2582019-02-06 11:54:15 +0000177
Sean Risserbd3af852019-04-03 11:39:57 -0400178 `python external/fetch_sources.py`
Ben Claytond9ce2582019-02-06 11:54:15 +0000179
Sean Risserbd3af852019-04-03 11:39:57 -040018010. Get Cherry, similar to step 8:
Ben Claytond9ce2582019-02-06 11:54:15 +0000181
Sean Risserbd3af852019-04-03 11:39:57 -0400182 `git clone https://android.googlesource.com/platform/external/cherry`
Ben Claytond9ce2582019-02-06 11:54:15 +0000183
Sean Risserbd3af852019-04-03 11:39:57 -040018411. Set environment variable. Open ~/.bashrc in your preferred editor and add the following line:
Ben Claytond9ce2582019-02-06 11:54:15 +0000185
Sean Risserbd3af852019-04-03 11:39:57 -0400186 GOPATH='`<path to cherry>`'
Ben Claytond9ce2582019-02-06 11:54:15 +0000187
Sean Risserbd3af852019-04-03 11:39:57 -0400188Building the code
189-----------------
Ben Claytond9ce2582019-02-06 11:54:15 +0000190
Sean Risserbd3af852019-04-03 11:39:57 -040019112. Build Swiftshader. In the Swiftshader root dir, run:
192 ```
193 cd build
194 cmake ..
195 make --jobs=$(nproc)
196 ```
Ben Claytond9ce2582019-02-06 11:54:15 +0000197
Sean Risserbd3af852019-04-03 11:39:57 -040019813. Set your environment variables. In the terminal in which you'll be building dEQP, run the following commands:
199
200 ```
201 export LD_LIBRARY_PATH="<Vulkan SDK location>/x86_64/lib:$LD_LIBRARY_PATH"
202 export LD_LIBRARY_PATH="<Swiftshader location>/build:$LD_LIBRARY_PATH"
203 ```
204
205 It's important that you perform this step before you build dEQP in the next step. CMake will search for library files in LD_LIBRARY_PATH. If it cannot discover Swiftshader's libEGL and libGLESv2 shared object files, then CMake will default to using your system's libEGL.so and libGLESv2.so files.
206
20714. Build dEQP. In the dEQP root dir, run:
208 ```
209 mkdir build
210 cd build
211 cmake ..
212 make --jobs=$(nproc)
213 ```
214
215 Also 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.
216
21715. Generate test cases:
218 ```
219 mkdir <path to cherry>/data
220 cd <path to dEQP>
221 python scripts/build_caselists.py <path to cherry>/data
222 ```
223
224 Note: you need to run `python scripts/build_caselists.py <path to cherry>/data` every time you update dEQP.
225
226Preparing the server
227--------------------
228
22916. Edit `<path to cherry>/cherry/data.go`
230* Search for ".exe" and remove all instances.
231* Search for `../candy-build/deqp-wgl/execserver/Release` and replace that by `<path to deqp>/build/execserver/`
232* Just above, add an option to CommandLine: `--deqp-gl-context-type=egl`
233* Just below, remove 'Debug/' from the BinaryPath.
shrekshao5d73f032019-06-13 11:14:42 -0700234* Just one more line below, replace `../candy-build/deqp-wgl/` with `<path to deqp>/build`.
Sean Risserbd3af852019-04-03 11:39:57 -0400235
236Testing OpenGL ES
237-----------------
238
23917. a) Assuming you setup the LD_LIBRARY_PATH environment variable prior to running CMake in the dEQP build directory, you're all set.
240
241Testing Vulkan
242--------------
243
24417. b) 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`:
245
246 `export VK_ICD_FILENAMES="<path to SwiftShader>/build/Linux/vk_swiftshader_icd.json"`
247
248 Then run `source ~/.bashrc` the terminal(s) you'll be running tests from.
249
250
251Running the tests
252-----------------
253
25418. Start the test server. Go to `<path to cherry>` and run:
255
256 `go run server.go`
257
25819. Open your favorite browser and navigate to `localhost:8080`
259
260 Get Started -> Choose Device 'localhost' -> Select Tests 'dEQP-GLES3' -> Execute tests!
261
26220. To make sure that you're running SwiftShader's drivers, select only the dEQP-GLES3->info->vendor and dEQP-VK->info->platform tests. In the next window, click on these tests in the left pane. If you see Google inc for the GLES3 test and your Linux machine in the VK test, then you've set your suite up properly.
263
26421. If you want to run Vulkan tests in the command line, go to the build directory in dEQP root. Then run the following command:
265
266 `external/vulkanacts/modules/vulkan/deqp-vk`
267
268 You can also run individual tests with:
269
270 `external/vulkanacts/modules/vulkan/deqp-vk --deqp-case=<test name>`
271
272 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.
273
27422. To check that you're running SwiftShader in cherry, start the server
275
276Mustpass sets
277-------------
278
279dEQP 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\gles3-master.txt](https://android.googlesource.com/platform/external/deqp/+/master/android/cts/master/gles3-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.