OpenCL / CUDA support in guests?

This is for discussing general topics about how to use VirtualBox.

OpenCL / CUDA support in guests?

Postby kebabbert » 27. Feb 2011, 21:49

How difficult would it be to add OpenCL / CUDA support in guests? And how can I request it?

I use Solaris 11 Express as host, and there are no OpenCL / CUDA available for S-11x. I would like to get that support in Window or Linux guests.
kebabbert
Volunteer
 
Posts: 310
Joined: 31. May 2008, 10:00
Primary OS: OpenSolaris 11
VBox Version: OSE other
Guest OSses: WinXP, RedHat, Ubuntu

Re: OpenCL / CUDA support in guests?

Postby squall leonhart » 28. Feb 2011, 14:41

gpu CL,.... next to impossible at this point.
CPU CL, should be fine.

CUDA, will never happen.
squall leonhart
 
Posts: 281
Joined: 21. Apr 2010, 10:39
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Windows XP

Re: OpenCL / CUDA support in guests?

Postby kebabbert » 5. Mar 2011, 16:17

CPU CL? What is that? Do you mean I can run OpenCL on the cpu? And when I have debugged my code in a guest, I startup a Linux or Windows machine and run OpenCL on the GPU?
kebabbert
Volunteer
 
Posts: 310
Joined: 31. May 2008, 10:00
Primary OS: OpenSolaris 11
VBox Version: OSE other
Guest OSses: WinXP, RedHat, Ubuntu

Re: OpenCL / CUDA support in guests?

Postby squall leonhart » 5. Mar 2011, 17:31

Yes, both intel and amd have OpenCL sdk's available for their CPU's.

http://developer.amd.com/gpu/AMDAPPSDK/ ... fault.aspx
http://software.intel.com/en-us/article ... pencl-sdk/

im not to sure on the whole using the cpu during the dev and debugging of a GPU CL program, but it shouldn't be impossible.
squall leonhart
 
Posts: 281
Joined: 21. Apr 2010, 10:39
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Windows XP

Re: OpenCL / CUDA support in guests?

Postby kebabbert » 6. Mar 2011, 00:21

Just to confirm: So, I could develop my source code in a Windows guest? The host is Solaris Express. Then, when everything is working, I could switch to a OpenCL GPU and run the code?
kebabbert
Volunteer
 
Posts: 310
Joined: 31. May 2008, 10:00
Primary OS: OpenSolaris 11
VBox Version: OSE other
Guest OSses: WinXP, RedHat, Ubuntu

Re: OpenCL / CUDA support in guests?

Postby rjzak » 22. Jul 2011, 00:15

kebabbert wrote:Just to confirm: So, I could develop my source code in a Windows guest? The host is Solaris Express. Then, when everything is working, I could switch to a OpenCL GPU and run the code?


Theoretically, yes, as long as the system you would be using has the libraries installed. This is because the basic idea of OpenCL is that it'll use whatever is available: CPU and/or GPU.

As for GPU/CUDA support, it should be possible for the VirtualBox developers to implement this. After all, Amazon's EC2 does virtualization with GPUs exposed: https://aws.amazon.com/ec2/#instance.
rjzak
 
Posts: 7
Joined: 16. Dec 2008, 16:24
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu, Windows, BSD

Re: OpenCL / CUDA support in guests?

Postby kebabbert » 22. Jul 2011, 09:29

"Theoretically, yes"

Ok, has anyone tested it? To develop and debug in a guest OS, and when the program is complete I will reboot into Windows and run the program on the GPU?
kebabbert
Volunteer
 
Posts: 310
Joined: 31. May 2008, 10:00
Primary OS: OpenSolaris 11
VBox Version: OSE other
Guest OSses: WinXP, RedHat, Ubuntu

Re: OpenCL / CUDA support in guests?

Postby kebabbert » 15. Aug 2011, 15:08

Ok, it seems that NVIDIA Cuda allows to use Emulation mode even if you have no NVIDIA graphics card. This means that the CUDA program you wrote, will only run on the CPU. This is used when debugging CUDA code. The old way to use Emulation was to specify the compile flag "-deviceemu", but has now changed so you add a library or something similar.

So, it should be possible to install Visual Studio and Nvidia CUDA SDK in Windows in VirtualBox and compile and run the source code on the CPU. And when the source code is debugged, you just stop using the Emulation mode (add another library and recompile) and then move the binary file to a Nvidia graphics card equipped computer. Myself, I will just reboot into Win7 and run the binary from there.
kebabbert
Volunteer
 
Posts: 310
Joined: 31. May 2008, 10:00
Primary OS: OpenSolaris 11
VBox Version: OSE other
Guest OSses: WinXP, RedHat, Ubuntu

Re: OpenCL / CUDA support in guests?

Postby denka » 30. Sep 2012, 00:39

Did anybody try this? I'm also interested in doing some OpenCL work in a VM (where all my homebrew development happens, for convenience of having the toolchain). I think this topic becomes too important to ignore, with mainstream CPUs integrating GPU functionality.
denka
 
Posts: 2
Joined: 3. Feb 2009, 09:00


Return to Using VirtualBox

Who is online

Users browsing this forum: No registered users and 16 guests