#933732 causes piglit test failure

Package:
piglit
Source:
piglit
Description:
Open-source test suite for OpenGL and OpenCL implementations
Submitter:
Simon Richter
Date:
2019-09-19 14:06:06 UTC
Severity:
minor
#933732#5
Date:
2019-08-02 15:27:38 UTC
From:
To:
Hi,

I have a single OpenCL ICD installed, and am running piglit tests against
it. I get a test failure in the clGetExtensionFunctionForPlatform test,
which expects NULL to be returned when the platform parameter passed is
NULL. The implementation in ocl-icd does

	platform=selectPlatformID(platform);

which selects the platform if only one is available, causing the test to
fail.

If that is indeed correct behaviour according to the spec, then the
testsuite is wrong, but as far as I've understood it, this function should
not fall back to the default platform if the parameter that is passed is
NULL.

   Simon

#933732#10
Date:
2019-08-02 16:38:13 UTC
From:
To:
Hello Simon,

The behavior seems the correct one (from the spec):

   . How will the ICD handle a `NULL` cl_platform_id?
+
--
RESOLVED: The ICD will by default choose the first enumerated platform as
the `NULL` platform.
The user can override this default by setting an environment variable
OPENCL_ICD_DEFAULT_PLATFORM to the desired platform index.
The API calls that deal with platforms will return CL_INVALID_PLATFORM if
the index is not between zero and (number of platforms - 1), both inclusive.
--

Brice

#933732#19
Date:
2019-08-03 14:13:11 UTC
From:
To:
Patrice, thanks for filing the bug report. I was just looking at that bug
myself. The definition of g_tclextlib at line 41 is in new code added since
the version 4.2.2 that's in Buster.

I'm NOT a Tcl programmer or Modules guru. But is "prefix" something that
should be compiled into the modules at build time, or initialized in
/etc/environment-modules/siteconfig.tcl, or maybe in a file
/etc/environment-modules/rc?

As a workaround I edited modulecmd.tcl to replace "${prefix}" with "/usr"
at line 41. That allows /usr/share/modules/init/bash to complete
successfully and define function "module" correctly.

Hope this helps.

#933732#24
Date:
2019-08-03 14:43:04 UTC
From:
To:
Sorry, that comment was intended for Bug #933782. Pls disregard.
#933732#29
Date:
2019-08-03 14:50:52 UTC
From:
To:

Hi,

First many thanks for your quick reply!

My bug report is #933782 and not #933732 but by chance I saw your reply ;-)
I suspect that the prefix variable should be set at build time (may be it is the
one given to the configure script (--prefix=...)
I was trying to look at https://salsa.debian.org/mckinstry/modules
but it seems to be still the previous version there.

Thanks,
Patrice

#933732#34
Date:
2019-09-19 13:18:19 UTC
From:
To:
Hi,

I've submitted an updated version of this patch upstream, and it was merged
as commit e78d816e on September 5th.

   Simon