quadboon

Binary Kernels

Discussion created by quadboon on Aug 18, 2010
Latest reply on Aug 29, 2010 by timchist

Since SDK v2.2 there is support for binary ELF kernels. I read the Documentation Article on http://developer.amd.com/support/KnowledgeBase/Lists/KnowledgeBase/DispForm.aspx?ID=115 and it works fine.

There is an example Package http://developer.amd.com/Downloads/clbinary.zip containing clbinarygen.c. This example program shows how to compile binary Kernels in "offline" Mode and it works fine, too. The program however confuses me. Here is what it produces when i execute it:

$ ./clbinarygen
Reading in program from kernel.cl
Number of platforms found: 1
Found AMD platform
Number of devices found: 10
DEVICE[0]: CL_DEVICE_TYPE_CPU, Name=AMD Athlon(tm) 64 X2 Dual Core Processor 4200+
DEVICE[1]: CL_DEVICE_TYPE_GPU, Name=ATI RV770
DEVICE[2]: CL_DEVICE_TYPE_GPU, Name=ATI RV770
DEVICE[3]: CL_DEVICE_TYPE_GPU, Name=ATI RV770
DEVICE[4]: CL_DEVICE_TYPE_GPU, Name=ATI RV710
DEVICE[5]: CL_DEVICE_TYPE_GPU, Name=ATI RV730
DEVICE[6]: CL_DEVICE_TYPE_GPU, Name=Cypress
DEVICE[7]: CL_DEVICE_TYPE_GPU, Name=Juniper
DEVICE[8]: CL_DEVICE_TYPE_GPU, Name=Redwood
DEVICE[9]: CL_DEVICE_TYPE_GPU, Name=Cedar
Writing out binary kernel to kernel.bin.0
Writing out binary kernel to kernel.bin.1
Writing out binary kernel to kernel.bin.2
Writing out binary kernel to kernel.bin.3
Writing out binary kernel to kernel.bin.4
Writing out binary kernel to kernel.bin.5
Writing out binary kernel to kernel.bin.6
Writing out binary kernel to kernel.bin.7
Writing out binary kernel to kernel.bin.8
Writing out binary kernel to kernel.bin.9

You can see it produces 3 times code for ATI RV770. From what  i guess what happens here is that all the Devices that are physically present on my Computer go into the compilation process as well. In my Computer the first two devices are present. Thats not an problem for me, however there are still 2 binaries left for the RV770 and this is what confuses me. When i use readelf to get their Machinecode they differ:

$ readelf -aw kernel.bin.1 | grep Machine
  Machine:                           <unknown>: 0x3ee
$ readelf -aw kernel.bin.2 | grep Machine
  Machine:                           <unknown>: 0x3ed
$ readelf -aw kernel.bin.3 | grep Machine
  Machine:                           <unknown>: 0x3ee

My programs will distribute all these binary kernels. But what about the two diffrent RV770 kernels? Do i need some special handling on RV770?

 

 

Outcomes