Remove SMP code
|Priority:||Immediate||Spent time:||0.20 hour|
SMP support is present but broken in the vanilla Enemy Territory.
Although it is disputable if there will be any benefits to it (see below), we should backport SMP support from ioquake.
Zachary from the ioquake project:
Regular (id software) Quake 3 supported this, and it worked "ok" on old SMP Pentium 500 Machines back in the day.
So all the SMP code in Quake 3 when the source code was released was designed to improve the game on ancient hardware.
On modern hardware the built-in SMP support on the id software Quake 3 gives little benefit to, none, or degrades, performance.
client: added experimental SMP support, fixes #44
(to enable this feature do premake4 –enable-smp)
#2 Updated by Dragonji about 7 years ago
SMP was present in Q3 engine to increase performance for multi-processors machines. Those still exist but are rarely seen.
I would like to ask what about multi-cores support? It will be a lot of work, I am aware of that, but such a feature will provide much better FPS for most ET players in my opinion.
#3 Updated by Radegast about 7 years ago
TheDushan implemented multicore support in OpenWolf and I vaguely remember he gave me a patch for ET:L (and now his repository is public). I didn’t do anything about it because 1) I don’t understand this stuff and 2) This is a huge thing that would likely results in a few bugs which we don’t need right now. However, we can create a ticket for version version:2.80
#4 Updated by IR4T4 about 7 years ago
- Subject changed from Fix SMP support to Fix SMP support and exclude smp code by precompiler macro
- Status changed from Fixed to New
Dragon, as far as I know the OS (running a multi core) already deals with this - see processor affinity.
Radegast, I did change the title of ticket and did open it again:
Set more precompiler marcros for smp code - see #ifdef SMP
Related vars and functions
#7 Updated by Dragonji about 7 years ago
Don’t know if this is a tweak ... some installs may have better FPS results if one core is set. However you are already able to set affinity by OS so why should we add such a feature again?
I think you don’t understand what I mean.
There is such a cvar in Enemy Territory: Quake Wars:
r_useThreadedRenderer [0,1,2 ] - Added as of the 1.2 Patch, this option allows you to enable multithreading if you have a dual or multi-core CPU, and this can improve the performance of ET:QW. By default it’s disabled (set to 0), but you can set it to either 1 or 2, with a value of 1 locking the renderer to your in-game frames, while 2 allows it to run unlocked. The developers recommend a value of 2 for this variable if you wish to enable it. Note that you must enable it either by inserting it in your autoexec.cfg file, or by entering it in the console prior to the start of a game; it can’t be changed during a game.
I mean that something like this could be introduced into ET:L.
#16 Updated by Radegast almost 7 years ago
- Status changed from Fixed to Feedback
- Target version changed from 2.70rc1 to 2.90
- % Done changed from 100 to 10
SMP doesn’t work for me on my Mac. However, it is part of the code and for those people who want to test it on other platforms and report their findings I removed the hardcoded disablement.
It will likely cause trouble for most users who use it, but since they have to 1) enable
FEATURE_SMP and 2) set
r_smp to 1 and they receive several warnings in the process, I think it is quite noob-proof.
Dushan implemented real multithreading in OpenWolf by using OpenMP. Maybe we could try to port it..
#18 Updated by TheDushan over 6 years ago
- File dualprocessoracceleration.jpg added
- File multithreadinginet.jpg added
- File smp.jpg added
- File experimentswithOpenMP-2.jpg added
- File experimentswithOpenMP-3.jpg added
I had few years ago working R_SMP inside OpenWolf, just how I remember I didn’t get much improvements. It just OpenGL renderer into separate thread. As you can see on first three pictures.
Don’t think that today it will be success to have or to use that. I remember that I had enormous problems with getting it to work on XreaL renderer, while with vanilla it was working perfectly.
Last two pictures are some experimental build of OpenWolf with most of loops moved into parallelism and compiled with OpenMP.
At that time I believed that it I move everything into work-sharing constructs that I could get better and more stable engine.
#19 Updated by Radegast over 6 years ago
- Subject changed from Fix SMP support and exclude smp code by precompiler macro to Remove SMP code
- Status changed from Feedback to In Progress
- Assignee set to Radegast
- Target version changed from 2.90 to 2.71rc1
- % Done changed from 10 to 0
After what Dushan said and seeing that Tim Angus @ ioquake also removed SMP support, I don’t think we have any reason to fix/keep it.
#21 Updated by IR4T4 over 6 years ago
- Status changed from Fixed to In Progress
- Priority changed from Low to Immediate
----- R_Init ----- SDL using driver "x11" Initializing OpenGL display Estimated display aspect: 1.600 ...setting mode 13: 1440 900 Available modes: '720x450 840x525 960x600 1440x900 1680x1050 680x384 1360x768 960x540 320x240 400x300 512x384 640x480 700x525 800x600 832x624 1024x768 1152x864 1280x960 1400x1050 1280x1024' Couldn't get a visual ...WARNING: could not set the given mode (13) Initializing OpenGL display ...setting mode 13: 1440 900 Available modes: '720x450 840x525 960x600 1440x900 1680x1050 680x384 1360x768 960x540 320x240 400x300 512x384 640x480 700x525 800x600 832x624 1024x768 1152x864 1280x960 1400x1050 1280x1024' Couldn't get a visual ...WARNING: could not set the given mode (13) Setting r_mode 13 failed, falling back on r_mode 3 Initializing OpenGL display ...setting mode 3: 640 480 Available modes: '720x450 840x525 960x600 1440x900 1680x1050 680x384 1360x768 960x540 320x240 400x300 512x384 640x480 700x525 800x600 832x624 1024x768 1152x864 1280x960 1400x1050 1280x1024' Couldn't get a visual ...WARNING: could not set the given mode (3) ----- CL_Shutdown ----- RE_Shutdown( 1 ) ----------------------- GLimp_Init() - could not load OpenGL subsystem