summaryrefslogtreecommitdiff
path: root/bin
diff options
authorPierre Equoy <pierre.equoy@canonical.com>2016-09-12 18:26:58 +0800
committerPierre Equoy <pierre.equoy@canonical.com>2016-09-12 18:26:58 +0800
commit2916c166fe827941d8e37d355418a136cfb2897d (patch)
tree199b31fa9a73af09415171ce6d1e31d22e602933 /bin
parent83a3ca8bcc86bb191ec682811463ebf3585d55f0 (diff)
providers:checkbox: Adapt graphics jobs to take amdgpu-pro drivers into account
The amdgpu-pro drivers are based on the open source amdgpu drivers (so udev shows the same driver name for both amdgpu and amdgpu-pro installs), but use a dedicated script (amdgpu-pro-px) to switch between integrated and discrete GPUs. We adapt the existing jobs and scripts to take this into account, based on Sylvain's modification to graphics_card resource job that allows to show 'amdgpu-pro' as driver name when the amdgpu-pro metapackage is present on the system. Fixes: https://bugs.launchpad.net/plainbox-provider-certification-client/+bug/1622477
Diffstat (limited to 'bin')
-rwxr-xr-xbin/graphics_env12
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/graphics_env b/bin/graphics_env
index 05755b0..55a3486 100755
--- a/bin/graphics_env
+++ b/bin/graphics_env
@@ -6,16 +6,16 @@
# This script has to be sourced in order to set an environment variable that
# is used by the open source AMD driver to trigger the use of discrete GPU.
-VENDOR_SLUG=$1
+DRIVER=$1
INDEX=$2
UBUNTU_CODENAME=`lsb_release -c | awk {'print $2'}`
# We only want to set the DRI_PRIME env variable on Xenial (16.04) systems
-# running more than 1 GPU.
-if [[ $UBUNTU_CODENAME == "xenial" ]]; then
- NB_GPU=`udev_resource -l VIDEO | grep -oP -m1 '\d+'`
- if [ $NB_GPU -gt 1 ]; then
- if [[ $VENDOR_SLUG == *AMD* ]]; then
+# with more than 1 GPU running the amdgpu driver.
+if [[ $DRIVER == "amdgpu" ]]; then
+ if [[ $UBUNTU_CODENAME == "xenial" ]]; then
+ NB_GPU=`udev_resource -l VIDEO | grep -oP -m1 '\d+'`
+ if [ $NB_GPU -gt 1 ]; then
if [ $INDEX -gt 1 ]; then
# See https://wiki.archlinux.org/index.php/PRIME
echo "Setting up PRIME GPU offloading for AMD discrete GPU"