cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

bj_mill
Journeyman III

Must /usr/lib/OpenCL/vendors exist?

I don't have root access.  Can this path be changed with some environment variable?

Thanks,

Brian

0 Likes
4 Replies
genaganna
Journeyman III

Originally posted by: bj_mill I don't have root access.  Can this path be changed with some environment variable?

 

 

You must create /usr/lib/OpenCL/vendors. There is no other way presently.

 

0 Likes

Originally posted by: genaganna
Originally posted by: bj_mill I don't have root access.  Can this path be changed with some environment variable?

 

 

 

 

 

 

You must create /usr/lib/OpenCL/vendors. There is no other way presently.

 

 

 

Thanks for answering the question.  Now I'm off to see the Sys Admins...

 

Brian

0 Likes

Originally posted by: genaganna
Originally posted by: bj_mill I don't have root access.  Can this path be changed with some environment variable?

You must create /usr/lib/OpenCL/vendors. There is no other way presently.

This isn't exactly true...

You can hack the libOpenCL.so file and change the vendor location (note: this breaks the OpenCL standard, but I'm assuming you can live with that for development)

First you must create a new vendors directory that has the same character length as /usr/lib/OpenCL/vendors (23 characters)

For this example, I created the directory /usr/people/jaross/CL/v (23 characters)

mkdir -p /usr/people/jaross/CL/v

Goto the OpenCL lib directory:

cd $ATISTREAMSDKROOT/lib/x86_64

Make a backup copy of the library in case you screw up:

cp libOpenCL.so libOpenCL.so.bak

Now you will edit the binary.  There is probably a better way to do this, but it works... (modify this command to your location):

CHECK ATTACHED CODE AT BOTTOM...

Now compare the file sizes of libOpenCL.so and foo.so (they should be identical)

ls -l

Verify they are the same size or try again.  If they are the same size, overwrite libOpenCL.so with foo.so and change permissions

mv foo.so libOpenCL.so

chmod +x libOpenCL.so

Then add all your symlinks to point to your new vendors directory and you should be good to go.

sed 's/usr\/lib\/OpenCL\/vendors/usr\/people\/jaross\/CL\/v/' <libOpenCL.so > foo.so

0 Likes

Thanks for the suggestion.  This along with making sure I have a modern libstdc++.so

in my LD_LIBRARY_PATH were enough to get the samples working with--device cpu.

0 Likes