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.
Let's discuss the official one. Have anybody try it?
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!
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
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.