Can GFortran offload OpenACC to AMD GPUs?
Yes, indeed it can, if it was configured according to this link on the GCC wiki.
Fortunately on Ubuntu 20.04 (focal) and Debian 11 (bullseye) you don’t have to compile GCC from sources, and you can simply do
$ sudo apt install gcc-10-offload-amdgcn
Now, the tricky part is figuring out the GPU target codename. For instance, with my (former) AMD Radeon RX Vega 64, the target codename is gfx900, so the relevant additional compile flags are:
-fopenacc -foffload=amdgcn-amdhsa="-march=gfx900"
Also, from attending a recent AMD webinar, if you happen to have access to MI100, the target codename is gfx908. For all other AMD GPUs, this page on the LLVM docs might help.