[lug] Reverse LD_PRELOAD?

Davide Del Vento davide.del.vento at gmail.com
Mon Jul 9 15:05:10 MDT 2018


The clean way to do it, is by using LD_PRELOAD and/or LD_LIBRARY_PATH
and/or RPATH. I personally prefer the latter.

Regarding the linking, gcc4 through gcc7 do not differ at all, in fact
the linking is done by ld ;-)
In other regards, those versions of the (same) compiler do differ a lot.



On Mon, Jul 9, 2018 at 2:47 PM,  <stimits at comcast.net> wrote:
> Various multimedia programs routinely check for GPU rendering capabilities.
> Sometimes they are with OpenCL for AMD video cards, sometimes this is for
> CUDA for NVIDIA video cards. If it finds the capability, then it uses the
> first one it runs into. If not, it reverts to CPU. So some applications do
> not consider this an error, they just use different hardware in that case.
> In my case I have older and newer versions of libraries, and I'm interested
> in comparing results with different GPU interfaces.
>
> Currently I'm doing something like what Zan Lynx noted in his reply. It just
> seems like perhaps there is some trick I don't know about to make this more
> elegant. Plus I sometimes have versions compiled with different compilers
> (ranging from gcc4 through gcc7) and am curious how they differ.
>
> ----- Original Message -----
> From: Davide Del Vento <davide.del.vento at gmail.com>
> To: Boulder (Colorado) Linux Users Group -- General Mailing List
> <lug at lug.boulder.co.us>
> Sent: Mon, 09 Jul 2018 20:40:21 -0000 (UTC)
> Subject: Re: [lug] Reverse LD_PRELOAD?
> Never load would not make any sense. If your application is linked
> against it (or loads it with dlopen), it needs it. If it does not need
> it, it's a bug in your application.
> If it does need it, but you have another version that you want to use,
> either use LD_PRELOAD and/or LD_LIBRARY_PATH and/or RPATH.
> On Mon, Jul 9, 2018 at 2:32 PM, <stimits at comcast.net> wrote:
>> Hi,
>>
>> I just thinking perhaps there is some simple trick to avoid or blacklist a
>> library for just a single application for testing in a way similar to
>> using
>> LD_PRELOAD to force a given library path. So for example I have an OpenCL
>> library and although I do not want to remove the file for the rest of the
>> system I'd to do something similar to:
>> LD_NEVER_LOAD=/lib64/libOpenCL.so.1.0.0 ./my_application
>>
>> Anyone here know of a convenient method to do this for just this one
>> application?
>>
>> _______________________________________________
>> Web Page: http://lug.boulder.co.us
>> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
>> Join us on IRC: irc.hackingsociety.org port=6667 channel=#hackingsociety
> _______________________________________________
> Web Page: http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: irc.hackingsociety.org port=6667 channel=#hackingsociety
>
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: irc.hackingsociety.org port=6667 channel=#hackingsociety


More information about the LUG mailing list