Cuda in a vm

Can I take advantage of cuda if i install it into a vmware vm? or do i need to install the nvidia driver and cuda into the host (win10) os?

I seem to recall Wendell getting all excited about passthrough functionality enabled for nvidia cards on a specific motherboard. I remember something about nvidia restricting this to their pro (tesla) cards but recently Wendell had a whole segment about using consumer geforce cards (if you can call a 3090 a ‘consumer’ card) with regular geforce drivers.

I hope I am not hopelessly confusing apples and oranges here. Was he talking about something else entirely?

This thread

makes the distinction between vGPU and passthrough. What is the difference?

And threads talk about hyper-V but not vmware or virtual box. Isnt hyper-v just microsoft’s version of vmware/vitual box?

Please be kind, I am ignorant.

This thread says cuda CAN be installed to a vm

https://docs.vmware.com/en/VMware-vSphere-Bitfusion/3.0/Example-Guide/GUID-ABB4A0B1-F26E-422E-85C5-BA9F2454363A.html

but it says you need vSphere Bitfusion client. What?!

And there is no mention of IOMMU tweaking as in wendell’s guide.
Is all that trickery Wendell uses necessary for running a Windows vm on Linux only? Or is it also necessary for running a linux vm on windows.?

So what’s my use case? Well, I am learning ML and want to try the stupid little exercises in a linux vm so i can just copy-paste the code.

hardware
intel 10700k
32 g ram
nvidia 3090

Yes. I know I could dualboot and have a bespoke linux system with all the bells and whistles. But then I cant move that machine around. In a vm, I can have the vmware image in dropbox and run it from a lab pc, my home pc or whereever. This way I know I am running the same system. And as I install python packages, etc, my environment is the same.

Speaking of python, it seems I can install cuda in anaconda simply with
conda install -c anaconda cudatoolkit
The complete guide is here:
https://docs.anaconda.com/anaconda/user-guide/tasks/tensorflow/
Or am I confusing yet a different thing? And of course both numbapro and accelerate have been deprecated by anaconda.
https://docs.anaconda.com/numbapro/index.html

Hyper-V is a type-1 hypervisor, when you install the Hyper-V features in Windows and reboot you’re not running bare metal so to say, you are instead remoting into your VM (which has access to the management suite) from a local client.

Hyper-V has a lot of limitations that Workstation and Virtualbox don’t (actually not sure on Virtualbox, haven’t used it hardly ever) but offers other advantages such as the theoretical ability to support workloads that demand access to Nvidia’s Cuda drivers. I’m told however that trying to wrangle these drivers into a working state takes some faffing about.

Those limitations btw, they include the inability to pass through any USB device that is not a storage drive. Got yourself a nice audio interface and you want to pass it through to the VM? Hyper-V won’t allow it.