3D Acceleration Support

This is for discussing general topics about how to use VirtualBox.
Locked
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

3D Acceleration Support

Post by Technologov »

3D Acceleration Support and the technical problems

since there are many questions - so I would like to write : "What are the obstacles to achieving a 3D in a VM"

The problem:

To get a 3D support, you have to have a virtual 3D hardware and several drivers - 1 for OpenGL and 1 for Direct3D.

Possible ways to get there:

a. Emulate a real 3D card such as GeForce - it solves the drivers problem automatically (both for OpenGL and DirectX) - but this card is closed-source hardware, so we can't simply emulate it.

This is very difficult to do technically, so probably, it won't happen. + it will be damn slow.

b. Use virtualized hardware, such as Virtualbox 3D accelerator - and write 3D drivers for that one. Remember - both OpenGL and Direct3D drivers are needed for several guest OSes.

The OpenGL problem can be resolved easier - we need to run para-virtualized drivers on top of host's OpenGL and we are done.
This approach Sun took with VirtualBox 2.1. Sun used third-party "Chromium" OpenGL transport layer, which was redirected over para-virtual channels.

The DirectX problem is more difficult - we will have to translate DirectX instructions into OpenGL instructions, like Wine does - but the problem with Wine is that it's too buggy and many games won't run. So it must be debugged along the way.
Experimental support for hardware-accelerated DirectX inside VirtualBox also exists. It is called WineD3D and supports only DirectX-8 (not 7 and not 9 !). 3D Mark 2001 is known to work.

This will allow to reach 90% of native speed, so this is very fast solution.

solution b is Very Difficult task as well, but more realistic than a.

VMware were working on it since about 2005, and and first product to support 3D is called VMware Fusion. VM WS 6.0 and 6.5 support it too. (experimentally)

Sun has started much later, in 2007, and by late 2008 had experimental OpenGL support. (VirtualBox 2.1)

Not all games work however; Perhaps a community has to step-in and help debug all those games.

=======================================================================

Update: The community pointed me to some interesting ongoing projects.

OK, so let's sum up all the known projects:
1. VMGL
http://www.cs.toronto.edu/~andreslc/xen-gl/

2. Qemu-patch
http://qemu-forum.ipi.fi/viewtopic.php?t=2984

3. Wine
http://www.winehq.com

3.a. WineD3D links: (Direct3D-on-OpenGL wrapper)
http://www.virtualbox.org/ticket/3639
http://www.nongnu.org/wined3d/

4. DirectX OpenGL Wrapper
http://sourceforge.net/projects/dxglwrap

5. Transgaming SwiftShader
This technology allows software rendering of many DirectX effects.

6. Interesting Paper explaining why VMware chose Gallium3D: (12.12.2009)
http://vmware-svga.svn.sourceforge.net/ ... revision=1

and lets sum the question:
Are those totally separate projects, or they have any relationships ?

--
-"Technologov"
Last edited by Technologov on 23. Sep 2008, 14:10, edited 3 times in total.
AVonGauss
Posts: 19
Joined: 11. May 2007, 00:36
Location: Boynton Beach, FL
Contact:

Re: 3D Acceleration Support and why it wont happen anytime s

Post by AVonGauss »

I don't believe VMware Fusion has any additional 3D support beyond that of the normal VMware Workstation product, which if I remember correctly is limited to DirectX 8.
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Post by Technologov »

Yes, I have heard too that VMware's Workstation may also support 3D. Don't know which version.

Also DirectX 8 supported by VMware is a _lot_ better than DirectX 0 by VirtualBox !
AVonGauss
Posts: 19
Joined: 11. May 2007, 00:36
Location: Boynton Beach, FL
Contact:

Post by AVonGauss »

The VMware Workstation 5.x series and above I believe supports it, although I believe you have to manually modify the configuration file to enable the support. Normally I would agree with you that any support is better than none, but unless you are using an older application (game), then the practical value is not as high as you would think - in my experience.
AHux
Posts: 1
Joined: 27. May 2007, 03:54
Location: Adelaide Australia

Post by AHux »

Anyone try VMGL?
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Post by Technologov »

>Anyone try VMGL?

No, because it doesn't supports Windows guests. I need 3D acceleration for Windows games.
raxyx
Posts: 3
Joined: 21. May 2007, 18:17
Primary OS: Debian Lenny
VBox Version: PUEL
Guest OSses: WinXP, Debian various versions (Lenny, Squeeze, Sid, Ubuntu, etc)

Re: 3D Acceleration Support and why it wont happen anytime s

Post by raxyx »

Technologov wrote:Possible ways to get there:

a. Emulate a real 3D card such as GeForce - it solves the drivers problem automatically - but this card is closed-source hardware, so we can't simply emulate it, + it will be damn slow.

This is very very difficult to do technically, so probably, it won't happen.
I suppose we have all heard the rumors that ATI might opensource their graphics drivers, would that make point a more likely? It would still be slow, but the information about the hardware would be avalaible.
stmok
Posts: 4
Joined: 1. Jun 2007, 17:21
Primary OS: Ubuntu 8.04
VBox Version: PUEL
Guest OSses: XP Pro SP3, Debian, Fedora, and CentOS

Post by stmok »

Well, the upcoming version of Parallels Desktop of Macs will have 3D acceleration (OpenGL AND DirectX) for guest OSs...So you might as well add them to the list with VMware Fusion.

One of their guys blogged about it with a Quake 4 screenshot.
http://parallelsvirtualization.blogspot ... op-30.html

New features...
http://www.novadevelopment.com/parallel ... fault.aspx
# OpenGL 1.5 / DirectX Support - Run games and 3D applications at native speed in Windows.
# Coherence 2.0 - Run Windows and Mac OS applications in a single integrated environment.
# Documents Integration - Open documents in Mac OS or Windows using any available Mac OS or Windows application.
# Snapshots - Save the running virtual machine state and revert back to it at any time.
# Improved Windows Support - for XP and Vista
# Printers - Support for shared printers.
# Wider USB 2.0 and CD & DVD support
# Windows Start Menu Integration - Click the Parallels icon in the Dock to show the Windows Start Menu.
# Mount Your Windows File System - and access its files and folders directly from Mac OS.
# Parallels Explorer - Search for Windows files without having to start Windows.
# BootCamp Support - Use your BootCamp Partition inside Parallels. Now even works with Windows Vista!
# Integrated Virus Check - Free six month subscription allows you to work safely without fear of viruses.
# Improved Graphics User Interface - Now even easier to use and understand
# Support for OS X Leopard - Full support for Apple's next generation operating system when it ships.
# New Tools for Linux Users - Improved mouse and screen handling features
# Fast and Easy Installation - Installs in just 3 clicks.
Games that is known to work...
Run games and 3D applications at native speed in Windows, including:

* AeroFly Pro Deluxe
* Alien Arena 2007
* Call of Duty
* Counter Strike 1.6
* Descent 3
* Duke Nukem Manhattan Project
* Half Life
* Hitman
* Homeworld 2
* Quake 1 GL
* Quake 2
* Quake 3 Arena
* Quake 4
* Return to Castle Wolfenstein
* Serious Sam
* Serious Sam - the Second Encounter
* SiN
* Unreal Tournament 2003
* Worms 3D
I think Innotek should at least consider funding a side project to explore various ways to implemented 3D acceleration before blindly rejecting the notion with excuses.

So we now have another company (aside from VMware), offering this capability. There's a potential for Innotek to possibly grab some marketshare in the virtualization space. Its up to them to get it.

Might I quote words of inspiration?
“Those who say it can't be done are usually interrupted by others doing it.”
-James Arthur Baldwin
sandervl
Volunteer
Posts: 1064
Joined: 10. May 2007, 10:27
Primary OS: MS Windows Vista
VBox Version: PUEL
Guest OSses: Windows, Linux, Solaris

Post by sandervl »

Nobody from innotek blindly rejects this idea. The people posting here don't work for us. I thought that was quite obvious.

3D acceleration support will come when we think the time is right.
sandervl
Volunteer
Posts: 1064
Joined: 10. May 2007, 10:27
Primary OS: MS Windows Vista
VBox Version: PUEL
Guest OSses: Windows, Linux, Solaris

Post by sandervl »

For those that are interested in 3d acceleration. I've just opened up our OpenGL sources in SVN. Note that it's not complete; not even close.
But test rendering of simple OpenGL samples to an external window on the host works.

Perhaps some of you might want to reach out and help out to complete the work.

Development is monitored here: http://www.virtualbox.org/ticket/475
Even Rouault
Posts: 2
Joined: 2. Jul 2007, 20:50

Post by Even Rouault »

sandervl wrote:For those that are interested in 3d acceleration. I've just opened up our OpenGL sources in SVN. Note that it's not complete; not even close.
But test rendering of simple OpenGL samples to an external window on the host works.

Perhaps some of you might want to reach out and help out to complete the work.

Development is monitored here: http://www.virtualbox.org/ticket/475
Looks like we're working on complementary things...
I've updated tonight my QEMU (Linux) OpenGL patch : http://qemu-forum.ipi.fi/viewtopic.php?t=2984

I guess it could be possible to reuse my client and server stubs even if you use a different guest/host data transmission protocol.
I think I'm done with most of the core OpenGL API and the vendor extensions.
sandervl
Volunteer
Posts: 1064
Joined: 10. May 2007, 10:27
Primary OS: MS Windows Vista
VBox Version: PUEL
Guest OSses: Windows, Linux, Solaris

Post by sandervl »

I will take a look at your code later today. We're certainly interested in your work there. You're right that there's no point in duplicating everything.

Let's move the discussion to the ticket I mentioned, ok?

Thanks.
fd9_
Posts: 3
Joined: 6. Jul 2007, 09:00

Post by fd9_ »

Wait a minute. If this VMGL 3D acceleration works with Linux guests, how hard can it be to make it work with Windows guests? Why is this so difficult?
madman92
Posts: 3
Joined: 11. Jul 2007, 22:18

cedega

Post by madman92 »

USE CEDEGA, IT RUNS GAMES IN LINUX PERFECTLY FINE
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Post by Technologov »

I have tried Cedega. It is buggy, just like Wine.

Most games crash with Cedega.
Last edited by Technologov on 15. Sep 2008, 22:12, edited 1 time in total.
Locked