Multi2Sim / multi2sim

Multi2Sim source code
GNU General Public License v3.0
115 stars 66 forks source link

Can m2c --amd generate 32bits instructions only? #13

Open MedicineYeh opened 8 years ago

MedicineYeh commented 8 years ago

We finally integrated m2s into QEMU, however, many benchmarks can not be executed successfully. I got some 64 bits instructions in my kernel for unknown reasons. Ex: BUFFER_LOAD_FORMAT_D16_X, etc. Is there any way to force AMD's toolchain generate only 32 bits instructions? Or... can multi2sim support 64 bits instructions for southern-island functionally? The timing model could be a future work.

amirkavyan commented 8 years ago

Hi Medicine. Sorry for the late response.

Older AMD drivers usually generate the kernels with only the 32 bits instructions. So for our work we usually use those drivers. What m2c does is basically uses the native AMD driver to compile the code. What I can do for you is to get your kernel.c file and use the driver (we have a system that has the compatible driver but that driver is no longer available online, and we couldn't find the installer anywhere) to create the binary for you.

multi2sim cannot currently support the 64bit ISA instructions. It might take a while for us to add that support since we have a lot of works queued up and limited man power.

On Thu, May 19, 2016 at 2:27 AM, Medicine Yeh notifications@github.com wrote:

We finally integrated m2s into QEMU, however, many benchmarks can not be executed successfully. I got some 64 bits instructions in my kernel for unknown reasons. Ex: BUFFER_LOAD_FORMAT_D16_X, etc. Is there any way to force AMD's toolchain generate only 32 bits instructions? Or... can multi2sim support 64 bits instructions for southern-island functionally? The timing model could be a future work.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/Multi2Sim/multi2sim/issues/13

MedicineYeh commented 8 years ago

Thanks for you reply. I know that m2c only requires on shared libraries for compiling the kernel code, if I understand right. The file is libamdocl64.so. You can give me this file so I could try to have the same environment for m2c as well. Here are the kernel files of my benchmarks. I don't know how to send them to you so I just attach it to this thread. I used the free online space to upload the file. http://www114.zippyshare.com/v/8FmI8c9Q/file.html

amirkavyan commented 8 years ago

Older driver had both 32bit and 64bit libraries. But multi2sim is compliment with the 32bit version. So the file is libamdocl32.so. I will send you both (libamdocl32 and libamdocl64) Share a dropbox folder with me since these files are 21MB large each

I was successful in generating the kernels lk.cl and orentation.cl acc.cl and KeypointLocalization binaries.

The si disassembler successfully disassembeled lk.cl and orientation.cl kernels.

The KeypointLocalization has an unimplemented instruction: VOP3:9 // 000003F4: D0120000 00010108 The acc.cl has another unimplemented instruction: Unimplemented Instruction: MUBUF:8 // 00000180: E0201000 80030404

I am making issues to address these. I think I wouldn't get soon enough to implement them, but if you are in a rush you can give them a try and I can provide as much help as possible for you to implement them successfully in both disassembler and emulator.

The Kernels.cl file had an undefined local variable : FILTER_WIDTH

The RayTracing_Kernel.cl has a reference to a header that was not included : camera.h

MedicineYeh commented 8 years ago

I comment out #pragma OPENCL EXTENSION cl_khr_fp64: enable in the two files that have unimplemented instructions and put the missing header files. Sorry for the inconvenience. I was not on my computer when I package these files. http://www79.zippyshare.com/v/mpa6L5wI/file.html Here is the dropbox link for you to upload files: https://www.dropbox.com/l/RC1c1lef4fyV25ug1UG9Ro/invite

By the way, it sounds like you compile your m2c with -m32 or 32-bit compiler. Is that how you use libamdocl32? I compile m2c with 64-bit compiler so my AMD library is libamdocl64. How do you make your m2c dynamically link to libamdocl32?

sing0512 commented 7 years ago

Hi,

I am wondering what version of AMD driver and Linux distro we should use to make m2c work.

MedicineYeh commented 7 years ago

I think any Linux distro should work. The AMD Driver should be somewhere around 2.6. I can't remember the exact number.

amirkavyan commented 7 years ago

@MedicineYeh Hi Medicine. As you may recall, a while ago I have provided you with the libamdocl32/64 libraries of the driver that was used by the m2c to compile codes, executable on Multi2sim. I was wondering if you were ever successful in compiling your code with these libraries?

MedicineYeh commented 7 years ago

@amirkavyan The code can be compiled but it still contains 64-bit instructions as what this thread discussed. It seems to be a very important instruction that must use 64 bits version for efficiency.... I guess 32-bit GPU has adopted these 64-bit ld/st instructions for a long time.