1

FWIW, this is hypothetical, as in I don't actually have a particular GCN compute shader binary to run yet. I am working on something related to this, but I'm realizing that I have a lot ideas in my head that are hazy and uncertain, so I'm going back to basics and trying to fix any misconceptions I might have.

So assuming I did have such a binary that I wanted my GPU to run (let's say I want to do this in C#), what steps would I need to go through/are there particularly instructive/relevant examples out there in github?

Second question; let's say that I have a directX binary that I'm successfully running as a compute shader on my AMD GPU... is there some way I can get the GCN binary that the directX binary is being compiled into?

MNagy
  • 423
  • 7
  • 20
  • Here a presentation of someone doing it. good luck, i am glad to be able to feed my GCN isa directly on PS4 and Xbox One, this is no way viable on PC for a real application ^^ : https://onedrive.live.com/view.aspx?resid=EBE7DEDA70D06DA0!107&app=PowerPoint&authkey=!AD-O3oq3Ung7pzk – galop1n Jul 14 '16 at 00:11

1 Answers1

0

Five months late but maybe this might help. This project does what you want and is in C#: https://www.codeproject.com/Articles/872477/Assembler-for-AMD-s-GCN-GPU

What this project does is it takes an empty kernel and then swaps in the alternate binary bytes and then runs that instead. This project...

1) takes GCN assembly then converts it to a byte array (you don't need this part)

2) takes that byte array and then patches it in

3) runs the binary

You could probably modify the project since you don't need the GPU asm part.

For the second question about converting a DirectX binary for an AMD GPU into the original GCN source that should be possible. You would just need to figure out where the actual start of the GCN code is. I think there is a pattern you can look for like the project above uses. After you find the start you would need find a disassembler to convert it into viewable assembly ... or you can do it the painful way and use AMD GCN ISA manual to lookup the bit patterns. Hope this helps.

SunsetQuest
  • 8,041
  • 2
  • 47
  • 42