blob: 8dfc3d0edd58f4dd56c13f8bac70573cb8bf8622 [file] [log] [blame] [view]
Austin Eng1cdea902022-03-24 00:21:55 +00001# Running the WebGPU CTS Locally with Chrome
2
3Running the WebGPU CTS locally with Chrome requires a Chromium checkout.
4
5Follow [these instructions](https://www.chromium.org/developers/how-tos/get-the-code/) for checking out
6and building Chrome. You'll also need to build the `telemetry_gpu_integration_test` target.
7
8At the root of a Chromium checkout, run:
9`./content/test/gpu/run_gpu_integration_test.py webgpu_cts --browser=exact --browser-executable=path/to/your/chrome-executable`
10
Austin Enge2bdb5e2022-09-14 17:13:17 +000011If you don't want to build Chrome, you can still run the CTS, by passing the path to an existing Chrome executable to the `--browser-executable` argument. However, if you would like to use all harness functionality (symbolizing stack dumps, etc.). You will still need to build the `telemetry_gpu_integration_test` target.
Austin Eng1cdea902022-03-24 00:21:55 +000012
13Useful command-line arguments:
Austin Enge2bdb5e2022-09-14 17:13:17 +000014 - `--help`: See more options and argument documentation.
Austin Eng1cdea902022-03-24 00:21:55 +000015 - `-l`: List all tests that would be run.
Austin Enge2bdb5e2022-09-14 17:13:17 +000016 - `--test-filter`: Filter tests.
Austin Eng1cdea902022-03-24 00:21:55 +000017 - `--passthrough --show-stdout`: Show browser output. See also `--browser-logging-verbosity`.
18 - `--extra-browser-args`: Pass extra args to the browser executable.
Austin Enge2bdb5e2022-09-14 17:13:17 +000019 - `--jobs=N`: Run with multiple parallel browser instances.
20 - `--stable-jobs`: Assign tests to each job in a stable order. Used on the bots for consistency and ease of reproduction.
21 - `--enable-dawn-backend-validation`: Enable Dawn's backend validation.
22 - `--use-webgpu-adapter=[default,swiftshader,compat]`: Forwarded to the browser to select a particular WebGPU adapter.
23
24# Running a local CTS build on Swarming
25Often, it's useful to test changes on Chrome's infrastructure if it's difficult to reproduce a bug locally. To do that, we can package our local build as an "isolate" and upload it to Swarming to run there. This is often much faster than uploading your CL to Gerrit and triggering tryjobs.
26
27Note that since you're doing a local build, you need to be on the same type of machine as the job you'd like to trigger in swarming. To run a job on a Windows bot, you need to build the isolate on Windows.
28
291. Build the isolate
30
31 `vpython3 tools/mb/mb.py isolate out/Release telemetry_gpu_integration_test`
322. Upload the isolate
33
34 `./tools/luci-go/isolate archive -cas-instance chromium-swarm -i out/Release/telemetry_gpu_integration_test.isolate`
35
36 This will output a hash like:
37 95199eb624d8ddb6ffdfe7a2fc41bc08573aebe3d17363a119cb1e9ca45761ae/734
38
39 Save this hash for use in the next command.
403. Trigger the swarming job.
41
42 The command structure is as follows:
43
44 `./tools/luci-go/swarming trigger -S https://chromium-swarm.appspot.com <dimensions...> -digest <YOUR_ISOLATE_HASH> -- <command> ...`
45
46 Say you want to trigger a job on a Linux Intel bot. It's easiest to check an existing task to see the right args you would use.
47 For example: https://chromium-swarm.appspot.com/task?id=5d552b8def31ab11.
48
49 In the table on the left hand side, you can see the bot's **Dimensions**.
50 In the **Raw Output** on the right or below the table, you can see the commands run on this bot. Copying those, you would use:
51 ```
52 ./tools/luci-go/swarming trigger -S https://chromium-swarm.appspot.com -d "pool=chromium.tests.gpu" -d "cpu=x86-64" -d "gpu=8086:9bc5-20.0.8" -d "os=Ubuntu-18.04.6" -digest 95199eb624d8ddb6ffdfe7a2fc41bc08573aebe3d17363a119cb1e9ca45761ae/734 -- vpython3 testing/test_env.py testing/scripts/run_gpu_integration_test_as_googletest.py content/test/gpu/run_gpu_integration_test.py --isolated-script-test-output=${ISOLATED_OUTDIR}/output.json webgpu_cts --browser=release --passthrough -v --show-stdout --extra-browser-args="--enable-logging=stderr --js-flags=--expose-gc --force_high_performance_gpu --enable-features=Vulkan" --total-shards=14 --shard-index=0 --jobs=4 --stable-jobs
53 ```
54
55 The command will output a link to the Swarming task for you to see the results.