Keep in mind it won't work on Apple Silicon Macs though, and I think Intel Macs have limited support for nvidia cards in macOS
Regarding VMs, and this is hardware dependent due to IOMMU groups (and is based on a Linux host), but I also recall cases where this is possible on reddit.com/r/VFIO