blob: b3f9c11a3c5776a5d79abfc54bf6951de30e4123 [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
37 `git clone https://android.googlesource.com/platform/external/deqp`
38
3913. Get dEQP's dependencies. In your dEQP root directory, open 'cmd' and run:
40
41 `python external\fetch_sources.py`
42
4314. Get Cherry (either in 'cmd' or by using TortoiseGit):
44
45 `git clone https://android.googlesource.com/platform/external/cherry`
46
4715. Set environment variable (see point 9):
48
49 Add new variable GOPATH='`<path to cherry>`'
50
51Building the code
52-----------------
53
5416. Build dEQP's Visual Studio files using the CMake GUI, or, in the dEQP root dir, run:
55 ```
Ben Claytond9ce2582019-02-06 11:54:15 +000056 mkdir build
Nicolas Capensfe5861b2018-08-03 16:01:48 -040057 cd build
Sean Risserbd3af852019-04-03 11:39:57 -040058 cmake .. -G "Visual Studio 15 2017 Win64"
Nicolas Capensfe5861b2018-08-03 16:01:48 -040059 ```
60 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:
61
Sean Risserbd3af852019-04-03 11:39:57 -040062 `cmake .. -G "Visual Studio <version> Win64"`
Nicolas Capensfe5861b2018-08-03 16:01:48 -040063
64 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.
65
6617. Build dEQP:
67
68 Open `<path to dEQP>\build\dEQP-Core-default.sln` in Visual Studio and Build Solution
69
70 Note: Choose a 'Release' build, unless you really mean to debug dEQP
71
7218. Generate test cases:
73 ```
74 mkdir <path to cherry>\data
75 cd <path to dEQP>
76 python scripts\build_caselists.py <path to cherry>\data
77 ```
78
Sean Risserbd3af852019-04-03 11:39:57 -040079 Note: you need to run `python scripts\build_caselists.py <path to cherry>\data` every time you update dEQP.
80
Nicolas Capensfe5861b2018-08-03 16:01:48 -040081Preparing the server
82--------------------
83
8419. Edit `<path to cherry>\cherry\data.go`
Nicolas Capens9b493552018-11-23 10:29:44 -050085* Search for `../candy-build/deqp-wgl` and replace that by `<path to deqp>/build`
Nicolas Capensfe5861b2018-08-03 16:01:48 -040086* Just above, add an option to CommandLine: `--deqp-gl-context-type=egl`
87* Just below, modify the BinaryPath from 'Debug' to 'Release' if you did a Release build at step 17
88
89Testing OpenGL ES
90-----------------
91
Dan Sinclair1b8cd2d2019-03-14 10:51:05 -04009220. a) Assuming you already built SwiftShader in the `build` folder, copy these two files:
Nicolas Capensfe5861b2018-08-03 16:01:48 -040093
Ben Claytond9ce2582019-02-06 11:54:15 +000094 `libEGL.dll`\
Nicolas Capens9b493552018-11-23 10:29:44 -050095 `libGLESv2.dll`
Nicolas Capensfe5861b2018-08-03 16:01:48 -040096
97 From:
98
Dan Sinclair1b8cd2d2019-03-14 10:51:05 -040099 `<path to SwiftShader>\build\Release_x64` or\
100 `<path to SwiftShader>\build\Debug_x64`
Nicolas Capensfe5861b2018-08-03 16:01:48 -0400101
102 To:
103
104 `<path to dEQP>\build\modules\gles3\Release` (Again, assuming you did a Release build at step 17)
105
Nicolas Capens9b493552018-11-23 10:29:44 -0500106Testing Vulkan
107--------------
108
10920. b) Assuming you already built SwiftShader, copy and rename this file:
110
Dan Sinclair1b8cd2d2019-03-14 10:51:05 -0400111 `<path to SwiftShader>\build\Release_x64\vk_swiftshader.dll` or\
112 `<path to SwiftShader>\build\Debug_x64\vk_swiftshader.dll`
Nicolas Capens9b493552018-11-23 10:29:44 -0500113
114 To:
115
116 `<path to dEQP>\build\external\vulkancts\modules\vulkan\vulkan-1.dll`
117
118 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.
119
120 To use SwiftShader as an [Installable Client Driver](https://github.com/KhronosGroup/Vulkan-Loader/blob/master/loader/LoaderAndLayerInterface.md#installable-client-drivers) (ICD) instead:
121 * Edit environment variables:
122 * Define VK_ICD_FILENAMES to `<path to SwiftShader>\src\Vulkan\vk_swiftshader_icd.json`
123 * 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.
124
Nicolas Capensfe5861b2018-08-03 16:01:48 -0400125Running the tests
126-----------------
127
12821. Start the test server. Go to `<path to cherry>` and run:
129
130 `go run server.go`
131
13222. Open your favorite browser and navigate to `localhost:8080`
133
134 Get Started -> Choose Device 'localhost' -> Select Tests 'dEQP-GLES3' -> Execute tests!
135
136Mustpass sets
137-------------
138
139dEQP 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.
140
Sean Risserbd3af852019-04-03 11:39:57 -0400141Linux
142-----
Nicolas Capensfe5861b2018-08-03 16:01:48 -0400143
Sean Risserbd3af852019-04-03 11:39:57 -0400144The 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 -0400145
Sean Risserbd3af852019-04-03 11:39:57 -04001461. Install the latest [Python 2.X](https://www.python.org/downloads/)
1472. Install GCC and Make. In a terminal, run:
Ben Claytond9ce2582019-02-06 11:54:15 +0000148
Sean Risserbd3af852019-04-03 11:39:57 -0400149 `sudo apt-get install gcc make`
Ben Claytond9ce2582019-02-06 11:54:15 +0000150
Sean Risserbd3af852019-04-03 11:39:57 -04001513. Install [CMake](https://cmake.org/download/)
1524. Install [Go](https://golang.org/doc/install) 32-bit (Important: must be 32 bit)
1535. Install Git. In a terminal, run:
Ben Claytond9ce2582019-02-06 11:54:15 +0000154
Sean Risserbd3af852019-04-03 11:39:57 -0400155 `sudo apt-get install git`
Ben Claytond9ce2582019-02-06 11:54:15 +0000156
Sean Risserbd3af852019-04-03 11:39:57 -04001576. Download the [Vulkan SDK](https://vulkan.lunarg.com/) and unpack it into a location you like.
Ben Claytond9ce2582019-02-06 11:54:15 +0000158
Sean Risserbd3af852019-04-03 11:39:57 -0400159Getting the Code
160----------------
Ben Claytond9ce2582019-02-06 11:54:15 +0000161
Sean Risserbd3af852019-04-03 11:39:57 -04001627. Get Swiftshader. In a terminal, go to the location you want to keep Swiftshader, and run:
Ben Claytond9ce2582019-02-06 11:54:15 +0000163
Sean Risserbd3af852019-04-03 11:39:57 -0400164 ```
165 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)
166 ```
Ben Claytond9ce2582019-02-06 11:54:15 +0000167
Sean Risserbd3af852019-04-03 11:39:57 -0400168 This will also install the commit hooks you need for committing to SwiftShader.
Ben Claytond9ce2582019-02-06 11:54:15 +0000169
Sean Risserbd3af852019-04-03 11:39:57 -04001708. Get dEQP:
Ben Claytond9ce2582019-02-06 11:54:15 +0000171
Sean Risserbd3af852019-04-03 11:39:57 -0400172 `git clone sso://googleplex-android/platform/external/deqp`
Ben Claytond9ce2582019-02-06 11:54:15 +0000173
Sean Risserbd3af852019-04-03 11:39:57 -04001749. Get dEQP's dependencies. In your dEQP root directory, run:
Ben Claytond9ce2582019-02-06 11:54:15 +0000175
Sean Risserbd3af852019-04-03 11:39:57 -0400176 `python external/fetch_sources.py`
Ben Claytond9ce2582019-02-06 11:54:15 +0000177
Sean Risserbd3af852019-04-03 11:39:57 -040017810. Get Cherry, similar to step 8:
Ben Claytond9ce2582019-02-06 11:54:15 +0000179
Sean Risserbd3af852019-04-03 11:39:57 -0400180 `git clone https://android.googlesource.com/platform/external/cherry`
Ben Claytond9ce2582019-02-06 11:54:15 +0000181
Sean Risserbd3af852019-04-03 11:39:57 -040018211. Set environment variable. Open ~/.bashrc in your preferred editor and add the following line:
Ben Claytond9ce2582019-02-06 11:54:15 +0000183
Sean Risserbd3af852019-04-03 11:39:57 -0400184 GOPATH='`<path to cherry>`'
Ben Claytond9ce2582019-02-06 11:54:15 +0000185
Sean Risserbd3af852019-04-03 11:39:57 -0400186Building the code
187-----------------
Ben Claytond9ce2582019-02-06 11:54:15 +0000188
Sean Risserbd3af852019-04-03 11:39:57 -040018912. Build Swiftshader. In the Swiftshader root dir, run:
190 ```
191 cd build
192 cmake ..
193 make --jobs=$(nproc)
194 ```
Ben Claytond9ce2582019-02-06 11:54:15 +0000195
Sean Risserbd3af852019-04-03 11:39:57 -040019613. Set your environment variables. In the terminal in which you'll be building dEQP, run the following commands:
197
198 ```
199 export LD_LIBRARY_PATH="<Vulkan SDK location>/x86_64/lib:$LD_LIBRARY_PATH"
200 export LD_LIBRARY_PATH="<Swiftshader location>/build:$LD_LIBRARY_PATH"
201 ```
202
203 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.
204
20514. Build dEQP. In the dEQP root dir, run:
206 ```
207 mkdir build
208 cd build
209 cmake ..
210 make --jobs=$(nproc)
211 ```
212
213 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.
214
21515. Generate test cases:
216 ```
217 mkdir <path to cherry>/data
218 cd <path to dEQP>
219 python scripts/build_caselists.py <path to cherry>/data
220 ```
221
222 Note: you need to run `python scripts/build_caselists.py <path to cherry>/data` every time you update dEQP.
223
224Preparing the server
225--------------------
226
22716. Edit `<path to cherry>/cherry/data.go`
228* Search for ".exe" and remove all instances.
229* Search for `../candy-build/deqp-wgl/execserver/Release` and replace that by `<path to deqp>/build/execserver/`
230* Just above, add an option to CommandLine: `--deqp-gl-context-type=egl`
231* Just below, remove 'Debug/' from the BinaryPath.
232
233Testing OpenGL ES
234-----------------
235
23617. a) Assuming you setup the LD_LIBRARY_PATH environment variable prior to running CMake in the dEQP build directory, you're all set.
237
238Testing Vulkan
239--------------
240
24117. 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`:
242
243 `export VK_ICD_FILENAMES="<path to SwiftShader>/build/Linux/vk_swiftshader_icd.json"`
244
245 Then run `source ~/.bashrc` the terminal(s) you'll be running tests from.
246
247
248Running the tests
249-----------------
250
25118. Start the test server. Go to `<path to cherry>` and run:
252
253 `go run server.go`
254
25519. Open your favorite browser and navigate to `localhost:8080`
256
257 Get Started -> Choose Device 'localhost' -> Select Tests 'dEQP-GLES3' -> Execute tests!
258
25920. 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.
260
26121. If you want to run Vulkan tests in the command line, go to the build directory in dEQP root. Then run the following command:
262
263 `external/vulkanacts/modules/vulkan/deqp-vk`
264
265 You can also run individual tests with:
266
267 `external/vulkanacts/modules/vulkan/deqp-vk --deqp-case=<test name>`
268
269 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.
270
27122. To check that you're running SwiftShader in cherry, start the server
272
273Mustpass sets
274-------------
275
276dEQP 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.