You can follow the official document to install and enable your GPU in MicroK8s.
MicroK8s - Add-on: gpu | MicroK8s