cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

gmt2027
Journeyman III

Shared library load error during clBuildProgram on Ubuntu 11.10

I have installed the APP SDK and the samples build successfully, however at runtime I get the following output

Build Options are : -D DATATYPE=float2

                              BUILD LOG

************************************************

Internal Error: loading shared library failed!

************************************************

Error: clBuildProgram failed. Error code : CL_BUILD_PROGRAM_FAILURE

Location : SDKCommon.cpp:1614

Error: sampleCommon::buildOpenCLProgram() failed

Location : LDSBandwidth.cpp:281

Using strace shows this

open("/tmp/OCLxmk7zD_amdrt.o", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 4

writev(4, [{NULL, 0}, {"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\1\0\3\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 2136}], 2) = 2136

close(4)                                = 0

vfork()                                 = 19986

waitpid(19986, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0) = 19986

--- SIGCHLD (Child exited) @ 0 (0) ---

unlink("/tmp/OCLxmk7zD.o")              = 0

unlink("/tmp/OCLxmk7zD_amdrt.o")        = 0

open("/tmp/OCLxmk7zD.so", O_RDONLY|O_LARGEFILE) = 4

_llseek(4, 0, [61835], SEEK_END)        = 0

_llseek(4, 0, [61835], SEEK_CUR)        = 0

_llseek(4, 0, [0], SEEK_SET)            = 0

read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\240\5\0\0004\0\0\0"..., 61835) = 61835

close(4)                                = 0

brk(0x9fa5000)                          = 0x9fa5000

open("/tmp/OCLxmk7zD.so", O_RDONLY)     = 4

read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\240\5\0\0004\0\0\0"..., 512) = 512

fstat64(4, {st_mode=S_IFREG|0775, st_size=61835, ...}) = 0

mmap2(NULL, 63468, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = -1 EPERM (Operation not permitted)

close(4)                                = 0

open("/tmp/libOCLxmk7zD.so", O_RDONLY)  = -1 ENOENT (No such file or directory)

close(3)                                = 0

unlink("/tmp/OCLb2MAb3")                = 0

It appears that the platform successfully compiles a shared library to /tmp/OCLxmk7zD.so and subsequently attempts to load /tmp/libOCLxmk7zD.so. Is this expected behaviour or a problem with my setup? pyopencl also gives the same error.

0 Likes
1 Solution
gmt2027
Journeyman III

This may be of help to someone else. I am using a Solid State Drive, /tmp is mounted as a tmpfs in RAM with the 'noexec' flag set to avoid unnecessary writes to the disk and that was preventing the shared library load. Removing 'noexec' in /etc/fstab solved the problem.

View solution in original post

0 Likes
1 Reply
gmt2027
Journeyman III

This may be of help to someone else. I am using a Solid State Drive, /tmp is mounted as a tmpfs in RAM with the 'noexec' flag set to avoid unnecessary writes to the disk and that was preventing the shared library load. Removing 'noexec' in /etc/fstab solved the problem.

0 Likes