On 08/23/2016 02:07 AM, Emil Velikov wrote:
Skimmed through the discussion and I'm not sure the above will be enough.

Since the user is free to place json files in $HOME/.local ... this
implies that they may _not_ have access to /usr or /etc. Thus as they
install the file (to say $HOME/foo/lib) the Vulkan loader will not be
able to pick it up.

Why not?

Stick the 32-bit library in $HOME/foo/lib, the 64-bit library in $HOME/foo/lib64, set library_path to "/home/emil/foo/$LIB/lib_mygpu.so" in the $HOME/.local/share/vulkan/icd.d/mygpu.json file, and it should work, right?

In theory one should be able to have a varying .json (one with and one
without the path) although the heuristics will be fragile due to the
varying $LIB (like the case of Debian and derivatives) and $DESTDIR.

So I see the following options:
 - new configure option - have to agree with Dave, please don't.
Furthermore we already have more than 50! of them.
 - fold the "w or w/o full path" under and existing option
(--enable-debug ?) - somewhat picky/fragile as well. Kind of OK for
short term solution.
 - use LD_LIBRARY_PATH - slightly annoying yet add once and forget
about it. OK-ish short term solution.
 - json update - the better long term solution imho.

Json update:
 - the same file _cannot_ be provided by multiple packages

RPM certainly allows this, as long as the packages that provide the file have the same name & version, different architectures, and the files are byte-identical. Sticking $LIB in the path instead of "lib" or "lib64" makes the files byte-identical.

 - thus we should use differently named files, but we should not rely
on the filename to determine arch/triple.
There has been no such recommendations/restrictions about the name so
starting now feels wrong.
 - so let's bump "file_format_version" - 1.0.1 or 1.1.0 ?
 - add ICD::arch tag and teach the loader to honour it. For json files
missing it we'll assume a "can be used on this platform" behaviour.
 - should we bother with the other parts of the triple or add it only
as need arise ?

With the above in place, one can have full path + filename for the
mutlilib setups. Old loaders will just get an error upon dlopen of
incompatible/wrong arch ICDs.

How do the above short/long term solutions sound ?

Thanks
Emil


_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to