7 Replies Latest reply on Jan 7, 2011 7:06 PM by pulec

    HelloCL get segmentation fault on CPU

    ansoncat

      Hi,

      On my computer, the sample program HelloCL get segmentation fault while running on a CPU device.

      Here are output messages:


      HelloCL!

      Getting Platform Information

      Creating a context AMD platform

      Getting device info

      Loading and compiling CL source

      Segmentation fault

      Segmentation fault is gone when I try to use GDB to debug it.

      I have no idea what may happened.

      Testing environment I used : 

      Ubuntu 10.10 32-bit + Stream SDK 2.2/2.3 + Core i5 520M + Geforce 310M (nvidia ICD is removed)

      Here are info dump by CLInfo:

       


       

      Number of platforms: 1

        Platform Profile: FULL_PROFILE

        Platform Version: OpenCL 1.1 ATI-Stream-v2.3 (451)

        Platform Name: ATI Stream

        Platform Vendor: Advanced Micro Devices, Inc.

        Platform Extensions: cl_khr_icd cl_amd_event_callback cl_amd_offline_devices

        Platform Name: ATI Stream

      Number of devices: 1

        Device Type: CL_DEVICE_TYPE_CPU

        Device ID: 4098

        Max compute units: 4

        Max work items dimensions: 3

          Max work items[0]: 1024

          Max work items[1]: 1024

          Max work items[2]: 1024

        Max work group size: 1024

        Preferred vector width char: 16

        Preferred vector width short: 8

        Preferred vector width int: 4

        Preferred vector width long: 2

        Preferred vector width float: 4

        Preferred vector width double: 0

        Native vector width char: 16

        Native vector width short: 8

        Native vector width int: 4

        Native vector width long: 2

        Native vector width float: 4

        Native vector width double: 0

        Max clock frequency: 2400Mhz

        Address bits: 32

        Max memory allocation: 536870912

        Image support: No

        Max size of kernel argument: 4096

        Alignment (bits) of base address: 1024

        Minimum alignment (bytes) for any datatype: 128

        Single precision floating point capability

          Denorms: Yes

          Quiet NaNs: Yes

          Round to nearest even: Yes

          Round to zero: Yes

          Round to +ve and infinity: Yes

          IEEE754-2008 fused multiply-add: No

        Cache type: Read/Write

        Cache line size: 64

        Cache size: 32768

        Global memory size: 1073741824

        Constant buffer size: 65536

        Max number of constant args: 8

        Local memory type: Global

        Local memory size: 32768

        Kernel Preferred work group size multiple: 1

        Error correction support: 0

        Unified memory for Host and Device: 1

        Profiling timer resolution: 1

        Device endianess: Little

        Available: Yes

        Compiler available: Yes

        Execution capabilities:  

          Execute OpenCL kernels: Yes

          Execute native function: Yes

        Queue properties:  

          Out-of-Order: No

          Profiling : Yes

        Platform ID: 0xb74fcb80

        Name: Intel(R) Core(TM) i5 CPU       M 520  @ 2.40GHz

        Vendor: GenuineIntel

        Driver version: 2.0

        Profile: FULL_PROFILE

        Version: OpenCL 1.1 ATI-Stream-v2.3 (451)

        Extensions: cl_amd_fp64 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_gl_sharing cl_ext_device_fission cl_amd_device_attribute_query cl_amd_media_ops cl_amd_popcnt cl_amd_printf 

       


       

          • HelloCL get segmentation fault on CPU
            pulec
            Himanshu, are you sure? I think that if do not run on GPU, ATI stream doesn't require Catalyst drivers. I am sure that I could run the samples (on CPU) while I was using open-source radeon X driver (and didn't have path to /usr/lib/fglrx/* in LD_LIBRARY_PATH, or even not the Catalyst installed).

            EDIT: Supposing that other system requirements are trivially satisfied (eg. in Ubuntu 10.10 is default gcc 4.4 which is ok). Or do you think it's because of Intel processor?
              • HelloCL get segmentation fault on CPU
                himanshu.gautam

                I have seen some other post reporting problem with ubuntu 10.10. This OS is not mentioned in Supported OSes list.Have you tried on some listed OS?

                OpenCL should work on CPU without Catalyst and i am not aware of any issues with intel CPUs either.

                  • HelloCL get segmentation fault on CPU
                    ansoncat

                    I have tested it on Win 7 64bit on the same machine.

                    Both 32 and 64 bit of Stream SDK are Ok with windows.

                    As Himanshu said, it may be somthing wrong with ubuntu 10.10.
                    I guess it is related to threads since the problem is gone while GDB using libthread_db to monitor/management the HelloCL.

                     

                      • HelloCL get segmentation fault on CPU
                        pulec
                        > As Himanshu said, it may be somthing wrong with ubuntu 10.10.
                        I am not sure of that - I think that Ubuntu 10.10 is fine, at least for me (although I am using 64 bit flavour). There may be someone that has problems but I wouldn't blame Ubuntu 10.10 - take that definitely some tens of percent of Linux users here are using 10.10 so it is natural, that someone has problems but I don't think it is common.
                        The reason why is supported 10.04 and not 10.10 is in my opinion that 10.04 is LTS (with long support). Not because of problems of 10.10. But I can be wrong.
                        > I guess it is related to threads since the problem is gone while GDB using libthread_db to monitor/management the HelloCL.
                        It may be true, actually I don't know how gdb manages threads. BTW, are you using SDK downloaded from AMD web or those deb packages by nou? In the latter case I would suggest to compile/link the examples by yourself.
                          • HelloCL get segmentation fault on CPU
                            ansoncat

                            Hi,

                            I'm using  SDK from AMD web.

                            I plan to try it on ubuntu 10.10 64 bit later.

                              • HelloCL get segmentation fault on CPU
                                pulec
                                I may have found solution of you problem:
                                I guess you have nvidia drivers, don't you. And the problem might be, that the driver contains incompatible libOpenCL (don't ask why incompatible - maybe because it is 1.0 and ati stream has 1.1?) Try to force to use ATI Stream's libOpenCL. (If you haven't already done so. Otherwise is this post irrelevant.)

                                I tried to simulate (perhaps your) situation:
                                martin@minerva:/usr/src/ati-stream-sdk-v2.3-lnx64/samples/opencl/bin/x86_64$ LD_LIBRARY_PATH=/usr/lib64/nvidia-current/:/usr/src/ati-stream-sdk-v2.3-lnx64/lib/x86_64 ./HelloCL
                                ./HelloCL: /usr/lib/nvidia-current/libOpenCL.so: no version information available (required by ./HelloCL)
                                HelloCL!
                                Getting Platform Information
                                Creating a context AMD platform
                                Getting device info
                                Loading and compiling CL source
                                Segmentation fault

                                On the other hand, running with gdb and those environment variables succeded (output is a bit verbose so I won't paste it), similarly to what you wrote.

                                this alseo succeeded:
                                martin@minerva:/usr/src/ati-stream-sdk-v2.3-lnx64/samples/opencl/bin/x86_64$ LD_LIBRARY_PATH=/usr/src/ati-stream-sdk-v2.3-lnx64/lib/x86_64 ./HelloCL
                                HelloCL!
                                Getting Platform Information
                                Creating a context AMD platform
                                Getting device info
                                Loading and compiling CL source
                                Running CL program
                                Done
                                Passed!

                                EDIT: If you think it might help don't forget to re-link the examples against ATI libs