3D Acceleration Support

This is for discussing general topics about how to use VirtualBox.
stefan.becker
Volunteer
Posts: 7639
Joined: 7. Jun 2007, 21:53

Post by stefan.becker »

Use Dual Boot for Games.

Anyway if 3D is supported, Performance will not be the same as with native access.
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Post by Technologov »

Actually, if 3D API virtualization done right, we can achieve about 90-95% of native performance, which is enough for games.
Vox
Posts: 6
Joined: 23. Jul 2007, 19:00
Contact:

Post by Vox »

While I'm sure it is not in the works, would it be more realistic for VirtualBox to utilise the host's graphics adapter (provided that the graphics adapter's drivers be installed on the guest system)?
Voice
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Post by Technologov »

Vox: this is not possible, because hardware is designed in a way to be utilized by a single OS.
Vox
Posts: 6
Joined: 23. Jul 2007, 19:00
Contact:

Post by Vox »

Technologov wrote:Vox: this is not possible, because hardware is designed in a way to be utilized by a single OS.
Ah, I see.
Voice
novy
Posts: 6
Joined: 30. Jul 2007, 21:31

Post by novy »

Hi Technologov
if that is the case then why can we use the host cdrom on the guest?
Novy

Vox: this is not possible, because hardware is designed in a way to be utilized by a single OS.
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Post by Technologov »

Hijacking ATAPI CD-ROM commands is 10,000 times easier than 3D accelerator commands.

In addition, ATAPI is one standard and one open specification, while each 3D accelerator is very different from others, and has closed specification. There is only one thing open about 3D accelerators - the API - DirectX and OpenGL commands that it can "accelerate".

So, the best way to make it, is to virtualize those 3D APIs - DirectX and OpenGL as both of them have open specifications.

Otherwise, even if you can hijack some internal GeForce 8800 commands, by using closed specifications, if the host computer contains a different video-accelerator, your Virtualizer won't work. This approach won't work. Internal commands of all video accelerators are different.

By virtualizing the APIs, we can achieve about 90% of full performance, + ability to work on different video accelerators + ability to easily add new (future) features, such as OpenGL 3.0 and DirectX 11, without reprogramming everything.

This approach has 1 disadvantage: driver need to be written for *every* guest OS out there, if we want that guest OS to support 3D acceleration. Read: Guest Additions for virtual 3D hardware.

The good news: if we only write Windows XP guest OS drivers we already have 80% of market.
Bad news: supporting 3D in rare/legacy OSes will not exist, until someone will write drivers for that guest OS. Examples: Solaris and Windows 98.
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Post by Technologov »

Aceler
Posts: 8
Joined: 16. Oct 2007, 21:14
Primary OS: Linux other
VBox Version: PUEL
Guest OSses: Mostly Ubuntu
Location: Nizhny Novgorod
Contact:

Post by Aceler »

A small suggestion about "a" plan:
There is an open source 3D cards - Intel GMA 900 & GMA950. The specs are here: http://www.intellinuxgraphics.org

So, you can make a virtual Intel card for guest OS and translate a low-level calls to a host OS OpenGL system.

And another idea (for linux hosts only). You know, that Xorg can utilize several virtual consoles - for example, tty7 and tty8. And X Server initialize video card for both instances. If VirtualBox will operate as an X Server, fullscreen on another virtual console, I guess it will be able to use hardware acceleration directly from guest OS. .
WorkingOnWise
Posts: 2
Joined: 17. Oct 2007, 20:07

A Compromise

Post by WorkingOnWise »

How about this for a "middle ground" solution. Keep in mind that I'm a geek, not a developer. VB emulates 1 cpu. Is there a reasonable way to tell the host to use core0 for cpu and system emulation, and use core1 for video calls only. It won't get true 3d, but it may get us rip-snortin fast 2d, which would help. There is only 1 app that makes me miss native windows, and thats Google SketchUp. I can use it in a windows vm, bit it does get bogged down as the model grows. While 3d is the only real solution, faster 2d performance will help some of us some of the time. Personally, I think there are better uses for a developers time that getting 3d to work in a vm. If performance matters that much, I run it native, or deal with it. Just my 2 cents.

So, is this reasonable, to prioritize the vm's tasks to a specific core? I realize this is useless on a single core machine, but like I said, this is a "middle ground", not a full solution.

Thanks
Keirh
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Post by Technologov »

2D performance of VirtualBox is EXCELLENT. Nearly as fast as native. No need to improve.
WorkingOnWise
Posts: 2
Joined: 17. Oct 2007, 20:07

Post by WorkingOnWise »

2d performance measured by 2d standards Is excellent. When measured by 3d standards, it's not so great. I understand that 2d and 3d graphics are fundamentally different, and to expect 2d to be 3d is just not possible, and foolish to think otherwise. Is what I mean to propose here is a way to push 2d performance past the "norm" for great. Think 2d Turbo. With the typical 3d model house, one floor, walls windows and roof, WinXP vm can draw about 1 frame per second. By 2d standards, considering all the surfaces and lines and textures to be drawn, thats Great! Could it be reasonably tripled by dedication one core of a dual core cpu to just vm video functions?

Thanks
Keith
Aceler
Posts: 8
Joined: 16. Oct 2007, 21:14
Primary OS: Linux other
VBox Version: PUEL
Guest OSses: Mostly Ubuntu
Location: Nizhny Novgorod
Contact:

Post by Aceler »

Technologov wrote:2D performance of VirtualBox is EXCELLENT. Nearly as fast as native. No need to improve.
However, DirectDraw tests fails under guest OS.
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Post by Technologov »

Aceler:
1. Please give me those tests (or drop a link)

2. I said about performance, not features :) - Yes, I know that VBox VGA features have some problems... but maybe they are fixed in 1.5.2.
Aceler
Posts: 8
Joined: 16. Oct 2007, 21:14
Primary OS: Linux other
VBox Version: PUEL
Guest OSses: Mostly Ubuntu
Location: Nizhny Novgorod
Contact:

Post by Aceler »

Technologov wrote:Aceler:
1. Please give me those tests (or drop a link)
Start button -> run -> dxdiag -> display -> Run DirectDraw Test :)

The white box is not moving.
2. I said about performance, not features :) - Yes, I know that VBox VGA features have some problems... but maybe they are fixed in 1.5.2.
The performance is good, yeah :)
Locked