Merge ~pieq/plainbox-provider-checkbox:fix-1831719-graphics_env-bionic into plainbox-provider-checkbox:master

Proposed by Pierre Equoy
Status: Merged
Approved by: Sylvain Pineau
Approved revision: b2c270147b33d63ffe44a3dddf312b90e58126c5
Merged at revision: 5bd50ef9f99b4cbc25b24b06a24af02365bf2bba
Proposed branch: ~pieq/plainbox-provider-checkbox:fix-1831719-graphics_env-bionic
Merge into: plainbox-provider-checkbox:master
Diff against target: 45 lines (+14/-17)
1 file modified
bin/graphics_env (+14/-17)
Reviewer Review Type Date Requested Status
Betty Lin (community) Approve
Checkbox Developers Pending
Review via email: mp+368426@code.launchpad.net

Description of the change

See commit message.

To test, using a device with and AMD discrete GPU and a bionic image using amdgpu open source drivers (such as stock Ubuntu), run a test plan with jobs like

graphics/{index}_glxgears_fullscreen_{product_slug}
graphics/{index}_video_{product_slug}

and make sure the phrase "Setting up PRIME GPU offloading for AMD discrete GPU" is shown in the output.

To post a comment you must log in.
Revision history for this message
Betty Lin (bettyl) wrote :

Test the update graphics_env, "Setting up PRIME GPU offloading for AMD discrete GPU" is shown in the output when running:
graphics/2_glxgears_*
graphics/2_glxgears_fullscreen_*
graphics/2_valid_opengl_renderer_*
graphics/2_video_*

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/bin/graphics_env b/bin/graphics_env
index 89c761d..19385a5 100755
--- a/bin/graphics_env
+++ b/bin/graphics_env
@@ -8,26 +8,23 @@
88
9DRIVER=$19DRIVER=$1
10INDEX=$210INDEX=$2
11UBUNTU_CODENAME=`lsb_release -c | awk {'print $2'}`
1211
13# We only want to set the DRI_PRIME env variable on Xenial (16.04) systems12# We only want to set the DRI_PRIME env variable on systems with more than
14# with more than 1 GPU running the amdgpu/radeon drivers.13# 1 GPU running the amdgpu/radeon drivers.
15if [[ $DRIVER == "amdgpu" || $DRIVER == "radeon" ]]; then14if [[ $DRIVER == "amdgpu" || $DRIVER == "radeon" ]]; then
16 if [[ $UBUNTU_CODENAME == "xenial" ]]; then15 NB_GPU=`udev_resource -l VIDEO | grep -oP -m1 '\d+'`
17 NB_GPU=`udev_resource -l VIDEO | grep -oP -m1 '\d+'`16 if [ $NB_GPU -gt 1 ]; then
18 if [ $NB_GPU -gt 1 ]; then17 if [ $INDEX -gt 1 ]; then
19 if [ $INDEX -gt 1 ]; then18 # See https://wiki.archlinux.org/index.php/PRIME
20 # See https://wiki.archlinux.org/index.php/PRIME19 echo "Setting up PRIME GPU offloading for AMD discrete GPU"
21 echo "Setting up PRIME GPU offloading for AMD discrete GPU"20 if ! cat /var/log/Xorg.0.log ~/.local/share/xorg/Xorg.0.log 2>&1 | grep -q DRI3; then
22 if ! cat /var/log/Xorg.0.log ~/.local/share/xorg/Xorg.0.log 2>&1 | grep -q DRI3; then21 PROVIDER_ID=`xrandr --listproviders | grep "Sink Output" | awk {'print $4'} | tail -1`
23 PROVIDER_ID=`xrandr --listproviders | grep "Sink Output" | awk {'print $4'} | tail -1`22 SINK_ID=`xrandr --listproviders | grep "Source Output" | awk {'print $4'} | tail -1`
24 SINK_ID=`xrandr --listproviders | grep "Source Output" | awk {'print $4'} | tail -1`23 xrandr --setprovideroffloadsink ${PROVIDER_ID} ${SINK_ID}
25 xrandr --setprovideroffloadsink ${PROVIDER_ID} ${SINK_ID}
26 fi
27 export DRI_PRIME=1
28 else
29 export DRI_PRIME=
30 fi24 fi
25 export DRI_PRIME=1
26 else
27 export DRI_PRIME=
31 fi28 fi
32 fi29 fi
33fi30fi

Subscribers

People subscribed via source and target branches