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

Bug#686307: unblock: ocl-icd/1.3-3



Le 31/08/2012 07:27, Adam D. Barratt a écrit :
> On Fri, 2012-08-31 at 01:56 +0200, Vincent Danjean wrote:
>>   I just released a new (upstream) version [1.4] of ocl-icd that fix important
>> bugs. As the new 1.4 version also contains refactorized code that would lead
>> to lots of difference with the actual sources in Debian, I backported only the
>> bug fixes. I think they should really be applied for wheezy.
> [...]
>> Note also that I did not yet upload the new package (1.3-3). You can see
>> it here:
>> http://moais.imag.fr/membres/vincent.danjean/debian/pool/main/o/ocl-icd/
>> And the debdiff against the 1.3-2 version currently in testing is in
>> attachment.
> 
> There didn't seem to be an attachment?

Sorry, I forgot. Here is.

  Vincent

> Regards,
> 
> Adam
> 


-- 
Vincent Danjean          Adresse: Laboratoire d'Informatique de Grenoble
Téléphone:  +33 4 76 61 20 11            ENSIMAG - antenne de Montbonnot
Fax:        +33 4 76 61 20 99            ZIRST 51, avenue Jean Kuntzmann
Email: Vincent.Danjean@imag.fr           38330 Montbonnot Saint Martin
diff -Nru ocl-icd-1.3/debian/changelog ocl-icd-1.3/debian/changelog
--- ocl-icd-1.3/debian/changelog	2012-06-26 02:08:19.000000000 +0200
+++ ocl-icd-1.3/debian/changelog	2012-08-31 01:11:09.000000000 +0200
@@ -1,3 +1,12 @@
+ocl-icd (1.3-3) unstable; urgency=low
+
+  * backport fix from 1.4 release
+    + fix version in OpenCL.pc file
+    + fix 3 initialization bugs
+    + fix NULL allowed argument in clCreateContextFromType
+
+ -- Vincent Danjean <vdanjean@debian.org>  Fri, 31 Aug 2012 00:46:47 +0200
+
 ocl-icd (1.3-2) unstable; urgency=low
 
   * rewrote relationships after thinking about OpenCL in Debian
diff -Nru ocl-icd-1.3/debian/patches/from-upsteam_Use-OpenCL-supported-version-in-pc-file.patch ocl-icd-1.3/debian/patches/from-upsteam_Use-OpenCL-supported-version-in-pc-file.patch
--- ocl-icd-1.3/debian/patches/from-upsteam_Use-OpenCL-supported-version-in-pc-file.patch	1970-01-01 01:00:00.000000000 +0100
+++ ocl-icd-1.3/debian/patches/from-upsteam_Use-OpenCL-supported-version-in-pc-file.patch	2012-08-31 01:11:09.000000000 +0200
@@ -0,0 +1,40 @@
+From 9dab108ddbc7be9dd1b6384d8e143be92beb3345 Mon Sep 17 00:00:00 2001
+From: Vincent Danjean <Vincent.Danjean@ens-lyon.org>
+Date: Fri, 31 Aug 2012 00:16:57 +0200
+Subject: [PATCH] [fix] Use OpenCL supported version as version in OpenCL.pc
+
+ocl-icd version is not relevant for applications requiring OpenCL.pc
+---
+ OpenCL.pc.in |    2 +-
+ configure.ac |    3 +++
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/OpenCL.pc.in b/OpenCL.pc.in
+index ddbe78b..685ef2f 100644
+--- a/OpenCL.pc.in
++++ b/OpenCL.pc.in
+@@ -5,6 +5,6 @@ includedir=@includedir@
+ 
+ Name: OpenCL
+ Description: Open Computing Language generic Installable Client Driver Loader
+-Version: @VERSION@
++Version: @OPENCL_VERSION@
+ Libs: -L${libdir} -lOpenCL
+ Cflags: -I${includedir}
+diff --git a/configure.ac b/configure.ac
+index 780d836..cdeb019 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -11,6 +11,9 @@ AM_INIT_AUTOMAKE([-Wall -Werror foreign 1.9 tar-pax check-news color-tests paral
+ AMX_SILENT_RULES([AM_DEFAULT_VERBOSITY=0])
+ LT_INIT([disable-static])
+ 
++OPENCL_VERSION="1.2"
++AC_SUBST([OPENCL_VERSION])
++
+ # Checks for programs.
+ AC_PROG_CC_C89
+ AC_PROG_INSTALL
+-- 
+1.7.10.4
+
diff -Nru ocl-icd-1.3/debian/patches/from-upstream_fix-clCreateContextFromType.patch ocl-icd-1.3/debian/patches/from-upstream_fix-clCreateContextFromType.patch
--- ocl-icd-1.3/debian/patches/from-upstream_fix-clCreateContextFromType.patch	1970-01-01 01:00:00.000000000 +0100
+++ ocl-icd-1.3/debian/patches/from-upstream_fix-clCreateContextFromType.patch	2012-08-31 01:11:09.000000000 +0200
@@ -0,0 +1,61 @@
+From 52652b3e9dea6e7350da16fca530a89d26cbacf6 Mon Sep 17 00:00:00 2001
+From: Vincent Danjean <Vincent.Danjean@ens-lyon.org>
+Date: Fri, 31 Aug 2012 00:20:27 +0200
+Subject: [PATCH 2/2] [bug fix] clCreateContextFromType can have a NULL
+ properties
+
+In this case, we just need to pick a random platform
+---
+ ocl_icd_loader.c |   12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+--- a/icd_generator.rb
++++ b/icd_generator.rb
+@@ -269,6 +269,17 @@
+     ocl_icd_loader_gen_source += "#include \"ocl_icd_loader.h\"\n"
+     ocl_icd_loader_gen_source += "#include \"ocl_icd_debug.h\"\n"
+     ocl_icd_loader_gen_source += "void _initClIcd();\n"
++    ocl_icd_loader_gen_source += <<EOF
++struct vendor_icd;
++struct platform_icd {
++  char *	 extension_suffix;
++  char *	 version;
++  struct vendor_icd *vicd;
++  cl_platform_id pid;
++};
++extern struct platform_icd *_picds;
++extern cl_uint _num_picds;
++EOF
+     ocl_icd_loader_gen_source += ""
+     $api_entries.each { |func_name, entry|
+       next if forbidden_funcs.include?(func_name)
+@@ -317,6 +328,18 @@
+         return ((struct _cl_platform_id *) properties[i+1])->dispatch->clCreateContextFromType(properties, device_type, pfn_notify, user_data, errcode_ret);
+       i += 2;
+     }
++  } else {
++    /* if properties is null, the selected platform is implementation dependant
++     * We will use the first one if any
++     */
++    if(_num_picds == 0) {
++      if(errcode_ret) {
++        *errcode_ret = CL_INVALID_VALUE;
++      }
++      RETURN(NULL);
++    }
++    RETURN(_picds[0].pid->dispatch->clCreateContextFromType
++	(properties, device_type, pfn_notify, user_data, errcode_ret));
+   }
+   *errcode_ret = CL_INVALID_PLATFORM;
+   return NULL;
+--- a/ocl_icd_loader.c
++++ b/ocl_icd_loader.c
+@@ -62,7 +62,7 @@
+ struct vendor_icd *_icds=NULL;
+ struct platform_icd *_picds=NULL;
+ static cl_uint _num_icds = 0;
+-static cl_uint _num_picds = 0;
++cl_uint _num_picds = 0;
+ 
+ static cl_uint _initialized = 0;
+ 
diff -Nru ocl-icd-1.3/debian/patches/from-upstream_fix-initialization.patch ocl-icd-1.3/debian/patches/from-upstream_fix-initialization.patch
--- ocl-icd-1.3/debian/patches/from-upstream_fix-initialization.patch	1970-01-01 01:00:00.000000000 +0100
+++ ocl-icd-1.3/debian/patches/from-upstream_fix-initialization.patch	2012-08-31 01:11:09.000000000 +0200
@@ -0,0 +1,55 @@
+From d8027d3989bbca158c3909ca582d6aca83ffbe47 Mon Sep 17 00:00:00 2001
+From: Vincent Danjean <Vincent.Danjean@ens-lyon.org>
+Date: Fri, 31 Aug 2012 00:19:05 +0200
+Subject: [PATCH 1/2] [bug fix] Initialize the library in all possible first
+ functions
+
+---
+ ocl_icd_loader.c |    6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/icd_generator.rb
++++ b/icd_generator.rb
+@@ -268,6 +268,7 @@
+     ocl_icd_loader_gen_source = "/**\n#{$license}\n*/\n"
+     ocl_icd_loader_gen_source += "#include \"ocl_icd_loader.h\"\n"
+     ocl_icd_loader_gen_source += "#include \"ocl_icd_debug.h\"\n"
++    ocl_icd_loader_gen_source += "void _initClIcd();\n"
+     ocl_icd_loader_gen_source += ""
+     $api_entries.each { |func_name, entry|
+       next if forbidden_funcs.include?(func_name)
+@@ -278,6 +279,7 @@
+       ocl_icd_loader_gen_source += clean_entry.gsub(/\[.*?\]/,"")
+       if func_name == "clCreateContext" then
+         ocl_icd_loader_gen_source += <<EOF
++  _initClIcd();
+   cl_uint i=0;
+   if( properties != NULL){
+     while( properties[i] != 0 ) {
+@@ -294,6 +296,7 @@
+ EOF
+       elsif func_name == "clGetGLContextInfoKHR" then
+         ocl_icd_loader_gen_source += <<EOF
++  _initClIcd();
+   cl_uint i=0;
+   if( properties != NULL){
+     while( properties[i] != 0 ) {
+@@ -306,6 +309,7 @@
+ EOF
+       elsif func_name == "clCreateContextFromType" then
+         ocl_icd_loader_gen_source += <<EOF
++  _initClIcd();
+   cl_uint i=0;
+   if( properties != NULL){
+     while( properties[i] != 0 ) {
+--- a/ocl_icd_loader.c
++++ b/ocl_icd_loader.c
+@@ -396,7 +396,7 @@
+   }
+ }
+ 
+-static void _initClIcd( void ) {
++void _initClIcd( void ) {
+   if( _initialized )
+     return;
+   debug_init();
diff -Nru ocl-icd-1.3/debian/patches/series ocl-icd-1.3/debian/patches/series
--- ocl-icd-1.3/debian/patches/series	2012-06-26 02:08:19.000000000 +0200
+++ ocl-icd-1.3/debian/patches/series	2012-08-31 01:11:09.000000000 +0200
@@ -0,0 +1,3 @@
+from-upsteam_Use-OpenCL-supported-version-in-pc-file.patch
+from-upstream_fix-initialization.patch
+from-upstream_fix-clCreateContextFromType.patch
diff -Nru ocl-icd-1.3/debian/README.Debian ocl-icd-1.3/debian/README.Debian
--- ocl-icd-1.3/debian/README.Debian	2012-06-26 02:08:19.000000000 +0200
+++ ocl-icd-1.3/debian/README.Debian	2012-08-31 01:11:09.000000000 +0200
@@ -195,12 +195,14 @@
 
 [ocl-icd] (version 1.3-2 currently in NEW or in my own repo)
 * ocl-icd-libopencl1: ocl-icd ICD Loader (support OpenCL 1.2)
-    install libOpenCL.so.1
+    install libOpenCL.so.1.0.0
       shared library
         soname libOpenCL.so.1
         symbols versionned (with OpenCL version, but no conflicts on symbols)
+    install libOpenCL.so.1
+      symlink to libOpenCL.so.1.0.0
     install libOpenCL.so
-      symlink to libOpenCL.so.1
+      symlink to libOpenCL.so.1.0.0
   Multi-Arch: same
   Provides: libopencl1
   Conflicts: libopencl1, amd-app, nvidia-libopencl1-dev
@@ -287,9 +289,27 @@
 * due to the soname of Intel (libOpenCL.so instead of libOpenCL.so.1), it is
   better to install the libOpenCL.so link in the libopencl1 packages instead
   of installing it in the dev packages
-* here is a summary of problems/warning for different combinaison of
+* is it really necessary to keep the three -dev packages?
+  + ocl-icd-opencl-dev is free and provides a OpenCL.pc file
+  + amd-opencl-dev is a metapackage that install by default the amd-libopencl1
+    that itself install by default the amd-opencl-icd
+  + same for nvidia-opencl-dev
+* if we keep the three -dev packages (to ease the installation of the
+  full AMD and NVidia SDK), do we want to rename ocl-icd-opencl-dev
+  into opencl-dev (ie use the virtual package name as the binary
+  package name of the free alternative)
+* do we want to keep the various *-libopencl1 (ie ICD loaders) packages in
+  Debian?
+  ocl-icd-libopencl1 provides a free alternative
+  {amd,nvidia}-libopencl1 will be useful:
+  - when ocl-icd-libopencl1 is not yet updated to the latest version
+    where as {amd,nvidia}-libopencl1 are
+  - if {amd,nvidia}-libopencl1 start to implement non standard things
+  - to ease the reverse engeenering required to improve ocl-icd-libopencl1
+    when non-free ICD loader implements more functions
+* at least, here is a summary of problems/warning for different combinaison of
   ICD *Loaders* used at compile-time (CT) and at run-time (RT)
-  (ICD themselves are not taken into account here)
+  (problems with ICD compatibility themselves are not taken into account here)
 
    \    |	  |	  |	    |	    |
     \RT | ocl-icd | AMD   |  NVidia | Intel |

Reply to: