Brandon Mayes
2009-Apr-26 02:16 UTC
[Wine] Squeezing every last drop of performance out of DirectX
Hi Folks, I have been using Wine for some time now to run Team Fortress 2 (and other HL2 based games) on my Ubuntu system. I was previously running Ubuntu 7.10 with an Athlon64 3800+, a 7600GT (256MB of RAM), and 2GB of DDR2 333MHz. Recently I upgraded to Ubuntu 8.10 (i386) with an AthlonX2 64 6000+, an 8800GT (1GB of RAM) and 4GB of DDR 800MHz. I was really hoping for a nice performance bump (especially when I installed Wine 1.1.20 today) but unfortunately I really don't notice it. Windows of course runs TF2 without issue (it's like glass) but it's still choppy on Linux. I'm using the latest proprietary nvidia drivers as well. I have found that passing the following options to TF2 definitely makes it run MUCH better (Steam-related options): -heapsize 1048576 -dxlevel 81 Actually, to be precise, I'm running in windowed mode at like 1100 something by 940 (I think)? My monitor support 1280x1024 but I'm basically running at the largest I can such that it stays within the desktop without being overlapped by the top or bottom menu bars in gnome. So the options are something like: -novid -windowed -w 1175 -h 940 -heapsize 1048576 -dxlevel 81 I am also using WINEDEBUG=-all when I launch Steam to suppress all debug messages. I'm trying to find ways to make this run even smoother in Linux. I know there are some changes I can make to the HKEY_CURRENT_USER\Software\Wine\Direct3D key. I tried setting UseGLSL=disabled but it screwed up some of the textures that made it slightly more difficult to play. I have also properly set my videoMemorySize to 1024. I think I have tried the offscreenRendering option as well (set to fbo or not) but it didn't seem to help. Overall the game runs fairly well. I get around 30 FPS for the most part in open areas (100+ FPS in small, confined areas), but every couple minutes it drops to less than 5 FPS (sometimes even 1 FPS). It will stay that way for about 4 or 5 seconds and then corrects itself. I thought that perhaps my CPU or was being pegged or the RAM was running out (doubtful with 4GB of RAM now) but that doesn't seem to be the case. I installed conky and I was monitoring my resources while running the game. The first CPU core was steady at 53% and the second core was steady at 12%. I was only using about 1.3 GB of RAM total (Steam and all other system resources). Using the UseGLSL=disabled option I didn't seem to notice this periodic drop to low FPS but like I said, some of the textures aren't quite acceptable for me. Is there anything else that I can do to get better performance out of this? I have installed DirectX 9.0c (Nov2008 release) and it works with TF2 but the performance just isn't there (around 10FPS steady). Using the dxlevel 81 option performance is pretty good, but would I benefit by setting some of the DLLs to native? Several of the DLLs are already set to native, some are set to builtin but I think they mostly relate to DirectX 9.0c. Here are the instructions I used to install DX 9.0c: http://howto.landure.fr/gnu-linux/install-directx-9-0c-on-linux-using-wine Are there any other suggestions on how to get this faster via wine? Some of the things I'm wondering: 1) Are there any further tweaks I can make to the Direct3D registry key? 2) Are there any DLLs I should be tweaking and setting to native, for example? I do have a Windows partition that I can copy DLLs from. 3) Is running HL2 in windowed mode going to make things worse? It doesn't seem like it but I wouldn't be opposed to running in full screen mode (1280x1024). I haven't noticed any significant difference yet between full screen and windowed. 4) Any other suggestions? If anyone knows any way to make this better please help. I have been a Linux user for years and the only reason I even keep a WinXP partition around is to run games. Otherwise I'm booting into one of my other partitions (Ubuntu, Fedora, or Slackware -- mostly Ubuntu). In case there is nothing else I can do to improve things oh well -- Wine is still amazing these days. I'm really impressed and happy with it. Thanks! -Brandon _________________________________________________________________ Rediscover Hotmail?: Get e-mail storage that grows with you. http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Storage2_042009 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.winehq.org/pipermail/wine-users/attachments/20090425/cb4144e1/attachment.htm>
Daemon
2009-Apr-26 04:13 UTC
[Wine] Re: Squeezing every last drop of performance out of DirectX
> > I have found that passing the following options to TF2 definitely makes it run MUCH better (Steam-related options): > > -heapsize 1048576 -dxlevel 81With 4 gigs ,actually 2 gigs since you're running a 32-bit program, you could safely leave datacachesize/heapsize values to default which is what 521000 or 256000.(?)> > Actually, to be precise, I'm running in windowed mode at like 1100 something by 940 (I think)?Make sure you have the WM set to Metacity(no effects) not Compiz. So basically it's fullscreen wthout going fullscreen? ??> > I have also properly set my videoMemorySize to 1024. I think I have tried the offscreenRendering option as well (set to fbo or not) but it didn't seem to help.ORM should be set to fbo to take advantage of the newest drivers(180.44+) drivers and your hardware. The RegistryWiki - http://wiki.winehq.org/UsefulRegistryKeys has all the fun Direct3D settings info.> > Overall the game runs fairly well. I get around 30 FPS for the most part in open areas (100+ FPS in small, confined areas), but every couple minutes it drops to less than 5 FPS (sometimes even 1 FPS).network congestion(?) or related to running with such a low heapsize probably.> > I have installed DirectX 9.0cI don't believe this is really necessary anymore. It seems to cause more problems than it's worth. In any case, you already have WineD3D(X) installed from a base wine install. At most you'd have to download(dll-files.com) the d3dx9_36.dll to d3dx9_40.dlls / Xaudio stuff to the windows/system32 directory depending on how much the app complains. Tweakguides http://www.tweakguides.com/HL2_5.html applies to most source engine games ---------------------------- i heart quoting
Cloudef
2009-Apr-26 17:19 UTC
[Wine] Re: Squeezing every last drop of performance out of DirectX
Im running TF2 with 100-200 fps on DX Level 81, Directx9+ games are still pretty choppy on wine and so TF2 plays much slower on dxlevel 95, I suggest enabling multi-threading in TF2, if you have dual-core or quad core
jorl17
2009-Apr-28 15:58 UTC
[Wine] Re: Squeezing every last drop of performance out of DirectX
Brandon Mayes wrote:> > > I think you really should get a clean wine 1.1.20 prefix and reinstall > > > TF there without installing DirectX > > > (or anything else). Then try playing the game without applying all your registry tweaks (with > > > -dxlevel 81). > > > Then try applying those tweaks and see if it helps. > > > > > > > Installing DirectX on Wine may create a little mess in your prefix, I'm afraid. > > > > > So if I were to do this -- what all is necessary? Can I just run these 2 commands (I'm running Ubuntu 8.10)? > > # sudo apt-get autoremove wine > # rm -rf ~/.wine > > I know there are going to be some menu entries left around in the gnome applications menu as well. I can remove those (usually just deleting stuff from ~/.local/share). > > I guess I just don't know what you mean by prefix (I'm assuming you mean ~/.wine), nor do I really know why installing DirectX 9.0c would muck things up...Do you really think that installing DX9 is going to actually make performance worse? > > FYI, for anyone following this I did copy over the d3d8.dll and d3d9.dll files from my Windows partition and set the libraries to native. First, the native d3d9.dll caused TF2 to crash as soon as I clicked to launch it (though Steam seemed to work fine), and while the native d3d8.dll file doesn't seem to cause any problems, it doesn't seem to perform any better than the builtin file. > > _________________________________________________________________ > Windows Live? SkyDrive?: Get 25 GB of free online storage. > http://windowslive.com/online/skydrive?ocid=TXT_TAGLM_WL_skydrive_042009 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: <http://www.winehq.org/pipermail/wine-users/attachments/20090427/fd482ac7/attachment.htm>Yes, that's all you need, to remove wine (if you want to install another version) and remove its folder, be sure to backup anything though. Also, remember that all your wine configuration will be lost. The prefix means exactly what you figured -- the user folder. You can have multiple prefixes in wine, by running wine with the WINEPREFIXCREATE env var (someone correct me if wrong, please), and then using that prefix with WINEPREFIX. Installing DX9 might get some DLLs which use unimplemented functions, or expect certain functions to behave in a way, while wine does not exhibit that behavior. It's always good to try and keep things to the wine implementation, which knows exactly what to expect from its code. Additionally, some Wine functions that the native DX use could possibly be implemented in a low-performance way, while Wine's implementation uses others -- just to throw in some random coins at the issue. I think you should never even do what you did with those DLLs, since it definetely will not work. I'm even surprised that you managed to run the game at all in dx8, I suppose that either wine used its builtin DLL or something very strange happened there.
Cloudef
2009-Apr-30 10:26 UTC
[Wine] Re: Squeezing every last drop of performance out of DirectX
Its windows nVidia driver, i have copied it just in case to system32 :) There was hack to make old HL1 engine games work faster by replacing the HL engine driver dll with this nv4_disp.dll or some ati Dll.