Tested with: AMD Radeon PRO W7900 (Navi33 GPU / RDNA3 architecture). Other GPUs will probably work great with small tweaks, but I don't know what those tweaks might be. Please discover for yourself and report back!
Here's a very basic shell script that does all the things described below. Use it at your own risk. DO understand what it does. Otherwise, read the detailed instructions.
In fact, we really recommend reading the detailed instructions anyway. There's some good info in there.