GPUVM Discrete GPU Code For AMDKFD, Radeon Compute Could Be Ready For Linux 4.17
Earlier this month AMD sent out a large dGPU patch-set for AMDKFD, short for the AMD Kernel Fusion Driver. AMD's Felix Kuehling confirmed that a prerequisite PCI-E atomics patch is currently queued up for landing into Linux 4.16, which is fine since this AMDKFD material is already too late for hitting the 4.16 tree.
Felix then sent out 25 patches adding GPUVM support for dGPUs with the AMDKFD driver. With this GPUVM support, some tests are now being able to run on what will be the mainline kernel code, "Most testing was done on Fiji with KFDTest (Yong started working on open-sourcing it). I was also able to run the OpenCL version of SHOC, though most sub-tests still fail. KFDTest can manage VRAM and system memory, submit shader dispatches, receive events. I haven't tested multi-GPU yet, but in theory that should also work, with system memory buffers shared between multiple GPUs."
Felix noted the last "big missing piece" is userptr memory support for user-allocated memory mapped for GPU access. He's planning on sending that out next and should allow for more real-world applications to run with this kernel driver code being upstreamed.
Long story short, it's looking like all the pieces are falling into place where with the Linux 4.17 kernel cycle in a few months, the ROCm/OpenCL user-space could finally be playing nicely on the mainline kernel! That is with the discrete GPUs where as up until recently they were more focused on getting all the APU bits upstreamed first. It's been a long time coming and I can't wait for this milestone so the open-source ROCm code can be more widely deployed and easier to use with no longer needing out-of-tree kernel modules. Upstream AMDKFD maintainer Oded Gabbay has also confirmed he's hoping to get all this code upstream for 4.17.