<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 4, 2015 at 12:11 PM, Ilia Mirkin <span dir="ltr"><<a href="mailto:imirkin@alum.mit.edu" target="_blank">imirkin@alum.mit.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class=""><div class="h5">On Mon, May 4, 2015 at 12:47 PM, Tom Stellard <<a href="mailto:tom@stellard.net">tom@stellard.net</a>> wrote:<br>
> On Mon, May 04, 2015 at 10:13:19AM -0400, Ilia Mirkin wrote:<br>
>> On Mon, May 4, 2015 at 10:04 AM, Tom Stellard <<a href="mailto:tom@stellard.net">tom@stellard.net</a>> wrote:<br>
>> > On Sat, May 02, 2015 at 01:31:41PM -0400, Ilia Mirkin wrote:<br>
>> >> On Sat, May 2, 2015 at 1:19 PM, EdB <<a href="mailto:edb%2Bmesa@sigluy.net">edb+mesa@sigluy.net</a>> wrote:<br>
>> >> > The standard ICD file path is /etc/OpenCL/vendor/.<br>
>> >> > However it doesn't fit well with custom build.<br>
>> >> > This option allow ICD vendor file installation path override<br>
>> >> > ---<br>
>> >> >  <a href="http://configure.ac" target="_blank">configure.ac</a>                           | 6 ++++++<br>
>> >> >  src/gallium/targets/opencl/Makefile.am | 2 +-<br>
>> >> >  2 files changed, 7 insertions(+), 1 deletion(-)<br>
>> >> ><br>
>> >> > diff --git a/<a href="http://configure.ac" target="_blank">configure.ac</a> b/<a href="http://configure.ac" target="_blank">configure.ac</a><br>
>> >> > index 095e23e..bf08d76 100644<br>
>> >> > --- a/<a href="http://configure.ac" target="_blank">configure.ac</a><br>
>> >> > +++ b/<a href="http://configure.ac" target="_blank">configure.ac</a><br>
>> >> > @@ -2005,6 +2005,12 @@ AC_ARG_WITH([d3d-libdir],<br>
>> >> >      [D3D_DRIVER_INSTALL_DIR="$withval"],<br>
>> >> >      [D3D_DRIVER_INSTALL_DIR="${libdir}/d3d"])<br>
>> >> >  AC_SUBST([D3D_DRIVER_INSTALL_DIR])<br>
>> >> > +AC_ARG_WITH([icd-file-dir],<br>
>> >> > +    [AS_HELP_STRING([--with-icd-file-dir=DIR],<br>
>> >> > +        [directory for the OpenCL ICD vendor file @<:@/etc/OpenCL/vendors@:>@])],<br>
>> >> > +    [ICD_FILE_INSTALL_DIR="$withval"],<br>
>> >> > +    [ICD_FILE_INSTALL_DIR="/etc/OpenCL/vendors"])<br>
>> >><br>
>> >> What about making this default to ${sysconfdir}/OpenCL/vendors ? That<br>
>> >> way using --prefix should auto-make it go into the prefix instead of<br>
>> >> unexpectedly installing things outside of the specified prefix? That<br>
>> >> way a distro build which specifies --sysconfdir as /etc will get it in<br>
>> >> the right place, while by default it'll go into /usr/local/etc and a<br>
>> >> user can override the icd loader's default behaviour with<br>
>> >> OPENCL_VENDOR_PATH?<br>
>> >><br>
>> ><br>
>> > I would prefer not to make this the default behavior, because it violates the spec<br>
>> > and there could potentially be multiple icd implementations, which may or may not have<br>
>> > the overrides.<br>
>> ><br>
>> > I think the best solution would be to rename the option to something like<br>
>> > --enable-ocl-icd-respect-prefix (suggestions for other names encouraged).<br>
>> > and have the option enable the behavior that Ilia is describing.<br>
>> ><br>
>> > This will give distros and advanced users a way to setup their system<br>
>> > the way they want.<br>
>><br>
>> It's just a very anti-autoconf thing to do to have "make install" fail<br>
>> by default unless you specify some "hey, i actually want make install<br>
>> to work" option.<br>
>><br>
>> I think it's crazy to expect that, by default, people will want to<br>
>> write over their system installs, and having things go outside of the<br>
>> specified --prefix is very surprising (unless you force some other<br>
>> option). And asking the user to run "make install" as root is even<br>
>> crazier.<br>
>><br>
><br>
> My expectation is that, by default, when people specify --enable-opencl-icd<br>
> they want an implementation that conforms to the specification.<br>
> Unfortunately, this means installing icd files to /etc.<br>
<br>
</div></div>Oh, does this only happen when I supply some option? I.e. if I just do<br>
./configure --prefix=... it'll still work, I have to do<br>
--enable-opencl-icd and only *then* does it install the other thing?<br>
That might be more acceptable, although still not really.<br>
<span class=""><br>
><br>
> There is no good solution here, but I'd rather have users specify a flag<br>
> to get a sane build system, than requiring them to set a flag and set<br>
> an environment variable just to get working OpenCL with the ICD loader.<br>
<br>
</span>I know exceedingly little about OpenCL. I'm just coming at this from a<br>
generic "build shouldn't try to install things outside the prefix"<br>
perspective. Make install shouldn't fail, and users shouldn't be<br>
tempted into accidentally overwriting their system installs even<br>
though they set a prefix but then foolishly ran 'sudo make install'.<br>
<br>
Autoconf is a pretty common build helper, nearly every sane package<br>
with a unix build target uses it, and I think people are used to how<br>
it works. One of the cool things is that you can do "./configure<br>
--prefix=/home/user/install; make install" and expect it to work (as<br>
in, things landing in /home/user/install/..., not in /). Or perhaps<br>
you use a system like 'stow' which takes care of all the<br>
symlinking/etc and allows you to easily have multiple versions of the<br>
same software.<br>
<br>
Having things go outside of the configured directories goes against<br>
the autoconf standard... perhaps it'd be OK if you added some giant<br>
warning at the end of configure output saying "DANGER DANGER DANGER<br>
will do unexpected things by default!".<br>
<span class=""><br>
><br>
>> I guess I haven't hit this yet because there's no OpenCL support in<br>
>> nouveau or freedreno, but I made the same stink about vdpau when Emil<br>
>> tried to make it install to some system location by default. At least<br>
>> a few people seemed to agree with me back then...<br>
>><br>
><br>
> Does the vdpau spec also require installation to a specific system director<br>
> (e.g. /etc/) ?<br>
<br>
</span>The vdpau loader (libvdpau) loads from a fixed (and arbitrarily<br>
configurable at build-time, and practically speaking set differently<br>
on different distributions) library directory, much like (the mesa)<br>
libGL does. However there's (now) a VDPAU_DRIVER_PATH or something<br>
along those lines that can be passed in.<br></blockquote><div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
My understanding was that the icd loader had a similar env var.<br></blockquote><div><br></div><div>Depending on the loader you use, that might be the case, but the official ICD Loader code from Khronos (<a href="https://www.khronos.org/registry/cl/specs/opencl-icd-1.2.11.0.tgz">https://www.khronos.org/registry/cl/specs/opencl-icd-1.2.11.0.tgz</a>) has a hard-coded path of /etc/OpenCL/vendors/<br><br></div><div>The spec requires any ICDs to be registered in that specific directory.  On windows, things happen through the registry.<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
How about this -- get rid of --enable-opencl-icd and change it to<br>
--with-opencl-icd-dir where you must supply a directory if you want to<br>
use it. That way if you want the system one, you'd say<br>
/etc/OpenCL/vendors, if you want your own custom dir, then put that<br>
in.<br>
<div class=""><div class="h5"><br>
  -ilia<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br></div></div>