[beignet] 02/04: Make __local on Haswell an error instead of silently doing nothing and add more documentation
Rebecca Palmer
rnpalmer-guest at moszumanska.debian.org
Tue Apr 28 20:30:59 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 152a30bbf0d226201f16dcd08cfacd7206e1ec38
Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
Date: Tue Apr 28 19:45:05 2015 +0100
Make __local on Haswell an error instead of silently doing nothing
and add more documentation
---
debian/README.Debian | 19 +++++++++++++++++++
debian/changelog | 2 ++
debian/patches/haswell.patch | 33 +++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
4 files changed, 55 insertions(+)
diff --git a/debian/README.Debian b/debian/README.Debian
index 71d581a..905d2b9 100644
--- a/debian/README.Debian
+++ b/debian/README.Debian
@@ -1,3 +1,22 @@
+Haswell issues
+--------------
+
+On Haswell (mostly Core ix-4xxx) hardware, beignet interacts badly with a
+Linux security mechanism, leading to these errors:
+
+* drm_intel_gem_bo_context_exec() failed: Invalid argument
+
+Occurs on all computations; can be avoided by setting
+i915.enable_cmd_parser=0, either at boot, or later with:
+
+ sudo echo 0 > /sys/module/i915/parameters/enable_cmd_parser
+
+* Beignet: Shared local memory does not work on Haswell
+
+Occurs on using the __local memory space. To avoid this, apply the patch at
+https://01.org/zh/beignet/downloads/linux-kernel-patch-hsw-support to Linux,
+remove haswell.patch from beignet, and recompile both.
+
Precision vs. Speed
-------------------
diff --git a/debian/changelog b/debian/changelog
index 3c45303..02798cd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,8 @@ beignet (1.0.3-1) UNRELEASED; urgency=medium
* Drop Enhance-debug-output.patch.
* Add reportbug script.
* Drop Link-against-terminfo.patch and libtinfo dependency.
+ * Make __local on Haswell an error instead of silently doing nothing,
+ and document workarounds.
-- Rebecca N. Palmer <rebecca_palmer at zoho.com> Fri, 24 Apr 2015 21:16:12 +0100
diff --git a/debian/patches/haswell.patch b/debian/patches/haswell.patch
new file mode 100644
index 0000000..5e2ea0d
--- /dev/null
+++ b/debian/patches/haswell.patch
@@ -0,0 +1,33 @@
+Description: Better handle known Haswell bugs
+
+Print a helpful error message instead of silently doing nothing
+
+Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
+Forwarded: http://lists.freedesktop.org/archives/beignet/2015-April/005589.html
+
+--- beignet-1.0.3.orig/src/cl_command_queue_gen7.c
++++ beignet-1.0.3/src/cl_command_queue_gen7.c
+@@ -343,6 +343,10 @@ cl_command_queue_ND_range_gen7(cl_comman
+ /* Curbe step 1: fill the constant urb buffer data shared by all threads */
+ if (ker->curbe) {
+ kernel.slm_sz = cl_curbe_fill(ker, work_dim, global_wk_off, global_wk_sz, local_wk_sz, thread_n);
++ if (kernel.slm_sz > 0 && cl_driver_get_ver(ctx->drv) == 75){
++ fprintf(stderr, "Beignet: Shared local memory does not work on Haswell, see /usr/share/doc/beignet-opencl-icd/README.Debian\n");
++ return CL_OUT_OF_RESOURCES;
++ }
+ if (kernel.slm_sz > ker->program->ctx->device->local_mem_size) {
+ fprintf(stderr, "Beignet: Out of shared local memory %d.\n", kernel.slm_sz);
+ return CL_OUT_OF_RESOURCES;
+--- beignet-1.0.3.orig/src/intel/intel_batchbuffer.c
++++ beignet-1.0.3/src/intel/intel_batchbuffer.c
+@@ -135,6 +135,10 @@ intel_batchbuffer_flush(intel_batchbuffe
+ }
+ if (drm_intel_gem_bo_context_exec(batch->buffer, batch->intel->ctx, used, flag) < 0) {
+ fprintf(stderr, "drm_intel_gem_bo_context_exec() failed: %s\n", strerror(errno));
++ if (errno == EINVAL && IS_GEN75(batch->intel->device_id)) {
++ fprintf(stderr, "This is a known bug on Haswell systems, see /usr/share/doc/beignet-opencl-icd/README.Debian\n"
++ "'sudo echo 0 > /sys/module/i915/parameters/enable_cmd_parser' usually helps\n");
++ }
+ err = -1;
+ }
+
diff --git a/debian/patches/series b/debian/patches/series
index c94af00..b368e53 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,3 +7,4 @@ shared-llvm.patch
builtin_pow-fix-spurious-failure.patch
tgamma-accuracy.patch
python3.patch
+haswell.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