4 Replies Latest reply on Jan 23, 2010 12:43 AM by genaganna

    clGetPlatformIDs failing - "Error: clGetPlatformIDs failed. Error code : unknown error code"

      I cannot get any of the samples to run properly because of the error message above

       

       

      Hi everybody,

       

      I got the SDK and compiled it on Linux (ubuntu 9.10 x86_64 installed on /usr/local/src/ati-stream-sdk-v2.0-lnx64). It all compiled well (after a little hack on one of the samples because of a missing header). I'm using a Radeon 5770. More debug info can be found on: atisysteminfo-report.txt

      After successfuly building the libs and includes and samples and everything, I just copied them over to Ubuntu's directories:

       

      root@niceguy:/usr/lib64# ls -la /usr/lib | grep '2010-01-17'

      drwxr-xr-x 250 root root    98304 2010-01-17 03:48 .

      -rwxr-xr-x   1 root root  9554348 2010-01-17 02:33 builtins_amdil_opt.bc

      -rwxr-xr-x   1 root root  5570188 2010-01-17 02:33 builtins_x86-64.bc

      drwxr-xr-x   2 root root     4096 2010-01-17 03:48 dri

      -rw-r--r--   1 root root   248245 2010-01-17 03:48 libatiadlxx.so

      -rw-r--r--   1 root root   229566 2010-01-17 03:48 libaticalcl.so

      -rw-r--r--   1 root root  6149488 2010-01-17 03:48 libaticaldd.so

      -rw-r--r--   1 root root   238718 2010-01-17 03:48 libaticalrt.so

      -rwxr-xr-x   1 root root 10782944 2010-01-17 02:33 libatiocl64.so

      -rw-r--r--   1 root root    10386 2010-01-17 03:48 libfglrx_dm.a

      -rw-r--r--   1 root root    16242 2010-01-17 03:48 libfglrx_dm.so.1.0

      -rw-r--r--   1 root root     7792 2010-01-17 03:48 libfglrx_gamma.a

      -rw-r--r--   1 root root    13935 2010-01-17 03:48 libfglrx_gamma.so.1.0

      -rw-r--r--   1 root root     5602 2010-01-17 03:48 libfglrx_tvout.a

      -rw-r--r--   1 root root     8304 2010-01-17 03:48 libfglrx_tvout.so.1.0

      -rwxr-xr-x   1 root root   454362 2010-01-17 02:33 libGLEW.a

      -rwxr-xr-x   1 root root   428135 2010-01-17 02:33 libGLEW.so

      lrwxrwxrwx   1 root root       23 2010-01-17 03:48 libGL.so -> /usr/lib64/libGL.so.1.2

      lrwxrwxrwx   1 root root       23 2010-01-17 03:48 libGL.so.1 -> /usr/lib64/libGL.so.1.2

      -rw-r--r--   1 root root   762392 2010-01-17 03:48 libGL.so.1.2

      -rwxr-xr-x   1 root root   753434 2010-01-17 02:33 libglut.so

      -rwxr-xr-x   1 root root    22792 2010-01-17 02:33 libOpenCL.so

      -rwxr-xr-x   1 root root   930560 2010-01-17 02:33 libSDKUtil.a

      root@niceguy:/usr/lib64# 

       

      Then I did the same with the includes:

       

      root@niceguy:/usr/local/include# ls -la /usr/local/include

      total 136

      drwxr-xr-x  5 root root  4096 2010-01-17 02:38 .

      drwxr-xr-x 10 root root  4096 2010-01-17 02:24 ..

      -rwxr-xr-x  1 root root 13095 2010-01-17 02:38 calcl.h

      -rwxr-xr-x  1 root root  7980 2010-01-17 02:38 cal_ext_counter.h

      -rwxr-xr-x  1 root root  6892 2010-01-17 02:38 cal_ext_d3d10.h

      -rwxr-xr-x  1 root root  8442 2010-01-17 02:38 cal_ext_d3d9.h

      -rwxr-xr-x  1 root root 13873 2010-01-17 02:38 cal_ext.h

      -rwxr-xr-x  1 root root 54041 2010-01-17 02:38 cal.h

      drwxr-xr-x  2 root root  4096 2010-01-17 02:38 CL

      drwxr-xr-x  2 root root  4096 2010-01-17 02:38 GL

      drwxr-xr-x  2 root root  4096 2010-01-17 02:38 SDKUtil

      root@niceguy:/usr/local/include# 

       

      So I was able to build some stuff that uses OpenCL successfuly, but it didn't work giving out an error message "Could not retrieve OpenCL device IDs.".

       

      I'm also unable to run the samples. For example:

       

      root@niceguy:/usr/local/src/ati-stream-sdk-v2.0-lnx64/samples/opencl/bin/x86_64# ldd AESEncryptDecrypt

      linux-vdso.so.1 =>  (0x00007fff0f9ff000)

      libpthread.so.0 => /lib/libpthread.so.0 (0x00007f37bfb9d000)

      libdl.so.2 => /lib/libdl.so.2 (0x00007f37bf999000)

      libOpenCL.so => /usr/lib/libOpenCL.so (0x00007f37bf793000)

      libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f37bf483000)

      libm.so.6 => /lib/libm.so.6 (0x00007f37bf1ff000)

      libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f37befe8000)

      libc.so.6 => /lib/libc.so.6 (0x00007f37bec79000)

      /lib64/ld-linux-x86-64.so.2 (0x00007f37bfdb9000)

      librt.so.1 => /lib/librt.so.1 (0x00007f37bea71000)

      root@niceguy:/usr/local/src/ati-stream-sdk-v2.0-lnx64/samples/opencl/bin/x86_64# ./AESEncryptDecrypt

       

      Encrypting Image ....

       

      Input Image : lena512.bmp

       

      Key : 15 201 51 89 92 34 96 66 11 225 161 96 81 211 108 124 

       

      Error: clGetPlatformIDs failed. Error code : unknown error code

       

      root@ niceguy:/usr/local/src/ati-stream-sdk-v2.0-lnx64/samples/opencl/bin/x86_64# 

       

      All OpenCL samples fail with the same error message. The Cal samples don't work either:

       

      root@niceguy:/usr/local/src/ati-stream-sdk-v2.0-lnx64/samples/cal/bin/x86_64# ldd FindNumDevices 

      linux-vdso.so.1 =>  (0x00007fff6f952000)

      libpthread.so.0 => /lib/libpthread.so.0 (0x00007f7a25ae2000)

      libdl.so.2 => /lib/libdl.so.2 (0x00007f7a258de000)

      libaticalrt.so => /usr/lib/libaticalrt.so (0x00007f7a25dd6000)

      libaticalcl.so => /usr/lib/libaticalcl.so (0x00007f7a257c0000)

      libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f7a254b0000)

      libm.so.6 => /lib/libm.so.6 (0x00007f7a2522c000)

      libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f7a25015000)

      libc.so.6 => /lib/libc.so.6 (0x00007f7a24ca6000)

      /lib64/ld-linux-x86-64.so.2 (0x00007f7a25cfe000)

      librt.so.1 => /lib/librt.so.1 (0x00007f7a24a9e000)

      libXext.so.6 => /usr/lib/libXext.so.6 (0x00007f7a2488c000)

      libX11.so.6 => /usr/lib/libX11.so.6 (0x00007f7a24556000)

      libXau.so.6 => /usr/lib/libXau.so.6 (0x00007f7a24353000)

      libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007f7a24137000)

      libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007f7a23f32000)

      root@niceguy:/usr/local/src/ati-stream-sdk-v2.0-lnx64/samples/cal/bin/x86_64# ./FindNumDevices -v 

      Supported CAL Runtime Version: 1.3.185

      Found CAL Runtime Version: 1.4.515

      Use -? for help

      Segmentation fault

       

      root@niceguy:/usr/local/src/ati-stream-sdk-v2.0-lnx64/samples/cal/bin/x86_64# gdb ./FindNumDevices 

      GNU gdb (GDB) 7.0-ubuntu

      Copyright (C) 2009 Free Software Foundation, Inc.

      License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

      This is free software: you are free to change and redistribute it.

      There is NO WARRANTY, to the extent permitted by law.  Type "show copying"

      and "show warranty" for details.

      This GDB was configured as "x86_64-linux-gnu".

      For bug reporting instructions, please see:

      <http://www.gnu.org/software/gdb/bugs/>...

      Reading symbols from /usr/local/src/ati-stream-sdk-v2.0-lnx64/samples/cal/bin/x86_64/FindNumDevices...done.

      (gdb) run

      Starting program: /usr/local/src/ati-stream-sdk-v2.0-lnx64/samples/cal/bin/x86_64/FindNumDevices 

      [Thread debugging using libthread_db enabled]

      Supported CAL Runtime Version: 1.3.185

      Found CAL Runtime Version: 1.4.515

      Use -? for help

       

      Program received signal SIGSEGV, Segmentation fault.

      0x00007ffff5a38a9a in ?? () from /usr/lib/libaticaldd.so

      (gdb) 

       

       

      About the lib file:

      /usr/lib/libaticaldd.so:     file format elf64-x86-64

      /usr/lib/libaticaldd.so

      architecture: i386:x86-64, flags 0x00000150:

      HAS_SYMS, DYNAMIC, D_PAGED

      start address 0x000000000008a6c0

       

      Does anyone here know how I can fix this ? Let me know if you need more debug info.

       

      Thanks !





       

      ddd

        • clGetPlatformIDs failing - "Error: clGetPlatformIDs failed. Error code : unknown error code"
          nou

          you must register ICD. create simlink in /usr/lib/OpenCL/vendors to libatiocl64.so file.

            • clGetPlatformIDs failing - "Error: clGetPlatformIDs failed. Error code : unknown error code"


              Hi nou,

              Thanks for the reply!

              I linked the file you mentioned and now OpenCL samples are just segfaulting as the Cal samples were. Through strace I could see that the "libatiocl64.so" was being loaded and everything. This is where it breaks now:


              root@clusterfucker:/usr/local/src/ati-stream-sdk-v2.0-lnx64/samples/opencl/bin/x86_64# gdb ./AESEncryptDecrypt
              GNU gdb (GDB) 7.0-ubuntu
              Copyright (C) 2009 Free Software Foundation, Inc.
              License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
              This is free software: you are free to change and redistribute it.
              There is NO WARRANTY, to the extent permitted by law. Type "show copying"
              and "show warranty" for details.
              This GDB was configured as "x86_64-linux-gnu".
              For bug reporting instructions, please see:
              <http://www.gnu.org/software/gdb/bugs/>...
              Reading symbols from /usr/local/src/ati-stream-sdk-v2.0-lnx64/samples/opencl/bin/x86_64/AESEncryptDecrypt...done.
              (gdb) run
              Starting program: /usr/local/src/ati-stream-sdk-v2.0-lnx64/samples/opencl/bin/x86_64/AESEncryptDecrypt
              [Thread debugging using libthread_db enabled]
              Encrypting Image ....
              Input Image : lena512.bmp
              Key : 15 201 51 89 92 34 96 66 11 225 161 96 81 211 108 124

              Program received signal SIGSEGV, Segmentation fault.
              0x00007ffff48cca9a in ?? () from /usr/lib/libaticaldd.so
              (gdb) bt
              #0 0x00007ffff48cca9a in ?? () from /usr/lib/libaticaldd.so
              #1 0x00007ffff48cc855 in ?? () from /usr/lib/libaticaldd.so
              #2 0x00007ffff48c8f0f in ?? () from /usr/lib/libaticaldd.so
              #3 0x00007ffff48c0835 in ?? () from /usr/lib/libaticaldd.so
              #4 0x00007ffff47e2553 in ?? () from /usr/lib/libaticaldd.so
              #5 0x00007ffff490a0fa in ?? () from /usr/lib/libaticaldd.so
              #6 0x00007ffff49036c5 in ?? () from /usr/lib/libaticaldd.so
              #7 0x00007ffff4913a35 in ?? () from /usr/lib/libaticaldd.so
              #8 0x00007ffff5f194f3 in ?? () from /usr/lib/OpenCL/vendors/libatiocl64.so
              #9 0x00007ffff5efbd1d in ?? () from /usr/lib/OpenCL/vendors/libatiocl64.so
              #10 0x00007ffff5f22b07 in ?? () from /usr/lib/OpenCL/vendors/libatiocl64.so
              #11 0x00007ffff5ee9a98 in clGetPlatformInfo () from /usr/lib/OpenCL/vendors/libatiocl64.so
              #12 0x00007ffff77bae3b in ?? () from /usr/lib/libOpenCL.so
              #13 0x00007ffff77bac9f in ?? () from /usr/lib/libOpenCL.so
              #14 0x00007ffff77bbe90 in clGetPlatformIDs () from /usr/lib/libOpenCL.so
              #15 0x0000000000403513 in AES::AESEncryptDecrypt::setupCL (this=0x7fffffffe040) at AESEncryptDecrypt.cpp:212
              #16 0x0000000000406ec7 in AES::AESEncryptDecrypt::setup (this=0x7fffffffe040) at AESEncryptDecrypt.cpp:1151
              #17 0x000000000040808a in main (argc=1, argv=0x7fffffffe2f8) at AESEncryptDecrypt.cpp:1355
              (gdb)

              Based on other threads, I created a simple environment startup script:



              #!/bin/sh

              echo "Preparing environment ..."

              export ATISTREAMSDKROOT=/usr/local/src/ati-stream-sdk-v2.0-lnx64
              export ATISTREAMSDKSAMPLESROOT=/usr/local/src/ati-stream-sdk-v2.0-lnx64
              export LD_LIBRARY_PATH=$ATISTREAMSDKROOT/lib/x86_64:$ATISTREAMSDKROOT/lib/x86:$LD_LIBRARY_PATH
              rm -rf /usr/lib/OpenCL
              mkdir /usr/lib/OpenCL
              mkdir /usr/lib/OpenCL/vendors
              ln -sf $ATISTREAMSDKROOT/lib/x86_64/libatiocl64.so /usr/lib/OpenCL/vendors/libatiocl64.so
              ln -sf $ATISTREAMSDKROOT/lib/x86/libatiocl32.so /usr/lib/OpenCL/vendors/libatiocl32.so

              cd $ATISTREAMSDKROOT/samples/opencl/bin/x86_64
              strace -o /tmp/foo.log ./AESEncryptDecrypt
              cat /tmp/foo.log | grep '/vendors'
              tail -n 5 /tmp/foo.log
              rm /tmp/foo.log

              echo "Done."




              When I run it, I still get:

              root@clusterfucker:/usr/local/src/ati-stream-sdk-v2.0-lnx64/samples/cal/bin/x86_64# sh runner.sh
              Preparing environment ...
              Encrypting Image ....
              Input Image : lena512.bmp
              Key : 15 201 51 89 92 34 96 66 11 225 161 96 81 211 108 124
              open("/usr/lib/OpenCL/vendors/", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
              open("/usr/lib/OpenCL/vendors/libatiocl64.so", O_RDONLY) = 4
              --- SIGSEGV (Segmentation fault) @ 0 (0) ---
              +++ killed by SIGSEGV +++
              Done.
              root@clusterfucker:/usr/local/src/ati-stream-sdk-v2.0-lnx64/samples/cal/bin/x86_64#

              What else do I need to do to fix this ? Should other files be linked on that vendors directory ?

              Thanks for your help !