[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#31436: closed ([PATCH 0/6] gnu: Add opencl related

From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#31436: closed ([PATCH 0/6] gnu: Add opencl related packages.)
Date: Tue, 26 Jun 2018 21:01:01 +0000

Your message dated Tue, 26 Jun 2018 23:00:16 +0200
with message-id <address@hidden>
and subject line Re: [PATCH 3/3] gnu: Add beignet.
has caused the debbugs.gnu.org bug report #31436,
regarding [PATCH 0/6] gnu: Add opencl related packages.
to be marked as done.

(If you believe you have received this mail in error, please contact

31436: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=31436
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: [PATCH 0/6] gnu: Add opencl related packages. Date: Sat, 12 May 2018 19:46:15 +0000
These patches add basic support for opencl. As noted in the new file
opencl.scm, tests can't enabled by now. For the future, maybe we can
patch the build system to make test targets installable so that people
with right tools can help testing. Or maybe there are some other ways
that we can modify the build environment for testing. But that's another
day's problem. :)

Although testing with packages' unit tests are not enabled. I tried to
test them outside the store by simple hello world program, they works
fine on my hardware.

To make thing a little comfortable, I packaged clinfo, which is a little
tool for displaying OpenCL platforms and device information by calling
OpenCL host functions. If it works on your device, then at least you can
confirm the corresponding implementation is not completely broken.

Environment variable `OPENCL_VENDOR_PATH` is used to guide `ocl-icd`
loading needed OpenCL implementation library. You need to source it in
your profile before you try to use any of the implementation.

I wrapped clinfo, notes are put in the package definition.

fis (6):
  gnu: Add opencl-headers.
  gnu: Add opencl-clhpp.
  gnu: Add ocl-icd.
  gnu: Add beignet.
  gnu: Add clinfo.
  gnu: Add pocl.

 gnu/local.mk                                     |   2 +
 gnu/packages/opencl.scm                          | 327 +++++++++++++++++++++++
 gnu/packages/patches/beignet-correct-paths.patch |  41 +++
 3 files changed, 370 insertions(+)
 create mode 100644 gnu/packages/opencl.scm
 create mode 100644 gnu/packages/patches/beignet-correct-paths.patch


--- End Message ---
--- Begin Message --- Subject: Re: [PATCH 3/3] gnu: Add beignet. Date: Tue, 26 Jun 2018 23:00:16 +0200 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Fis Trivial <address@hidden> skribis:

> * gnu/packages/opencl.scm (beignet): New variable.
> * gnu/packages/patches/beignet-correct-paths.patch: New file.
> * gnu/local.mk: Add it.

Applied with the changes below.

There’s one issue, though: the ‘beignet.pch’ file is not bit
reproducible, as can be seen when running ‘guix build beignet --check
-K’.  The file is generated by Clang:

--8<---------------cut here---------------start------------->8---
    COMMAND mkdir -p ${OCL_OBJECT_DIR}
${OCL_OBJECT_DIR}/include/ -emit-pch -x cl ${OCL_OBJECT_DIR}/include/ocl.h -o 
    COMMENT "Generate the pch file: ${OCL_OBJECT_DIR}/beignet.local.pch"
--8<---------------cut here---------------end--------------->8---

This may be a Clang/LLVM issue not specific to Beignet, and we should
ask the Clang/LLVM people about it.

Thanks for following up on this patch series!  I’m closing it now, but
hopefully later on we’ll have POCL as well.


diff --git a/gnu/local.mk b/gnu/local.mk
index b400c9f18..08888da35 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -583,7 +583,7 @@ dist_patch_DATA =                                           
   %D%/packages/patches/azr3.patch                              \
   %D%/packages/patches/bash-completion-directories.patch       \
   %D%/packages/patches/bazaar-CVE-2017-14176.patch             \
-  %D%/packages/patches/beignet-correct-paths.patch             \
+  %D%/packages/patches/beignet-correct-file-names.patch                \
   %D%/packages/patches/bind-CVE-2018-5738.patch                        \
   %D%/packages/patches/binutils-aarch64-symbol-relocation.patch        \
   %D%/packages/patches/binutils-loongson-workaround.patch      \
diff --git a/gnu/packages/opencl.scm b/gnu/packages/opencl.scm
index b209d361d..644cd95e9 100644
--- a/gnu/packages/opencl.scm
+++ b/gnu/packages/opencl.scm
@@ -224,7 +224,12 @@ the system.")
-              (patches (search-patches "beignet-correct-paths.patch"))))
+              (patches (search-patches "beignet-correct-file-names.patch"))
+              (modules '((guix build utils)))
+              (snippet
+               ;; There's a suspicious .isa binary file under kernels/.
+               ;; Remove it.
+               '(for-each delete-file (find-files "." "\\.isa$")))))
     (native-inputs `(("pkg-config" ,pkg-config)
                      ("python" ,python)))
     (inputs `(("address@hidden" ,clang-3.7)
@@ -251,13 +256,15 @@ the system.")
                             (assoc-ref %build-inputs "address@hidden") "/lib")
        (modify-phases %standard-phases
          (add-after 'install 'remove-headers
            (lambda* (#:key outputs #:allow-other-keys)
              (let ((out (assoc-ref outputs "out")))
-                (string-append out "/include")))))
+                (string-append out "/include"))
+               #t)))
          (add-after 'remove-headers 'install-kernels
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
@@ -265,14 +272,19 @@ the system.")
                     (source-dir (string-append
-               (copy-recursively source-dir (string-append
-                                             out
-                                             "/lib/beignet/kernels"))))))
+               (copy-recursively source-dir
+                                 (string-append out "/lib/beignet/kernels"))
+               #t))))
        ;; Beignet tries to find GPU when running tests, which is not available
        ;; during build.
        #:tests? #f))
     (home-page "https://wiki.freedesktop.org/www/Software/Beignet/";)
-    (synopsis "Intel's OpenCL framework")
-    (description "Intel's OpenCL framework that works with Intel IvyBridge GPUs
-and above.")
-    (license license:gpl2)))
+    (synopsis "OpenCL framework for Intel GPUs")
+    (description
+     "Beignet is an implementation of the OpenCL specification.  This code
+base contains the code to run OpenCL programs on Intel GPUs---IvyBridge,
+Haswell, Skylake, Apollolake, etc.  It defines and implements the OpenCL host
+functions required to initialize the device, create the command queues, the
+kernels and the programs, and run them on the GPU.  The code also contains a
+back-end for the LLVM compiler framework.")
+    (license license:lgpl2.1+)))
diff --git a/gnu/packages/patches/beignet-correct-paths.patch 
similarity index 73%
rename from gnu/packages/patches/beignet-correct-paths.patch
rename to gnu/packages/patches/beignet-correct-file-names.patch
index 96f15d782..2c5d0bbae 100644
--- a/gnu/packages/patches/beignet-correct-paths.patch
+++ b/gnu/packages/patches/beignet-correct-file-names.patch
@@ -1,14 +1,5 @@
-From 0ba525465782ec3fd6484b7483941344f293d3ab Mon Sep 17 00:00:00 2001
-From: fis <address@hidden>
-Date: Sun, 8 Apr 2018 02:14:44 +0800
-Subject: [PATCH] Correct paths.
-* CMake/FindLLVM.cmake (CLANG_LIBRARY_DIR): New vairable.
-* CMakelists: Let cmake figure out where to install icd file.
- CMake/FindLLVM.cmake | 2 +-
- CMakeLists.txt       | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
+Help CMake find Clang's libraries.
+Have it install the ICD file in the right place.
 diff --git a/CMake/FindLLVM.cmake b/CMake/FindLLVM.cmake
 index 5457f248..e8e8f94a 100644

--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]