Skip to content

Commit 2217afb

Browse files
committed
CI: use lavapipe instead of swiftshader when running examples (#3358)
# Objective - fixes #3344 - have example run faster ## Solution - thanks to the nice folks at wgpu, I was able to switch from swift shader to lavapipe which is faster - I also reduced the runtime for some of the examples - I enabled the trace_chrome feature on the examples, and stored the results as an artefact. it can be useful to debug - runtime is back to around 10 minutes Co-authored-by: François <[email protected]>
1 parent 9a16a4d commit 2217afb

File tree

4 files changed

+19
-13
lines changed

4 files changed

+19
-13
lines changed

.github/example-run/breakout.ron

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
(
2-
exit_after: Some(1800)
2+
exit_after: Some(900)
33
)

.github/example-run/contributors.ron

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
(
2-
exit_after: Some(1800)
2+
exit_after: Some(900)
33
)

.github/example-run/scene.ron

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
(
2-
exit_after: Some(1800)
2+
exit_after: Some(100)
33
)

.github/workflows/ci.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,17 @@ jobs:
216216
run-examples:
217217
runs-on: ubuntu-latest
218218
steps:
219-
- name: Install dependencies
219+
- name: Install Bevy dependencies
220220
run: |
221221
sudo apt-get update;
222222
DEBIAN_FRONTEND=noninteractive sudo apt-get install --no-install-recommends -yq \
223-
libasound2-dev libudev-dev wget unzip xvfb;
223+
libasound2-dev libudev-dev;
224+
- name: install xvfb, llvmpipe and lavapipe
225+
run: |
226+
sudo apt-get update -y -qq
227+
sudo add-apt-repository ppa:oibaf/graphics-drivers -y
228+
sudo apt-get update
229+
sudo apt install -y xvfb libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
224230
- uses: actions/checkout@v2
225231
- uses: actions/cache@v2
226232
with:
@@ -234,23 +240,23 @@ jobs:
234240
- uses: actions-rs/toolchain@v1
235241
with:
236242
toolchain: stable
237-
- name: Setup swiftshader
238-
run: |
239-
wget https://github.com/qarmin/gtk_library_store/releases/download/3.24.0/swiftshader.zip;
240-
unzip swiftshader.zip;
241-
curr="$(pwd)/libvk_swiftshader.so";
242-
sed -i "s|PATH_TO_CHANGE|$curr|" vk_swiftshader_icd.json;
243243
- name: Build bevy
244244
run: |
245-
cargo build --no-default-features --features "bevy_dynamic_plugin,bevy_gilrs,bevy_gltf,bevy_winit,render,png,hdr,x11,bevy_ci_testing"
245+
cargo build --no-default-features --features "bevy_dynamic_plugin,bevy_gilrs,bevy_gltf,bevy_winit,render,png,hdr,x11,bevy_ci_testing,trace,trace_chrome"
246246
- name: Run examples
247247
run: |
248248
for example in .github/example-run/*.ron; do
249249
example_name=`basename $example .ron`
250250
echo "running $example_name - "`date`
251-
time CI_TESTING_CONFIG=$example VK_ICD_FILENAMES=$(pwd)/vk_swiftshader_icd.json DRI_PRIME=0 xvfb-run cargo run --example $example_name --no-default-features --features "bevy_dynamic_plugin,bevy_gilrs,bevy_gltf,bevy_winit,render,png,hdr,x11,bevy_ci_testing"
251+
time CI_TESTING_CONFIG=$example xvfb-run cargo run --example $example_name --no-default-features --features "bevy_dynamic_plugin,bevy_gilrs,bevy_gltf,bevy_winit,render,png,hdr,x11,bevy_ci_testing,trace,trace_chrome"
252252
sleep 10
253253
done
254+
zip traces.zip trace*.json
255+
- name: save traces
256+
uses: actions/upload-artifact@v1
257+
with:
258+
name: example-traces.zip
259+
path: traces.zip
254260

255261
check-doc:
256262
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)