10 Replies Latest reply on Jun 17, 2010 6:49 PM by omkaranathan

    clGetPlatformIDs() returning CL_PLATFORM_NOT_FOUND_KHR

    cgorac

      I have Stream SDK v2.01 installed on HP 8530w laptop - no ATI GPUs attached, but NVIDIA FX 770m instead (64-bit Linux, kernel 2.6.33, is the OS installed on the machine).  I have NVIDIA GPU-SDK installed too, and was using it for OpenCL development for the GPU, while I was using Stream SDK for testing the same code on CPU.  This worked pretty well throughout all Stream SDK 2.0-beta releases, however now I have clGetPlatformIDs() returning CL_PLATFORM_NOT_FOUND_KHR, when my code linked with ATI SDK.  Same happens if I try to run any of Stream SDK sample programs (CLInfo, for example).  Note that I'm careful to provide correct LD_LIBRARY_PATH each time when I try to run some OpenCL-based program, so that OpenCL shared library from correct SDK installation is picked up.  Any suggestion here, why the platform is not recognized, and is there anything else besides SDK that has to be installed now to make it work?

        • clGetPlatformIDs() returning CL_PLATFORM_NOT_FOUND_KHR
          omkaranathan

          cgorac,

          Make sure that ICD registration is being done properly. Try doing a clean reinstall(including resistry settings.)

            • clGetPlatformIDs() returning CL_PLATFORM_NOT_FOUND_KHR
              cgorac

              Thanks for your reply.  As mentioned in my first message above, I'm on Linux, thus no registry involved.  On the othe side, again as mentioned in my first message - is there anything else, besides Stream SDK, to get installed if one is intending to use AMD OpenCL implementation for the CPU only?

                • clGetPlatformIDs() returning CL_PLATFORM_NOT_FOUND_KHR
                  omkaranathan

                   

                    As mentioned in my first message above, I'm on Linux,

                  Oops, missed that.

                  On the othe side, again as mentioned in my first message - is there anything else, besides Stream SDK, to get installed if one is intending to use AMD OpenCL implementation for the CPU only?

                  You only need the StreamSDK.

                  Are you sure that the program is picking up the correct shared library? What does an 'ldd' on the application give? Which flavour of Linux are you using?

                    • clGetPlatformIDs() returning CL_PLATFORM_NOT_FOUND_KHR
                      cgorac

                      I'm on 64-bit Slackware.  Checking with ldd is what I've tried first, and everything seems OK: after having my code linked with libOpenCL.so from Stream SDK, ldd is reporting that is indeed linked with this version, and vice versa when having my code linked with libOpenCL.so from NVIDIA GPU-SDK.

                        • clGetPlatformIDs() returning CL_PLATFORM_NOT_FOUND_KHR
                          nou

                          you need create symlink in /usr/lib/OpenCL/vendors to the libatiocl*.so

                            • clGetPlatformIDs() returning CL_PLATFORM_NOT_FOUND_KHR
                              cgorac

                              Many thanks nou - that did it!  Thanks also for not RTFM-ing, I can see now this step is actually mentioned in the installation notes (http://developer.amd.com/gpu/ATIStreamSDK/assets/ATI_Stream_SDK_Installation_Notes.pdf) document...

                                • clGetPlatformIDs() returning CL_PLATFORM_NOT_FOUND_KHR
                                  roadrunner_gs

                                  How have you solved your problem?
                                  I obtained the icd via this link http://www.chiplist.com/icd_registration_tgz_213B/tree3f-aggregator_news_item--98809-/ and untared it in my root directory, afterwards i did a

                                  chown -R root:root /etc/OpenCL

                                  i have following files

                                  # ls -l /etc/OpenCL/vendors/
                                  insgesamt 8
                                  -r--r--r-- 1 root root 15  5. Mär 21:04 atiocl32.icd
                                  -r--r--r-- 1 root root 15  5. Mär 21:04 atiocl64.icd

                                  ati-stream-sdk is in

                                  # ls -l /opt/
                                  insgesamt 28
                                  drwxr-xr-x 3 root     root     4096  5. Apr 17:39 Adobe
                                  lrwxrwxrwx 1 root     root       27  9. Apr 21:27 ati-stream-sdk -> ati-stream-sdk-v2.01-rhel64
                                  drwxr-xr-x 9 a0062995 a0062995 4096  9. Apr 22:25 ati-stream-sdk-v2.01-rhel64
                                  drwxrwxr-x 9     1054     1109 4096 12. Jun 2009  eclipse
                                  drwxr-xr-x 9 a0062995 a0062995 4096  9. Nov 2009  nvidia_cuda_sdk

                                  I also got the so-files

                                  # ls -l /usr/lib64/libatiocl64.so
                                  lrwxrwxrwx 1 root root 45  9. Apr 22:02 /usr/lib64/libatiocl64.so -> /opt/ati-stream-sdk/lib/x86_64/libatiocl64.so
                                  # ls -l /usr/lib64/libOpenCL.so
                                  lrwxrwxrwx 1 root root 43 30. Mai 20:49 /usr/lib64/libOpenCL.so -> /opt/ati-stream-sdk/lib/x86_64/libOpenCL.so

                                  ldd of files looks fine:

                                  $ ldd /opt/ati-stream-sdk/samples/opencl/bin/x86_64/CLInfo
                                          libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003783e00000)
                                          libdl.so.2 => /lib64/libdl.so.2 (0x0000003783a00000)
                                          libOpenCL.so => /usr/lib64/libOpenCL.so (0x00002b54cf95f000)
                                          libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003788200000)
                                          libm.so.6 => /lib64/libm.so.6 (0x0000003783600000)
                                          libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003787e00000)
                                          libc.so.6 => /lib64/libc.so.6 (0x0000003783200000)
                                          /lib64/ld-linux-x86-64.so.2 (0x0000003782e00000)
                                          librt.so.1 => /lib64/librt.so.1 (0x0000003787a00000)

                                  $ ldd stream-test2
                                          libOpenCL.so => /usr/lib64/libOpenCL.so (0x00002b267aa36000)
                                          libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003788200000)
                                          libm.so.6 => /lib64/libm.so.6 (0x0000003783600000)
                                          libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003787e00000)
                                          libc.so.6 => /lib64/libc.so.6 (0x0000003783200000)
                                          libdl.so.2 => /lib64/libdl.so.2 (0x0000003783a00000)
                                          librt.so.1 => /lib64/librt.so.1 (0x0000003787a00000)
                                          libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003783e00000)
                                          /lib64/ld-linux-x86-64.so.2 (0x0000003782e00000)

                                  run of built files does not work:

                                  $ /opt/ati-stream-sdk/samples/opencl/bin/x86_64/CLInfo
                                  terminate called after throwing an instance of 'cl::Error'
                                    what():  clGetPlatformIDs
                                  Abgebrochen

                                  $ ./stream-test2
                                  errorMsg: -1001
                                  platformId: 0
                                  numPlatforms 0
                                  errorMsg: -32
                                  exiting...

                                  second program is built with:

                                  g++ -o stream-test2 stream-test2.cpp -lOpenCL -I/opt/ati-stream-sdk/include

                                  code is:

                                  #include
                                  #include


                                  #include
                                  int main(int argc, char ** argv)
                                  {
                                      cl_int        errMsg;
                                      errMsg = clGetPlatformIDs(1,&platformId,&numPlatforms);
                                      printf("errorMsg: %d\n", errMsg);
                                      printf("platformId: %d\n", platformId);
                                      printf("numPlatforms %d\n", numPlatforms);
                                      errMsg = clGetDeviceIDs(platformId,CL_DEVICE_TYPE_GPU,1,&device,NULL);
                                      printf("errorMsg: %d\n", errMsg);
                                      printf("exiting...\n");
                                      return 0;
                                  }

                                  I have a ATI Radeon HD5770:

                                  # lspci|grep VGA
                                  04:00.0 VGA compatible controller: ATI Technologies Inc Juniper [Radeon HD 5700 Series]

                                  BOINC correctly detecs my GPU if started via console invoked in KDE.

                                  CAL ATI Radeon HD5700 series (Juniper) (1024MB) driver: 1.4.556

                                  what have i missed?