What about performance in 3D games?

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
Alex_G
Level 4
Level 4
Posts: 125
Joined: Fri Mar 02, 2012 2:48 am

What about performance in 3D games?

Post by Alex_G »

Just have a special question, coz still cannot find the answer nowhere.

/ For now seems only the games that using D3D8 and OpenGL runs in Wine with almost full-speed (as they shows on Windows). /

So... why Wine need to use Direct3D > OpenGL calls translations? Is it from video-driver restrictions or other things? Are those conversions using CPU for processing? I'm Interesting of the scheme of all chains, for example, how the application interacts with Wine comparing to native system :)

Generally, what may affect on performance? Is it because of some D3D functions cannot find OpenGL analogs and then emulates them with software?
Can I find somewhere a popular explanation of how it works? Any links.

Want understand where the bottlenecks are )

(Btw. Does anyone heard about Longene kernel?)
User avatar
dimesio
Moderator
Moderator
Posts: 13367
Joined: Tue Mar 25, 2008 10:30 pm

Re: What about performance in 3D games?

Post by dimesio »

Alex_G wrote: Generally, what may affect on performance? Is it because of some D3D functions cannot find OpenGL analogs and then emulates them with software?
Can I find somewhere a popular explanation of how it works? Any links.

Want understand where the bottlenecks are )
http://wiki.winehq.org/Performance
Frédéric Delanoy

What about performance in 3D games?

Post by Frédéric Delanoy »

On Sun, Mar 4, 2012 at 09:42, Alex_G <[email protected]> wrote:
Just have a special question, coz still cannot find the answer nowhere.

/ For now seems only the games that using D3D8 and OpenGL runs in Wine with almost full-speed (as they shows on Windows). /

So... why Wine need to use Direct3D > OpenGL calls translations? Is it from video-driver restrictions or other things? Are those conversions using CPU for processing? I'm Interesting of the scheme of all chains, for example, how the application interacts with Wine comparing to native system :)
Linux video drivers aren't likely to support Direct3D...
Alex_G
Level 4
Level 4
Posts: 125
Joined: Fri Mar 02, 2012 2:48 am

Re: What about performance in 3D games?

Post by Alex_G »

Thanks! ) But I've read this article before and wasn't satisfied with the answers.

As I can guess, wineserver handles the system calls going from application and after some processing sends them into the kernel? So, at first, wineserver never could have the priority level and all the privileges as kernel have. Is it right?

Don't laugh pls, just wanna talk of it =)
Just interesting to imagine... and realize in simple words ))

----------------------
Frédéric Delanoy, I'm talking of proprietary drivers, was there Direct3D support excluded?
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: What about performance in 3D games?

Post by vitamin »

Alex_G wrote:So... why Wine need to use Direct3D > OpenGL calls translations?
Because Direct3D is MS proprietary API and not available on any other O/S. It requires special low-level interaction with video drivers, that's why native d3d*.dll won't work on Wine.

To answer your other questions: Forget about "emulation" word. Wine _implements_ win32 API on top of "Linux" API (not really correct, it's POSIX, OpenGL, etc. API but enough to give an idea). For D3D Wine obviously uses OpenGL, since that's the only 3D acceleration method available on all OSes.

Wineserver is a part of Wine that keeps shared information between processes (ex: handles) and does some other system interactions that regular process can't do directly (opening files, sockets, etc). Something that Windows' kernel would do.
Alex_G wrote:As I can guess, wineserver handles the system calls going from application and after some processing sends them into the kernel?
Not correct. Many places in Wine call libraries that in turn end up calling kernel. Not every system call goes through wineserver.
Alex_G
Level 4
Level 4
Posts: 125
Joined: Fri Mar 02, 2012 2:48 am

Post by Alex_G »

Vitamin, thank you for explanation! =)
...that's why native d3d*.dll won't work on Wine.
Is that means d3d8.dll.so, d3d9.dll.so (rewritten) libs in best way could have direct access to hardware, but some part of code is absent, therefore it cannot be provided yet? :)
Alex_G
Level 4
Level 4
Posts: 125
Joined: Fri Mar 02, 2012 2:48 am

Post by Alex_G »

Donno if smb interesting yet, but I did some CPU usage comparative tests within WinXP and Ubuntu 11.10, KDE Plasma (dual boot in my PC).

Can't still realize why the "top" console command shows me a bit different numbers of CPU utiliz. by applicaton than the System Monitor emb with KDE. (like 90-98% in "top" and 60-70 in SysMon).

Here I ran three games: "Nexuiz" (Win & Lin vers), "Life For Speed S2", and "Far Cry" in both systems with the same graphics configs, windowed 800x600.

Noticed, that for "Nexuiz" (Linux ver.) and for "LFS" CPU Total Load is more than in Windows, as if in numbers:

NEXUIZ,
Windows ver. for WinXP, and Linux ver. for Ubuntu (same respawn point at 2d map):
|| Win: 44-62% || Lin: 60-84% ||

LIFE FOR SPEED S2,
(avail. only Win. vers.)
|| Win: 26-30% || Lin: 50-55% ||

and the last

FAR CRY,
(avail. only Win. vers.)
|| Win: 50-52% || Lin: 51-55% ||


"Far Cry" as seems shows same results when windowed (800x600) as with FPS as with CPU load. When I run it fullscreen 1280*1024 (even in apart X-session), FPS indicators differs from 15 to 25 frames less than in Windows, in some scenes it less by double, but still playable (at 20-30 fps) well but it's just pretty old game =).

Machine spec.: AMD 64X2 4400+, 2 Gb RAM, NVidia GTS 8600 256 Mb.

So, any ideas why in Linux these games demand more CPU resources? (Even if we take Nexuiz for Linux, see the results)
Alex_G
Level 4
Level 4
Posts: 125
Joined: Fri Mar 02, 2012 2:48 am

Post by Alex_G »

Else
Does anyone use "nice" command when running apps in Wine?

"nice" or "renice" requires "root" rights, is it tells that we cannot use it within usual command line to start the app?

Anyway, noticed no difference when renice'ing app from 0 to -20, beside of ALSA crash ))
Alex_G
Level 4
Level 4
Posts: 125
Joined: Fri Mar 02, 2012 2:48 am

Post by Alex_G »

PS: I meant no difference with performance (or even may lowers it).
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

Alex_G wrote:So, any ideas why in Linux these games demand more CPU resources?
First Wine have extra layers that Windows doesn't. Second D3D on Wine will never be as fast as native implementation. Wine have to "convert" all calls to OpenGL. This of course adds some overhead. And don't forget that most games optimized for D3D and might result in slower path when emulated via OpenGL.

So, the higher CPU usage - is completely normal. And D3D performance will be at least %30 (best case) slower then native.
Alex_G
Level 4
Level 4
Posts: 125
Joined: Fri Mar 02, 2012 2:48 am

Post by Alex_G »

Thanks a lot! ;)

I've got the answer, finally: Wine uses CPU for calls redirection (translation). )

I feel it always goes "on the fly",.. or is there some kind of "buffering" present? =)
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

Alex_G wrote:I've got the answer, finally: Wine uses CPU for calls redirection (translation). )

I feel it always goes "on the fly",.. or is there some kind of "buffering" present? =)
You still not understanding what Wine is and how it works. Just take it for granted that it will be slower with D3D then Windows.

If you want to know how Wine does it look here: http://source.winehq.org/git/wine.git/
Alex_G
Level 4
Level 4
Posts: 125
Joined: Fri Mar 02, 2012 2:48 am

Post by Alex_G »

vitamin wrote: You still not understanding what Wine is and how it works.
Sure I'm not! :D
That's why I'm asking these funny questions.
All my talks about Wine is just foggy supposes and guesses. )

I wonder that Wine works at all. And works pretty good. This is amazing and unique technology.

Thank you for answering! )
Alex_G
Level 4
Level 4
Posts: 125
Joined: Fri Mar 02, 2012 2:48 am

Post by Alex_G »

vitamin wrote:
Alex_G wrote:I've got the answer, finally: Wine uses CPU for calls redirection (translation). )

I feel it always goes "on the fly",.. or is there some kind of "buffering" present? =)
You still not understanding what Wine is and how it works. Just take it for granted that it will be slower with D3D then Windows.

If you want to know how Wine does it look here: http://source.winehq.org/git/wine.git/
Here is the answer, actually:

Wine Developers Guide

Wine architecture
Alex_G
Level 4
Level 4
Posts: 125
Joined: Fri Mar 02, 2012 2:48 am

Post by Alex_G »

It's strange, but "Nexuiz" (windowed) under Wine runs at same performance/speed as "Nexuiz" for Linux, but CPU usage in Wine even little less compare to last one.

btw, "Nexuiz" not use wined3d at all and only pure opengl32 :)

Anyway it's funny why in Windows the game show less of CPU load and little more FPS (more stable and smooth).

So, maybe Linux Nvidia video driver can affect on it?
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

Alex_G wrote:btw, "Nexuiz" not use wined3d at all and only pure opengl32
Yes, for OpenGL programs/games it completely possible to be even faster then windows. This shows you how much overhead Windows can have over Linux + Wine.
Locked