cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

directorezheviki
Journeyman III

AMD GCN Assembler

Hi all,

Recently AMD publish a post on GCN asm: http://gpuopen.com/amdgcn-assembly/

Looks like no more need for patching and hacking ELF to run assembly code.

Some of cool guys like realhet​, matszpk​, sunsetquest​ have created their own gcn assemblers

Let's discuss the official one. Have anybody try it?

0 Likes
7 Replies
meriken
Adept III

Oh wow, I was not aware of this new development at all. How exciting! Thanks for letting us know.

0 Likes
realhet
Miniboss

Hi,

I'd like to know, what are the software requirements to do this. Is there anything needed in addition to the Catalyst drivers on a client's machine? And if external clang is needed, can it be excluded by passing machine binary code to the drivers?

That kernel argument passing is really nice!

Personally I'd like to stick with my own assembler because it has a much better macro engine than the one in C and it somewhat hides the underlying hardware (GCN1..2 vs GCN3) so I don't have to ifdef different architectures. Also it has a register/variable allocator and array indexing, so it's easier and safer to work in that.

So this combined with the elegant and all-time compatible way of passing parameters to the kernel (presented in the blog post) would be a win for me, because it would be driver independent finally.

Anyways, it's really good to hear that you officially open up the driver for low level access!

0 Likes

Software you need is ROCm runtime (GitHub - RadeonOpenCompute/ROCm: ROCm - Radeon Open Compute Platform). AFAIK only Fiji is officially supported. External clang needed only if you want to compile sources on the host. Otherwise you can just precompile hsaco binaries, which is bassicaly an ELF, and the driver will eat it.

To use your own assembler you can generate final asm text with all macros expanded and feed it to clang. As an alternative you can modify your tools to produce hsaco directly. Here you can find some info ROCm-Docs/AMDGPU-ABI.md at master · RadeonOpenCompute/ROCm-Docs · GitHub. LLVM/clang sources could also help with that .

Yet another alternative is to submit patches to LLVM/clang that add features you are missing

0 Likes

PS. Some folks have successfully run asm examples on Kaveri. So it's possible to use non-Fiji hw also.

0 Likes

Thx for the lot of info!

0 Likes
dipak
Big Boss

Hi,

You've been added to the whitelist. I'm moving this thread to OpenCL forum.

Regards,

0 Likes
sunsetquest
Adept II

Nice!  😃 Thanks for sharing.

It is really great that AMD is posting an official assembler.

There is lots of good documentation with it also. 

I tried getting into it for a short bit last week but my limited Linux background got in the way.  I will try and give it another go soon.

0 Likes