[beignet] 06/12: Give a single helpful error message, not many confusing ones, on unsupported hardware

Rebecca Palmer rnpalmer-guest at moszumanska.debian.org
Wed Mar 18 21:37:46 UTC 2015


This is an automated email from the git hooks/post-receive script.

rnpalmer-guest pushed a commit to branch master
in repository beignet.

commit e28c255580ac2609274896feecb3b9824af4e876
Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
Date:   Wed Mar 18 13:18:44 2015 +0000

    Give a single helpful error message, not many confusing ones,
    on unsupported hardware
---
 debian/changelog                            |  2 ++
 debian/patches/reduce-notfound-output.patch | 41 +++++++++++++++++++++++++++++
 debian/patches/series                       |  1 +
 3 files changed, 44 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 9326084..d77694b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,8 @@ beignet (1.0.2-1) UNRELEASED; urgency=medium
   * Drop no longer needed Utest-requires-deprecated-function-names.patch.
   * Stop using -msse*, to allow at least returning a useful error on
     old unsupported hardware.
+  * Give a single helpful error message, not many confusing ones,
+    on unsupported hardware.
 
  -- Andreas Beckmann <anbe at debian.org>  Tue, 17 Mar 2015 23:29:43 +0100
 
diff --git a/debian/patches/reduce-notfound-output.patch b/debian/patches/reduce-notfound-output.patch
new file mode 100644
index 0000000..2be1895
--- /dev/null
+++ b/debian/patches/reduce-notfound-output.patch
@@ -0,0 +1,41 @@
+Description: Reduce error spew on unsupported hardware
+
+Loading beignet on unsupported hardware produces ~20 errors, even
+if another ICD is also installed that does support the hardware.
+Replace these with one message that explicitly says what to do.
+
+Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
+
+--- beignet-1.0.1.orig/src/cl_device_id.c
++++ beignet-1.0.1/src/cl_device_id.c
+@@ -394,10 +394,10 @@ brw_gt3_break:
+     case PCI_CHIP_SANDYBRIDGE_BRIDGE_S:
+     case PCI_CHIP_SANDYBRIDGE_S_GT:
+       // Intel(R) HD Graphics SandyBridge not supported yet
++    default:
++      fprintf(stderr, "beignet-opencl-icd: no supported GPU found, this is probably the wrong opencl-icd package for this hardware\n(If you have multiple ICDs installed and OpenCL works, you can ignore this message)\n");
+       ret = NULL;
+       break;
+-    default:
+-      printf("cl_get_gt_device(): error, unknown device: %x\n", device_id);
+   }
+ 
+   if (ret == NULL)
+--- beignet-1.0.1.orig/src/intel/intel_driver.c
++++ beignet-1.0.1/src/intel/intel_driver.c
+@@ -236,7 +236,6 @@ intel_driver_open(intel_driver_t *intel,
+   }
+ 
+   if(!intel_driver_is_active(intel)) {
+-    fprintf(stderr, "Device open failed, aborting...\n");
+     return CL_DEVICE_NOT_FOUND;
+   }
+ 
+@@ -293,7 +292,6 @@ intel_driver_init_master(intel_driver_t
+   // usually dev_name = "/dev/dri/card%d"
+   dev_fd = open(dev_name, O_RDWR);
+   if (dev_fd == -1) {
+-    fprintf(stderr, "open(\"%s\", O_RDWR) failed: %s\n", dev_name, strerror(errno));
+     return 0;
+   }
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 1a2755b..16bb4ea 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@ Link-against-terminfo.patch
 Enable-test-debug.patch
 force-llvm-3.5.patch
 support-kfreebsd.patch
+reduce-notfound-output.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/beignet.git



More information about the Pkg-opencl-commits mailing list