external/swiftshader
Revision | bd3af855ae74d9767eb68adcdd1a66c29dc1d81e (tree) |
---|---|
Time | 2019-04-05 22:51:27 |
Author | Sean Risser <srisser@goog...> |
Commiter | Sean Risser |
Improve the dEQP documentation for Linux.
The original dEQP.md covered Windows pretty well, but was confusing to
follow on Linux. So I've fleshed out the Linux process to be as complete
as the Windows process.
Change-Id: I8373e56db7d8d74bf5bcdfc7c7d23b740a11c25a
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28369
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Sean Risser <srisser@google.com>
@@ -1,7 +1,7 @@ | ||
1 | 1 | dEQP |
2 | 2 | ==== |
3 | 3 | |
4 | -These steps are specifically for testing SwiftShader's OpenGL ES 3.0 implementation using dEQP on Windows (Linux differences at the bottom). | |
4 | +These steps are specifically for testing SwiftShader's OpenGL ES 3.0 implementation using dEQP on Windows (steps for Linux below the Windows instructions). | |
5 | 5 | |
6 | 6 | Prerequisites |
7 | 7 | ------------- |
@@ -55,11 +55,11 @@ Building the code | ||
55 | 55 | ``` |
56 | 56 | mkdir build |
57 | 57 | cd build |
58 | - cmake .. | |
58 | + cmake .. -G "Visual Studio 15 2017 Win64" | |
59 | 59 | ``` |
60 | 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 | 61 | |
62 | - `cmake .. -G "Visual Studio 15 2017 Win64"` | |
62 | + `cmake .. -G "Visual Studio <version> Win64"` | |
63 | 63 | |
64 | 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 | 65 |
@@ -76,6 +76,8 @@ Building the code | ||
76 | 76 | python scripts\build_caselists.py <path to cherry>\data |
77 | 77 | ``` |
78 | 78 | |
79 | + Note: you need to run `python scripts\build_caselists.py <path to cherry>\data` every time you update dEQP. | |
80 | + | |
79 | 81 | Preparing the server |
80 | 82 | -------------------- |
81 | 83 |
@@ -136,53 +138,139 @@ Mustpass sets | ||
136 | 138 | |
137 | 139 | dEQP 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. |
138 | 140 | |
139 | -Running dEQP on Linux | |
140 | ---------------------- | |
141 | +Linux | |
142 | +----- | |
143 | + | |
144 | +The Linux process is similar to Windows. However it doesn't use Release or Debug variants and it uses shared object files instead of DLLs. | |
145 | + | |
146 | +1. Install the latest [Python 2.X](https://www.python.org/downloads/) | |
147 | +2. Install GCC and Make. In a terminal, run: | |
148 | + | |
149 | + `sudo apt-get install gcc make` | |
150 | + | |
151 | +3. Install [CMake](https://cmake.org/download/) | |
152 | +4. Install [Go](https://golang.org/doc/install) 32-bit (Important: must be 32 bit) | |
153 | +5. Install Git. In a terminal, run: | |
154 | + | |
155 | + `sudo apt-get install git` | |
156 | + | |
157 | +6. Download the [Vulkan SDK](https://vulkan.lunarg.com/) and unpack it into a location you like. | |
158 | + | |
159 | +Getting the Code | |
160 | +---------------- | |
161 | + | |
162 | +7. Get Swiftshader. In a terminal, go to the location you want to keep Swiftshader, and run: | |
163 | + | |
164 | + ``` | |
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 | + ``` | |
167 | + | |
168 | + This will also install the commit hooks you need for committing to SwiftShader. | |
169 | + | |
170 | +8. Get dEQP: | |
171 | + | |
172 | + `git clone sso://googleplex-android/platform/external/deqp` | |
173 | + | |
174 | +9. Get dEQP's dependencies. In your dEQP root directory, run: | |
175 | + | |
176 | + `python external/fetch_sources.py` | |
177 | + | |
178 | +10. Get Cherry, similar to step 8: | |
179 | + | |
180 | + `git clone https://android.googlesource.com/platform/external/cherry` | |
181 | + | |
182 | +11. Set environment variable. Open ~/.bashrc in your preferred editor and add the following line: | |
183 | + | |
184 | + GOPATH='`<path to cherry>`' | |
185 | + | |
186 | +Building the code | |
187 | +----------------- | |
188 | + | |
189 | +12. Build Swiftshader. In the Swiftshader root dir, run: | |
190 | + ``` | |
191 | + cd build | |
192 | + cmake .. | |
193 | + make --jobs=$(nproc) | |
194 | + ``` | |
195 | + | |
196 | +13. Set your environment variables. In the terminal in which you'll be building dEQP, run the following commands: | |
141 | 197 | |
142 | -Differences to the steps above: | |
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 | + ``` | |
143 | 202 | |
144 | -1. Instead of copying the .dll files, you need to set LD_LIBRARY_PATH to point to SwiftShader's build directory. | |
145 | -2. Use `make` instead of Visual Studio. | |
146 | -3. There are no Debug/Release directories or .exe suffixes, so remove them from DeviceConfig in data.go. | |
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. | |
147 | 204 | |
148 | -Running dEQP Vulkan tests on Linux | |
149 | ----------------------------------- | |
205 | +14. Build dEQP. In the dEQP root dir, run: | |
206 | + ``` | |
207 | + mkdir build | |
208 | + cd build | |
209 | + cmake .. | |
210 | + make --jobs=$(nproc) | |
211 | + ``` | |
150 | 212 | |
151 | -1. Get dEQP source code: | |
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. | |
152 | 214 | |
153 | - `git clone https://android.googlesource.com/platform/external/deqp` | |
215 | +15. 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 | + ``` | |
154 | 221 | |
155 | -2. Fetch dEQP's dependencies: | |
222 | + Note: you need to run `python scripts/build_caselists.py <path to cherry>/data` every time you update dEQP. | |
156 | 223 | |
157 | - `cd deqp`\ | |
158 | - `python external/fetch_sources.py` | |
224 | +Preparing the server | |
225 | +-------------------- | |
159 | 226 | |
160 | -3. Run cmake and generate Makefiles: | |
227 | +16. 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. | |
161 | 232 | |
162 | - `mkdir build`\ | |
163 | - `cd build`\ | |
164 | - `cmake ..` | |
233 | +Testing OpenGL ES | |
234 | +----------------- | |
165 | 235 | |
166 | -4. Build dEQP: | |
236 | +17. a) Assuming you setup the LD_LIBRARY_PATH environment variable prior to running CMake in the dEQP build directory, you're all set. | |
167 | 237 | |
168 | - `make` | |
238 | +Testing Vulkan | |
239 | +-------------- | |
240 | + | |
241 | +17. 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`: | |
169 | 242 | |
170 | -5. Configure dEQP to use SwiftShader's Vulkan driver: | |
243 | + `export VK_ICD_FILENAMES="<path to SwiftShader>/build/Linux/vk_swiftshader_icd.json"` | |
171 | 244 | |
172 | - We do this by setting the `VK_ICD_FILENAMES` environment variable to point to SwiftShader's `vk_swiftshader_icd.json` file. Replace (or `export`) `$SWIFTSHADER_ROOT` to the root checkout directory of SwiftShader, and type: | |
245 | + Then run `source ~/.bashrc` the terminal(s) you'll be running tests from. | |
173 | 246 | |
174 | - `export VK_ICD_FILENAMES=$SWIFTSHADER_ROOT/build/Linux/vk_swiftshader_icd.json` | |
175 | 247 | |
176 | -6. Run the tests: | |
248 | +Running the tests | |
249 | +----------------- | |
177 | 250 | |
178 | - Assuming the current working directory is still `$DEQP_ROOT/build`, type: | |
251 | +18. Start the test server. Go to `<path to cherry>` and run: | |
179 | 252 | |
180 | - `external/vulkancts/modules/vulkan/deqp-vk` | |
253 | + `go run server.go` | |
254 | + | |
255 | +19. Open your favorite browser and navigate to `localhost:8080` | |
256 | + | |
257 | + Get Started -> Choose Device 'localhost' -> Select Tests 'dEQP-GLES3' -> Execute tests! | |
181 | 258 | |
182 | - If `deqp-vk` returns an error similar to: | |
259 | +20. 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. | |
183 | 260 | |
184 | - `libVulkan.cpp:69: VkResult vkCreateInstance(const VkInstanceCreateInfo*, const VkAllocationCallbacks*, VkInstance_T**): Assertion 'false' failed.` | |
261 | +21. If you want to run Vulkan tests in the command line, go to the build directory in dEQP root. Then run the following command: | |
185 | 262 | |
186 | - Then it is likely that your system is using a broken Vulkan loader. [Grab the Vulkan SDK from here](https://vulkan.lunarg.com/), and update `LD_LIBRARY_PATH` to search the SDK's `libs` directory: | |
263 | + `external/vulkanacts/modules/vulkan/deqp-vk` | |
187 | 264 | |
188 | - `export LD_LIBRARY_PATH=$VULKAN_SDK_PATH/x86_64/lib:$LD_LIBRARY_PATH` | |
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 | + | |
271 | +22. To check that you're running SwiftShader in cherry, start the server | |
272 | + | |
273 | +Mustpass sets | |
274 | +------------- | |
275 | + | |
276 | +dEQP 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. |