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.
OpenCL / CUDA support in guests?
-
- Posts: 312
- Joined: 21. Apr 2010, 10:39
- Primary OS: MS Windows 7
- VBox Version: PUEL
- Guest OSses: Windows XP, 8, 10, Android x86
Re: OpenCL / CUDA support in guests?
gpu CL,.... next to impossible at this point.
CPU CL, should be fine.
CUDA, will never happen.
CPU CL, should be fine.
CUDA, will never happen.
-
- Volunteer
- Posts: 321
- 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?
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?
-
- Posts: 312
- Joined: 21. Apr 2010, 10:39
- Primary OS: MS Windows 7
- VBox Version: PUEL
- Guest OSses: Windows XP, 8, 10, Android x86
Re: OpenCL / CUDA support in guests?
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.
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.
-
- Volunteer
- Posts: 321
- 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?
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?
-
- 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?
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.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?
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.
-
- Volunteer
- Posts: 321
- 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?
"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?
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?
-
- Volunteer
- Posts: 321
- 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?
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.
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.
Re: OpenCL / CUDA support in guests?
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.
-
- Posts: 1
- Joined: 2. Jan 2017, 14:40
Re: OpenCL / CUDA support in guests?
Yes. I used to develop within my debian vbox guest on a Windows host (Intel CPU). I did not manage to get OpenCL working in my debian guest with my NVIDIA GPU, but with the Intel OpenCL sdk (opencl_runtime_16.1.1_x64_ubuntu_6.4.0.25.tgz <- already outdated but works fine for me) on my CPU.denka wrote: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.
Alternative:
Right now I'm developing on Windows 10 (c++/OpenCL) and do additional compiling/testing using WSL. OpenCL on Intel CPU works fine on WSL, it's more convenient than switching between host/guest while developing and almost everything I need for developing works (for example valgrind doesn't work).
For GPU tests I'm using my Windows host or grab an Amazon EC2-G2 instance.