Adding MemTest86 to Grub if boot partition resides on NVME drive

I want to add MemTest86 to Ubuntu 20.04 grub menu. I followed Official MemTest86 guide, but they presume that the system EFI partition is on the SATA drive (/dev/sdX). I have NVME drive for the system partitions, so below entry does not work. If I choose 'MemTest86' entry in grub menu it can't find the place. How I should modify /etc/grub.d/40_custom?

df | grep efi
#/dev/nvme0n1p1                   98304     30865     67439  32% /boot/efi

sudo nano /etc/grub.d/40_custom
menuentry 'MemTest86' {
    insmod part_gpt
    insmod fat
    set root='nvme0n1,gpt1'
    chainloader ($root)/EFI/memtest86/BOOTX64.efi
}


I just recently did this myself. Type "c" at the grub menu to get a command line. Then "ls" to get a list of all drives. The drive/partitions are all (hd#,gpt#), regardless of what they are physically. So, what I did was list the root of each drive until I found efi. My (hd0) is Ubuntu HD. (hd1) is a 2TB HD for backups. (hd2) is my Windows nvme drive. I found efi with "ls (hd2,gpt1)/". I set root to that and it worked. I also put "insmod gzio" at the beginning, but that probably isn't necessary.