Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is it possible to develop a cuda program in a virtual machine that has a ubuntu installed

I saw a video where a guy compiled one of his cuda program in a virtual box. Can anyone tell me how to do that?

Please go to 01:09:00 in that video to see he compiled the program in virgualbox .

PS: I have a gtx 970 card and the other graphic card installed on my workstation, but I don't want to install a real Ubuntu on it, I just want to using a VM to test the cuda world.

like image 324
user5090433 Avatar asked Jul 25 '15 14:07

user5090433


People also ask

Does Ubuntu support CUDA?

OS Support Policy. CUDA support for Ubuntu 18.04. x, Ubuntu 20.04. x, Ubuntu 22.04.

What is CUDA in Ubuntu?

CUDA (Compute Unified Device Architecture) is a parallel computing architecture developed by Nvidia for graphics processing. This document provides instructions to install/remove Cuda 4.2 on Ubuntu 12.04.

Can I install CUDA on VMware?

Answer to my own question: GPU virtualization is supported by VMWare. Need to install hypervisor on host machine that has graphics card. vDGA is achieved by setting device passthrough on the graphics card and assigning the card to individual virtual machine. Then CUDA code can run on the virtual machine.


1 Answers

Yes, it's possible.

The presenter in the video is using an Amazon EC2 cloud GPU instance.

In general, many types of VM (virtual machine) offerings can host a linux OS, upon which the CUDA toolkit could be loaded and codes compiled that way.

There is a difference between compiling a code and running a CUDA code, however. Running a CUDA code usually requires a CUDA GPU be present/available. This can be done using some types of VMs/hypervisors, but not every VM hypervisor supports the ability to place a physical GPU device into a VM (which is required, currently, to be able to run a CUDA code in a VM).

In general, to provide a GPU within a VM suitable for CUDA usage (currently) it is necessary for the VM/hypervisor to support some sort of PCI Passthrough capability.

Providing a full step-by-step tutorial would depend on the choice of specific hypervisor and is beyond the scope of an answer I can provide here.

like image 187
Robert Crovella Avatar answered Sep 21 '22 20:09

Robert Crovella