From ef75e8b2eb1fe28c073aab39bb80d18065c80323 Mon Sep 17 00:00:00 2001 From: Pierre Equoy Date: Mon, 27 Jun 2016 14:50:52 +0800 Subject: provider:checkbox: Fix AMD hybrid testing graphics_env script Previous version of graphics_env script was using the content of gpu-manager.log to check how many cards were available. Unfortunately, this file is not reliable because it uses udev which, as of today, does only care about proprietary drivers (nvidia, fglrx). We change the method to count the number of GPUs with something easier and more reliable. --- bin/graphics_env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/graphics_env b/bin/graphics_env index 719865d5..05755b04 100755 --- a/bin/graphics_env +++ b/bin/graphics_env @@ -13,7 +13,7 @@ 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=`cat /var/log/gpu-manager.log | grep "How many cards?" | awk {'print $NF'}` + NB_GPU=`udev_resource -l VIDEO | grep -oP -m1 '\d+'` if [ $NB_GPU -gt 1 ]; then if [[ $VENDOR_SLUG == *AMD* ]]; then if [ $INDEX -gt 1 ]; then -- cgit v1.2.3