For ryzen 7 with nvidia gpu you need to update the bios for wsl2

Finally deviceQuerry is working now, after updating my bios.
anything else is useless. Be sure to have the right bios if you have problems
with wsl2 and nvidia gpu.with AMD cpus
check with you lap vendor. in my case, it was an update from HP.
Good Luck folks