cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

hsi544
Journeyman III

ATI Stream SDK OpenCL on CPU with Nvidia on GPU ?

Segmentation fault or CL_DEVICE_NOT_FOUND

Hi,

I'm trying to use ATI stream SDK on Intel CPU within a machine having an Nvidia Geforce 480 GPU.

I've checked the icd configuration it seems to be ok.

When running the samples and using the libOpenCL.so from ATI on the Nvidia GPU everything works fine. However, when trying to use the CPU as a device I've got either a Segmentation Fault or a CL_DEVICE_NOT_FOUND.

With some printfs, I concluded that the runtime is using the wrong platform for the CPU, i.e It's trying to use NVidia platform with a CPU device.

Did anyone success in running OpenCL on CPU with such a configuration

My configuration

---------------------------------------

Software

------------------------------------

ATI Stream SDK 2.2 x86_64

Nvidia devdriver linux_64_260.24.

ubuntu 10.04 x86_64

--------------------------------------------------

Hardware

--------------------------------------------------

Intel Intel(R) Core(TM) i7 CPU       X 980  @ 3.33GHz

Nvidia GeForce 480

 

Many thanks

 

Tarik

 

0 Likes
8 Replies
nou
Exemplar

you must use second AMD platform. what is output of CLInfo from AMD SDK?

0 Likes
hsi544
Journeyman III

here is the output of AMD SDK CLInfo

 

Number of platforms:                 2
  Platform Profile:                 FULL_PROFILE
  Platform Version:                 OpenCL 1.0 CUDA 3.2.1
  Platform Name:                     NVIDIA CUDA
  Platform Vendor:                 NVIDIA Corporation
  Platform Extensions:             cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll
  Platform Profile:                 FULL_PROFILE
  Platform Version:                 OpenCL 1.1 ATI-Stream-v2.2 (302)
  Platform Name:                     ATI Stream
  Platform Vendor:                 Advanced Micro Devices, Inc.
  Platform Extensions:             cl_khr_icd cl_amd_event_callback


  Platform Name:                     NVIDIA CUDA
Number of devices:                 2
  Device Type:                     CL_DEVICE_TYPE_GPU
  Device ID:                     4318
  Max compute units:                 15
  Max work items dimensions:             3
    Max work items[0]:                 1024
    Max work items[1]:                 1024
    Max work items[2]:                 64
  Max work group size:                 1024
  Preferred vector width char:             1
  Preferred vector width short:             1
  Preferred vector width int:             1
  Preferred vector width long:             1
  Preferred vector width float:             1
  Preferred vector width double:         1
  Max clock frequency:                 1451Mhz
  Address bits:                     32
  Max memory allocation:             402440192
  Image support:                 Yes
  Max number of images read arguments:     128
  Max number of images write arguments:     8
  Max image 2D width:             4096
  Max image 2D height:             32768
  Max image 3D width:             2048
  Max image 3D height:     2048
  Max image 3D depth:             2048
  Max samplers within kernel:         16
  Max size of kernel argument:             4352
  Alignment (bits) of base address:         4096
  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:         Yes
  Cache type:                     Read/Write
  Cache line size:                 128
  Cache size:                     245760
  Global memory size:                 1609760768
  Constant buffer size:                 65536
  Max number of constant args:             9
  Local memory type:                 Scratchpad
  Local memory size:                 49152
  Profiling timer resolution:             1000
  Device endianess:                 Little
  Available:                     Yes
  Compiler available:                 Yes
  Execution capabilities:                 
    Execute OpenCL kernels:             Yes
    Execute native function:             No
  Queue properties:                 
    Out-of-Order:                 Yes
    Profiling :                     Yes
  Platform ID:                     0x1c33770
  Name:                         GeForce GTX 480
  Vendor:                     NVIDIA Corporation
  Driver version:                 260.24
  Profile:                     FULL_PROFILE
  Version:                     OpenCL 1.0 CUDA
  Extensions:                     cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll  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_fp64
  Device Type:                     CL_DEVICE_TYPE_GPU
  Device ID:                     4318
  Max compute units:                 15
  Max work items dimensions:             3
    Max work items[0]:                 1024
    Max work items[1]:                 1024
    Max work items[2]:                 64
  Max work group size:                 1024
  Preferred vector width char:             1
  Preferred vector width short:             1
  Preferred vector width int:             1
  Preferred vector width long:             1
  Preferred vector width float:             1
  Preferred vector width double:         1
  Max clock frequency:                 1451Mhz
  Address bits:                     32
  Max memory allocation:             402571264
  Image support:                 Yes
  Max number of images read arguments:     128
  Max number of images write arguments:     8
  Max image 2D width:             4096
  Max image 2D height:             32768
  Max image 3D width:             2048
  Max image 3D height:     2048
  Max image 3D depth:             2048
  Max samplers within kernel:         16
  Max size of kernel argument:             4352
  Alignment (bits) of base address:         4096
  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:         Yes
  Cache type:                     Read/Write
  Cache line size:                 128
  Cache size:                     245760
  Global memory size:                 1610285056
  Constant buffer size:                 65536
  Max number of constant args:             9
  Local memory type:                 Scratchpad
  Local memory size:                 49152
  Profiling timer resolution:             1000
  Device endianess:                 Little
  Available:                     Yes
  Compiler available:                 Yes
  Execution capabilities:                 
    Execute OpenCL kernels:             Yes
    Execute native function:             No
  Queue properties:                 
    Out-of-Order:                 Yes
    Profiling :                     Yes
  Platform ID:                     0x1c33770
  Name:                         GeForce GTX 480
  Vendor:                     NVIDIA Corporation
  Driver version:                 260.24
  Profile:                     FULL_PROFILE
  Version:                     OpenCL 1.0 CUDA
  Extensions:                     cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll  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_fp64


Error : atomics mismatch!
Error : Bytes mismatch!
Error : glSharing mismatch!
Error : images mismatch!
Error : printf mismatch!
Error : deviceAttributeQuery mismatch!
Failed!
  Platform Name:                     ATI Stream
Number of devices:                 1
  Device Type:                     CL_DEVICE_TYPE_CPU
  Device ID:                     4098
  Max compute units:                 12
  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
  Max clock frequency:                 1600Mhz
  Address bits:                     64
  Max memory allocation:             1073741824
  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:                 0
  Cache size:                     0
  Global memory size:                 3221225472
  Constant buffer size:                 65536
  Max number of constant args:             8
  Local memory type:                 Global
  Local memory size:                 32768
  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:                     0x7f72d006db20
  Name:                         Intel(R) Core(TM) i7 CPU       X 980  @ 3.33GHz
  Vendor:                     GenuineIntel
  Driver version:                 2.0
  Profile:                     FULL_PROFILE
  Version:                     OpenCL 1.1 ATI-Stream-v2.2 (302)
  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_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_byte_addressable_store cl_khr_gl_sharing cl_ext_device_fission cl_amd_device_attribute_query cl_amd_printf


Error : atomics mismatch!
Error : Bytes mismatch!
Error : glSharing mismatch!
Error : images mismatch!
Error : printf mismatch!
Error : deviceAttributeQuery mismatch!
Failed!

 

Thanks

0 Likes

try create context from second platform.

0 Likes
hsi544
Journeyman III

Hi,

already done, not working.

I've got a strange behaviour. I tried to debug with gdb the seg fault and the program ran fine with the cpu, any explanation on this???

Cheers.

 

 

0 Likes

Originally posted by: hsi544 Hi,

 

already done, not working.

 

I've got a strange behaviour. I tried to debug with gdb the seg fault and the program ran fine with the cpu, any explanation on this???

 

Cheers.

 

 

It should work. I am able to run any sample on both Nvidia GPU or CPU after selecting appropriate platform.  Send us your code.

0 Likes

@hsi544: as you can see here:

http://forums.amd.com/devforum/messageview.cfm?catid=390&threadid=142326&enterthread=y

i have a very similar problem with a similar "rig" (nv gpu, amd cpu). also, you may see that nobody knows what may cause this strange behaviour (binary crashes, debug runs).



and since nobody can come with an explanation/solution, i will suggest the solution i use so far:



in your code search for nvidia platforms/devices. if not found print "nvidia hardware not found. use ms windows". i have an academic license for the windows os. i installed mingw and the amd sdk there. everything works fine for both nvidia gpu, amd cpu - although the cpu runs the kernel very slow. i suspect it has to do with no out-of-order-execution support (for opencl on my cpu - too early for tomasulo ??!!), no sse3 (my cpu doesn't support it) and immature cpu opencl implementation in general. but, alas, this is another story.



so, since the project i'm working on requires linux, currently we have nvidia as a requirement.

0 Likes

i installed nvidia driver version 260 and the problem disappeared for me. seems that after all it was an nvidia driver issue.

0 Likes

Hi,

 

Thanks for your help it also worked for me, I had the 260.24 driver and I replaced it by the 260.19.21, the everything worked fine.

 

Cheers

0 Likes