diff options
Diffstat (limited to 'gnu/packages/opencl.scm')
-rw-r--r-- | gnu/packages/opencl.scm | 174 |
1 files changed, 172 insertions, 2 deletions
diff --git a/gnu/packages/opencl.scm b/gnu/packages/opencl.scm index b31fa09474..644cd95e93 100644 --- a/gnu/packages/opencl.scm +++ b/gnu/packages/opencl.scm @@ -21,9 +21,21 @@ #:use-module (guix build-system cmake) #:use-module (guix download) #:use-module (guix git-download) - #:use-module (guix packages) #:use-module ((guix licenses) #:prefix license:) - #:use-module (gnu packages python)) + #:use-module (guix packages) + #:use-module (gnu packages) + #:use-module (gnu packages gl) + #:use-module (gnu packages gnupg) + #:use-module (gnu packages compression) + #:use-module (gnu packages libedit) + #:use-module (gnu packages llvm) + #:use-module (gnu packages ncurses) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) + #:use-module (gnu packages ruby) + #:use-module (gnu packages video) + #:use-module (gnu packages xdisorg) + #:use-module (gnu packages xorg)) ;; This file adds OpenCL implementation related packages. Due to the fact that ;; OpenCL devices are not available during build (store environment), tests are @@ -118,3 +130,161 @@ programming.") (description "This package provides the @dfn{host API} C++ headers for OpenCL.") (license license:expat))) + +(define-public ocl-icd + (package + (name "ocl-icd") + (version "2.2.12") + (source (origin + (method url-fetch) + (uri (string-append + "https://forge.imag.fr/frs/download.php/836/ocl-icd-" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "1x2dr8p4dkfds56r38av360i3nv1y3326jmshxvjngaf6mlg6rbn")) + (modules '((guix build utils))) + (snippet + '(delete-file-recursively "khronos-headers")))) + (native-inputs + `(("opencl-headers" ,opencl-headers) + ("ruby" ,ruby))) + (inputs + `(("libgcrypt" ,libgcrypt))) + (build-system gnu-build-system) + (arguments + '(#:configure-flags '("DEBUG_OCL_ICD=1"))) + (native-search-paths + (list (search-path-specification + (variable "OPENCL_VENDOR_PATH") + (files '("etc/OpenCL/vendors"))))) + (search-paths native-search-paths) + (home-page "https://forge.imag.fr/projects/ocl-icd/") + (synopsis "OpenCL loader for Installable Client Drivers (ICDs)") + (description + "OpenCL implementations are provided as ICDs (Installable Client +Drivers). An OpenCL program can use several ICDs thanks to the use of an ICD +Loader as provided by this package.") + (license license:bsd-2))) + +(define-public clinfo + (package + (name "clinfo") + (version "2.2.18.04.06") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/Oblomov/clinfo/archive/" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "0v7cy01irwdgns6lzaprkmm0502pp5a24zhhffydxz1sgfjj2w7p")))) + (build-system gnu-build-system) + (native-inputs + `(("opencl-headers" ,opencl-headers))) + (inputs + `(("ocl-icd" ,ocl-icd))) + (arguments + `(#:phases + (modify-phases %standard-phases + (delete 'configure) + (replace 'build + (lambda _ + (let ((cores (number->string (parallel-job-count)))) + (setenv "CC" "gcc") + (invoke "make" "-j" cores)))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (invoke "make" "install" (string-append + "PREFIX=" + (assoc-ref outputs "out")))))) + #:tests? #f)) + (home-page "https://github.com/Oblomov/clinfo") + (synopsis "Print information about OpenCL platforms and devices") + ;; Only the implementation installed via Guix will be detected. + (description + "This package provides the @command{clinfo} command that enumerates all +possible (known) properties of the OpenCL platform and devices available on +the system.") + (license license:cc0))) + +(define-public beignet + (package + (name "beignet") + (version "1.3.2") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/intel/beignet/archive/Release_v" + version + ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "18r0lq3dkd4yn6bxa45s2lrr9cjbg70nr2nn6xablvgqwzw0jb0r")) + (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 `(("clang@3.7" ,clang-3.7) + ("clang-runtime@3.7" ,clang-runtime-3.7) + ("glu" ,glu) + ("llvm@3.7" ,llvm-3.7) + ("libdrm" ,libdrm) + ("libedit" ,libedit) + ("libpthread-stubs", libpthread-stubs) + ("libsm" ,libsm) + ("libva" ,libva) + ("libxfixes" ,libxfixes) + ("libxext" ,libxext) + ("mesa-utils" ,mesa-utils) + ("ncurses" ,ncurses) + ("ocl-icd" ,ocl-icd) + ("opencl-headers" ,opencl-headers) + ("xextproto" ,xextproto) + ("zlib" ,zlib))) + (build-system cmake-build-system) + (arguments + `(#:configure-flags + (list (string-append "-DCLANG_LIBRARY_DIR=" + (assoc-ref %build-inputs "clang@3.7") "/lib") + "-DENABLE_GL_SHARING=ON" + "-DEXPERIMENTAL_DOUBLE=ON") + + #:phases + (modify-phases %standard-phases + (add-after 'install 'remove-headers + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (delete-file-recursively + (string-append out "/include")) + #t))) + (add-after 'remove-headers 'install-kernels + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (builddir (getcwd)) + (source-dir (string-append + builddir + "/../beignet-Release_v1.3.2/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 "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+))) |