[REL] dedicated server for Windows with no GPU
-
Releasing 64-bit .dlls making F4 draw nothing in 3D mode, as well as not using the GPU functionality for drawing. That will work on headless Windows servers/virtual machines running the 64-bit binary as a dedicated server.
Due to the usage of LLVM in the .dll’s the performance is good enough for dedicated server. The old release had 2-5 FPS but this one has 40-60!
Download
Source code <https://github.com/sthalik/wine-hackage/tree/hacks-20151124>
Binary version for end-users <https://db.tt/sHz2m7r8>
Legacy binary version <https://db.tt/jPxrpMfL>You can mirror the source/binaries as much as you want.
Requirements
ability to run the 64-bit version
disabled triple buffering
no Windows version requirement other than XP 64-bit or above.
A sound card in the OS. Either a real one or software enabling a fake sound card as per VB-Cable. Merely deleting particlesys.ini won’t get rid of crashes in 4.33!Performance
Download this excellent mod resizing textures to the minimum amount: <https://www.benchmarksims.org/forum/showthread.php?14587-REL-servermod-more-speed-using-less-memory>. This will save great amounts of memory.
Disable shaders including HDR, also hires textures, reduced particle system, clouds. This gets from 20 to 60 fps on my workstation.
Set resolution to 1024x768 in BMS menu, for less image data to copy each frame.
Disable mipmapping and anisotropic filtering. the code takes steps to ignore them but it might not work in all cases.
Disable autogen for trees and bloom.For even more FPS, press the tilde key (aka “`”) to switch in satellite view once in 3D.
For great FPS gain, select the “high performance” power profile in Windows. That is, disable CPU frequency scaling and force the CPU to run at the maximum frequency. This may not work with Turbo enabled, where it’s the CPU and mainboard that control clocking.
Hide the Falcon BMS window (that one with blue background) by alt-tab then Windows key + M. Even on a local machine it consumes precious FPS. On RDP or VNC the effect is way more pronounced. Even for a regular workstation with a GPU, this gets from 60 to 70 fps.
Installation
copy the .dll’s to bin/x64 after fulfilling requirements.
invoke BMS through the “run-bms-server.bat” batch file.Notes
Stuff in the .bat file is there for a reason. Don’t remove it unless you know what it does. You might wish to modify or remove the GALLIUM_HUD option though.
Images
Issues
Report new issues in this thread.
-
Technical info
The .dlls implement d3d9 calls, that is, pretends to be a d3d9 implementation except no 3D stuff is drawn at all. Every time a triangle is to be drawn, nothing happens.
We still need to allocate the memory for textures BMS uses, otherwise it crashes immediately. Despite that, we try to minimize the amount of work done:
- Worst texture filtering quality is used across the board
- Mipmap, and anisotropic filtering usage is disabled
- Mipmaps are generated using worst/fastest filter available
- Vsync is disabled and an absurdly high refresh rate is reported
- The opengl32.dll file is large like hell but that’s because it has LLVM all linked statically in it. Stripping the DWARF debug info curiously removes symbols so it has to stay as-is.
The 20151125 distribution is based on Mesa from today for an OpenGL implementation on the CPU, and Wine of today for D3D9 -> OpenGL translation.
Failed ideas
Don’t generate mipmaps at all: crashes at initialization. Right now generating mipmaps, but not using them.
Use Wine multithreaded renderer: doubles menu performance but 20 FPS in 3D.
Use gallium-nine: there are no plans for nine to work on Windows.
-
brilliant. absolutely brilliant.
-
-
Stanislaw, is there a way of transferring some of the terrain texture/model LODs to the GPU for processing?
-
This sounds too good to be true. Thanks a lot for creating this, I hope you’ll get some proper feedback from the devs and that some measures can be implemented that make BMS and your DLL work together in the best way possible. BIG THUMBS UP from me too.
Uwe
-
Nice one sthalik. So what about using those in Wine?
-
I tried it on my kvm win7 installation (CentOS 6 64 bit host), but sadly BMS crashes when I click on setup in order to turn off the advanced graphics stuff.
The main screen looks all garbled as if there wasn’t enough colour depth.
It might have to do with the fact that I’m using rdp over x2go to connect to the win7 instance, so I’ll try again from home tonight.
I’m getting 30% cpu usage and around 15fps from what I can tell in the 2d screens, and from what I could tell the comms menu works fine, I was also able to start the TE builder.
Great work guys!
Uwe
-
I tried it on my kvm win7 installation (CentOS 6 64 bit host), but sadly BMS crashes when I click on setup in order to turn off the advanced graphics stuff.
The main screen looks all garbled as if there wasn’t enough colour depth.
It might have to do with the fact that I’m using rdp over x2go to connect to the win7 instance, so I’ll try again from home tonight.
I’m getting 30% cpu usage and around 15fps from what I can tell in the 2d screens, and from what I could tell the comms menu works fine, I was also able to start the TE builder.
Great work guys!
Uwe
Remove dx9display.dsp first. The .dll’s report all resolutions with a 300 Hz refresh rate unlike normally.
RDP should work. Just ensure you have a 24/32-bit color depth desktop. Garbled screen looks like 16-bit color.
If it crashes still, send me the .txt crash log AND the minidump.
In fact it works faster with native full color since there are no conversions going on for each pixel.
Nice one sthalik. So what about using those in Wine?
Use this branch https://github.com/sthalik/wine-hackage/tree/hacks-20151125
I recommend xf86-video-dummy, llvmpipe and x11vnc.
Stanislaw, is there a way of transferring some of the terrain texture/model LODs to the GPU for processing?
Not feasibly, no. We could make all textures black rectangles or something though. But why is this an issue for you? Worst-case you can replace all .dds with a single-pixel one.
But model LODs are loaded by the CPU before upload even normally.
-
Sadly after removing dx9display.dsp “setup” still crashes.
Any other ideas what could be causing this? I guess most of the options available using the “setup” menu would also be configurable in Falcon BMS.cfg, right?
Cheers, Uwe
EDIT: “Setup” now works after forcing rdp to connect using a 32bit desktop.I’ve assigned 2 VCPUs to the instance, would 4 help a lot with performance?
-
Yes, they help a lot. Compare LP_NUM_THREADS=1 to LP_NUM_THREADS=2 in the .bat file. Ideally you should have LP_NUM_THREADS set to the amount of cores assigned.
You may want to switch the ondemand cpufreq governor to performance. Even with 4 CPU cores Falcon uses about 200% CPU so it won’t affect the heat level.
-
Looks like it worked:
I’ve tried setting 4 cpus but I guess win7 professional doesn’t support more than 2 (which I already had configured in the kvm machine).
I’ve setup a very simple TE with a tanker and an escort, so would 16fps suffice for hosting?
How do I exit the 3d world? Hitting ESC doesn’t seem to work, sorry if this is a stupid question.
Thanks for your work Sthalik, this could really improve BMS hosting a lot!
Uwe
-
Hit escape then e.
15 is very barely enough. Give it margin.
In virt-manager you can set CPU topology to cores, not recognizing real cores as separate CPUs.
-
I’ll try your virt-manager suggestion tomorrow. FPS was a bit better using a “real” rdp connection from my win7 gaming box, averaging around 22 fps.
I tried a test flight with a single AI plane in lead using a 10,000 bw setting on the server, we were able to fly close formation during a CAP without any glitch of sorts. I’ll try a more complex TE next.
The BMS server crashed on the “leaving a/c” screen. (the good news is that ESC “e” worked as advertised this time ;))
all the best, Uwe
-
tested the server in windows 8.1. Tried a couple of flights and noticed some odd things (maybe i need to RTFM not sure…)
Firstly, after a ramp start the NWS would not activate (i had to abort mission and the NWS worked for the next mission so definitely a bug of some sort).
I was getting freezes on egress (the screen and sound would freeze for about 1 - 1.5 sec). Happened every couple of mins.
The autopilot stop working on egress, not faults nothing.
These are some strange issues and i’m not sure if it’s related to the server because i never had them before.
Server stats - around 27% CPU on a quad core i7, around 66+fps in 3d world.
-
What kind of flight / mission would you recommend for the server to “join”?
All the best, Uwe
-
I was getting freezes on egress (the screen and sound would freeze for about 1 - 1.5 sec). Happened every couple of mins.
Networking issues or otherwise server getting lagged. If you’re connecting remotely to the server screen, try having the BMS window minimized or otherwise not visible, or just disconnect the session for the flight’s duration.
The BMS server crashed on the “leaving a/c” screen. (the good news is that ESC “e” worked as advertised this time ;))
Then send me the .txt crashlog AND the minidump.
sh
-
I’ll try your virt-manager suggestion tomorrow. FPS was a bit better using a “real” rdp connection from my win7 gaming box, averaging around 22 fps.
Since you’re having that bad FPS you can compare the new build - https://www.dropbox.com/s/4ivyryqu1rl34pu/falcon-bms-windows-dedicated-server-20151125.7z and see if there’s any improvement.
Additionally the new build shows no performance decrease with anisotropic filtering and mipmapping in 3D at all, for me at least. You can compare the decrease, if any, in both the old and new build.
[…] I hope you’ll get some proper feedback from the devs and that some measures can be implemented that make BMS and your DLL work together in the best way possible.
They don’t have to do anything. F4 code is complex enough that an external solution is necessary in the first place. Otherwise it’d all work from 2D.
Firstly, after a ramp start the NWS would not activate (i had to abort mission and the NWS worked for the next mission so definitely a bug of some sort)
I don’t touch anything other than 3D stuff so this is more involved.
-
Shtalik, you’re the man. I changed the libvirt-config today and now I get around 40fps using a single-socket, 4 core CPU:
Let me know if you want me to try the new build irregardless.
All the best, Uwe
-
Brilliant idea…
I was also looking for a GPU emulation but not enough gifted to acheive that
Thank you!