Author Topic: Multiple CPU cores  (Read 17024 times)

0 Members and 1 Guest are viewing this topic.

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Fine. You get on with that. Tell us when you're done. :p
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Spicious

  • Master Chief John-158
  • 210
This is rubbish! Absolute rubbish! Multi-core CPUs are the wave of the future! Intel demoed an 80-core CPU running on an FPGA years ago - even though it was running on an FPGA, it could run XP! It didn't run very fast, but because it was a prototype board all the signals had to go through a bunch of gates. Once they get a design that uses real transistors instead of gates it will be way faster.

These CPUs are coming out really soon. I even bet tomorrow they'll be announcing the Core 3 32-o with 32 cores. Only this time it won't be a prototype - oh no, it will be a monster 4 GHz, 32-core computing machine. Should be really easy to do once they get their 32 nanometer process up and running. With the power savings I bet it will run with less power than one of their 90 nanometer octo-cores.
Somehow I don't think any decently priced consumer level computers are going to end up with that number of cores for quite a few years.

Quote
The FS2SCP cannot ignore this trend. We need to be able to take advantage of these CPUs NOW, before it gets beaten out of the gate by all the other space simulator projects, open- and closed-source.
Other space simulators?

Quote
I hear the Descent Rebirth team has a huge update coming that will take Descent's ~15 year-old engine and make it look and run ten times better than anything currently on the market, or that will soon be on the market. And you know how they're going to do that? By taking advantage of multiple cores, and the special SSE5.1 instructions built into these upcoming Intel CPUs. Damn, I hear even Orbiter is adding space combat. It's going to be awesome.
As other people have said, graphics tend to improve due to better GPUs and extra instructions usually have very little effect on anything they aren't specifically aimed at.


Quote
We have to make the FS2 engine more parallelism if we want to keep up.
The word you're looking for is multithreaded.

Quote
Our target hould be to get it running perfectly on one of these soon-to-be released Intel CPUs. I know your instinct is going to be to make use of that awesome feature that takes all 32 cores and reconfigures them into one giant core to rule them all. But that's wrong! That's what all the other teams want you to try! What happens when you have that many instructions in flight at that kind of speed (we're talking terahertz here) is that you strangle even the best I/O bus money can buy. That's right, the FSB, HyperTransport, even Intel's new QuickPath can't handle the raw amount of data put out by a CPU in this mode.
I/O can never keep up with CPU speed, hence the need for multiprogramming. Also, do you feel like providing these soon-to-be released Intel CPUs for every coder?

Quote
Sure, there are some narrow scientific uses nobody cares about that keep all the traffic on-die and require no access to the memory controller or the graphics controller, but FS2 is not one of those applications. That CPU is generating thousands of teraflops per second, and it needs to send those teraflops to the graphics card as fast as it can. The problem is that graphics cards have to process those teraflops really fast to put them on the screen, right? And ATi only just came out with a video card that can only handle two teraflops per minute. So clearly it can't keep up with these Intel CPUs. The other teams know that, and they're already looking for another way to harness the power of these new CPUs.
You do know that flops are a measure of floating point operations per second, right? Teraflops per second or per minute have no meaning.

Quote
Fortunately, I was recently fired by a team working on a very promising space project which I'm not allowed to name.
Did you go on a tirade telling them to focus entirely on unreleased hardware too?

Quote
I know the method they're using to optimize to put more parallelisms in their code! The trick isn't to try and get all of the cores on the CPU doing the same thing at the same time to make it faster, because each core will just end up waiting its turn for the L2 cache, no matter how big it is. No, the trick here is like this: say you have a 32-core CPU. You load your executable into memory starting at address 0x00000000. Yeah, I know, that's really reserved kernel memory or something like that, but for the sake of argument let's pretend that the OS uses an addressing scheme that loads the executable at 0x00000000. Pretend that the OS realized I had this awesome idea and made all this space for me by throwing the kernel on the stack (which usually starts at 0xFFFFFFFF and grows down). You know what I mean here.
You'd put the entire kernel on a user stack?

Quote
So anyway, you have core 0 start executing at 0x00000000. Then you have core 1 start executing at 1/s, where s is the size (in the address space) of your program. Core 2 starts at 2/s, core 3 at 3/s, and so on and so forth. All of the code in the FS2 executable will be executed much faster. How much faster you ask? Try 32 times faster! That's right, we've finally found a way to get linear speedup out of multiple cores!
That's great if your code executes completely linearly, once and no code depends on anything happening before it, which would be never. You may wish to note that if all the code in the executable were just run once, it would finish pretty quickly. Also, this would completely kill locality on the code segment creating that massive cache footprint you mentioned earlier.

Quote
But how is this possible? Every computer science paper you've read, even the most optimistic marketing you've seen have shown less than linear speedup as you add codes. What's the secret? The secret is the IOMMU, or I/O Memory Management Unit.
That has nothing to do with CPU performance.

Quote
It was initially developed because it would be useful for Virtualization. The problem is that even with these massively powerful processors, virtual reality is years away yet.
Virtualisation has nothing at all to do with virtual reality.

Quote
At least two. So in the meantime, we've found another use for this really fast memory management device. When it is implemented on the same die as the CPU, it can be used to pass messages between all 32 cores. The device literally stands on its head (okay not literally, it would fall out of its socket) to pass just-in-time messages from one CPU to another, supplying it with information just as it needs it.
Why would an MMU pass messages between CPUs? The IOMMU has nothing to do with the CPU.

Quote
So, I realize I kind of rambled on a bit here, but this new technology gets me excited. In short, here's the steps I'm proposing the SCP team take:
So excited that you didn't understand any of what it does?

Quote
1. Design an engine which dynamically takes different slices of the game code and passes it to idle CPUs as needed.
Adding huge overheads (in addition to all the other overheads inherent to multithreading).

Quote
2. Hack together an IOMMU driver to make the performance of the above solution acceptable. The goal should be no less than linear CPU scaling as CPUs are added. I think the best we can hope for is 2xlinear, if we find a way to take advantage of reverse-hyperthreading.
Linear scaling with additional CPUs is not going to happen and has nothing to do with IOMMUs.

Quote
3. Make a complete switch to ray-tracing because rasterized graphics do so poorly when you spread the load out over more processing cores (just look at the size of GT200, and how it's beat in some cases by the smaller RV770!).
Wha?

Quote
4. Take advantage of the iSSE5.1 instructions, which are the most important part of what I just explained.
What SSE5.1 instructions and what might they do?

Quote
5. Beat the DXX-Rebirth team to market, because they're going to use all their CPU power to make sure their game has an awesome story and lots of plot twists.
Increasing CPU power does not improve stories or plot twists.

 

Offline Mars

  • I have no originality
  • 211
  • Attempting unreasonable levels of reasonable
I might just be a nugget here (in fact this is my first post) but because a previous job had me trying to explain this concept (in much futility) to countless people who wanted to know why their shiny new phenom/core2quad wasn't as fast as it "should be" i feel compelled to take part in this thread in spite of having no established credibility here.

that said... to anyone who has even considered toying with the program's multicore affinity in hopes of improving performance, listen up: just leave it, seriously, no touch! changing what cores it runs on in nearly any case will result in little more than mere placebo at best, but you're more likely to make performance suffer than anything.

multi-core processors offer little advantage to gaming overall, especially a game written in 1999 before such cpus were even on the market. why?
because:
-pc games rely more on graphics processors than cpus, frequently even if a game maxes your video card and your RAM it still won't be bogarting the cpu time
-what little benefit is to be seen with multicore processors is that you can restrict your game to the second core and the os and other apps will pretty much stick to the first core
-a game can potentially make effective use of multiple cores if they are programmed to do so, but unless someone here seriously overhauled the engine on a fundamental level (or i'm seriously misunderstanding something), fs2 is not one of those games

so unless you've committed one of your cores to encryption cracking, or you're testing your newtonian physics mod that you wrote to thread itself on a separate core, i hope i don't come across as pretentious because i doubt people without at least some practical knowledge wander into this part of the forum much but i would strongly suggest leaving your registry and your multicore as they are


that said, i think i've run my mouth enough for now, so, it's nice to meet you all  :cool:
While I pretty much agree with you, some games, such as Sins of a Solar Empire, are far more CPU intensive than GPU intensive.

 

Offline blackhole

  • Still not over the rainbow
  • 29
  • Destiny can suck it
    • Black Sphere Studios
Quote
Make a complete switch to ray-tracing because rasterized graphics do so poorly when you spread the load out over more processing cores (just look at the size of GT200, and how it's beat in some cases by the smaller RV770!)

There are 5 million things wrong with your post, of which many have already been pointed out, but I'm a graphics-crazy guy, and I want to point this out:

Ray tracing is not currently a viable method of rendering, and will not be for many years to come. This isn't because we can't do raytracing in realtime, its simply because a rasterization approach is going to look a whole heck of a lot prettier for a very long time. Saying that rasterized graphics will preform worse then equally good-looking raytracing graphics is like saying that C++ code will run slower then Java code.

Ray-tracing only becomes beneficial when you are dealing with global illumination, soft shadows, and reflections/refractions. People can go ahead and scream that real-time raytracing is the wave of the future, but people also said we were all going to die when the LHC was turned on.

 
Okay, saying things like
Quote from: MikeRoz
5. Beat the DXX-Rebirth team to market, because they're going to use all their CPU power to make sure their game has an awesome story and lots of plot twists.
just makes me think the whole thing is somehow sarcasm.
Everything is better with monkeys.  Even pie.

That is the best first post I have ever seen.

 
Fortunately, I was recently fired by a team working on a very promising space project which I'm not allowed to name.

what i find hilarious is the hypocritical nature of this sentence.

 

Enki

  • Guest
This is rubbish! Absolute rubbish! Multi-core CPUs are the wave of the future! <snip...>

These CPUs are coming out really soon. I even bet tomorrow they'll be announcing the  <snip...>

The FS2SCP cannot ignore this trend. We need to be able to take advantage of these CPUs NOW<snip...>

We have to make the FS2 engine more   <snip...>

Fortunately, I was recently fired by a team  <snip...>

So, I realize I kind of rambled on a bit here, but this new technology gets me excited. In short, here's the steps I'm proposing the SCP team take:

1. Design an engine which dynamically takes different slices of the game code and passes it to idle CPUs as needed.
2. Hack together an IOMMU driver to make the performance of the above solution acceptable. The goal should be no less than linear CPU scaling as CPUs are added. I think the best we can hope for is 2xlinear, if we find a way to take advantage of reverse-hyperthreading.
3. Make a complete switch to ray-tracing because rasterized graphics do so poorly when you spread the load out over more processing cores (just look at the size of GT200, and how it's beat in some cases by the smaller RV770!).
4. Take advantage of the iSSE5.1 instructions, which are the most important part of what I just explained.
5. Beat the DXX-Rebirth team to market, because they're going to use all their CPU power to make sure their game has an awesome story and lots of plot twists.

Wow.  Just wow.  Well, just about the whole post is devoid of reasonable technical merit and accuracy.

The need to multithread new applications is undeniable, but the ability to cram new threads into an existing codebase and not screw the pooch is not something that is reasonable.  To do a good multi-threaded game engine requires the choices to be made up front so the data structures can be organized in a fashion that doesn't require exotic constructs like virtual software IOMMUs. Proper data structure design is far more important than the code itself since almost all the less than linear increase per added core performance is due to data contention.


 
It's sarcasm. DXX Rebirth? Plot twists?

 :lol:

 
valve pulled it off with half life, but then again... they completely rewrote it to do it =p and they threw in an x64 single player version too.

while scp has indeed made fs2 a work of art, it still doesn't have that much of a load on resources. Look at some of the models people have released. Not ridiculous on poly count yet still things im proud to play with... Hell the media VP's are the best thing since sliced bread. I think the focus on features out weighs multi-threading by a long shot. Would it be nice to see? sure but it's not necessary. Just my two cents...

  

Offline Turambar

  • Determined to inflict his entire social circle on us
  • 210
  • You can't spell Manslaughter without laughter
yup, FS2 on one core leaves the other 3 free for music or torrents or rendering or whatever else i feel like doing :-P
10:55:48   TurambarBlade: i've been selecting my generals based on how much i like their hats
10:55:55   HerraTohtori: me too!
10:56:01   HerraTohtori: :D

 

Offline Spicious

  • Master Chief John-158
  • 210
valve pulled it off with half life, but then again... they completely rewrote it to do it =p and they threw in an x64 single player version too.

while scp has indeed made fs2 a work of art, it still doesn't have that much of a load on resources. Look at some of the models people have released. Not ridiculous on poly count yet still things im proud to play with... Hell the media VP's are the best thing since sliced bread. I think the focus on features out weighs multi-threading by a long shot. Would it be nice to see? sure but it's not necessary. Just my two cents...
I'm sure race conditions and deadlocks can be simulated in one thread if you ask nicely enough.

 

Offline CaptJosh

  • 210
If I may say something, it is simply this. Please don't feed the trolls. The only correct thing that guy said was that multi-core CPUs are the wave of the future. That is correct. THE FUTURE. The game we work on is a game of the past. If he is too foolish to grasp this, we shouldn't bother responding to him.
CaptJosh

There are only 10 kinds of people in the world;
those who understand binary and those who don't.

 

Offline MachManX

  • 26
  • The Fight Never Ends...This Is A Fact Of Life!
Wow, he just wasted about an hour of his life.  Why in the world would you use all that power to run 1 game?  That's stupid, especially when the game itself is already running at full speed?  I thought the purpose of having "multicores" was to "multitask" better, right?

Besides, the less processing power a program requires, the more that is available to other programs, which means MORE multitasking ;)

MikeRoz, please read up on what multiple cores are all about, otherwise shut up!  If you want to run FS2 with the most processing power, then buy a single core processor and overclock it like crazy, around the 5GHz mark; then run FS2 on it.  Otherwise, the guys here are doing an amazing job on this project and I couldn't be more proud of them :)

P.S: I know that the developers here are gonna come out with something that's gonna make FS2 even better, so I'm gonna have to increase my capacity for happiness ;D
AMD Ryzen 5 3600
B450I GAMING PLUS AC
Geforce GTX 1060 6GB
16GB DDR4-3600
WD SN750 1TB NVME
Samsung 850 EVO 250GB SSD
Corsair HX520W PSU
Cougar QBX Case
NEC V422 42" @ 1080p
Ubuntu 20.04 + Whatever I VM

 

Offline MikeRoz

  • 26
Wow, didn't this thread die back in September? I guess I have no choice but to respond.

Wow, he just wasted about an hour of his life.  Why in the world would you use all that power to run 1 game?  That's stupid, especially when the game itself is already running at full speed?  I thought the purpose of having "multicores" was to "multitask" better, right?

Besides, the less processing power a program requires, the more that is available to other programs, which means MORE multitasking ;)

MikeRoz, please read up on what multiple cores are all about, otherwise shut up!  If you want to run FS2 with the most processing power, then buy a single core processor and overclock it like crazy, around the 5GHz mark; then run FS2 on it.  Otherwise, the guys here are doing an amazing job on this project and I couldn't be more proud of them :)

P.S: I know that the developers here are gonna come out with something that's gonna make FS2 even better, so I'm gonna have to increase my capacity for happiness ;D
Yeah but that's the point. Intel's latest chip offers eight logical cores, and future chips are sure to offer even more performance. Unless you participate in Origami folding competitions, that extra power is just going to be sitting there, wasted. Yet we all know a simulation like FS2 needs all the processing power it can get, and that can easily be split off into multiple cores.

Just look at all the things going on in FS2. I mean, it's a feat that Volition was able to make it run on the computers of 1998 and 1999. Let's just start with a single fighter going flying through an "empty" map. You've got all the systems of the fighter that have to be simulated: weapons, propulsion, life support, shields, sensors, communications, etc. Though they all have to work together to some extent, their tasks are largely independent, making them the perfect candidates to be split off into threads.

And then there's the supposedly empty map. Should be easy to simulate, right? Wrong! Even outer space isn't a perfect vacuum. There are several hydrogen atoms per centimeter. This is zillions of atoms, flying every which way, interacting with each other, bouncing off your ship, at every given moment. Some day we may be able to assign a thread to each so that their processing is not all crammed into one line of execution, but we may not quite be there yet. In the meantime, there is still plenty the team can do with multiple cores. Like explaining where the Shivans came from.

Wow.  Just wow.  Well, just about the whole post is devoid of reasonable technical merit and accuracy.

The need to multithread new applications is undeniable, but the ability to cram new threads into an existing codebase and not screw the pooch is not something that is reasonable.  To do a good multi-threaded game engine requires the choices to be made up front so the data structures can be organized in a fashion that doesn't require exotic constructs like virtual software IOMMUs. Proper data structure design is far more important than the code itself since almost all the less than linear increase per added core performance is due to data contention.

Alright, so I admit I was a bit hasty by introducing my whole start-n-threads-of-FS2-by-starting-execution-of-thread-x-at-position-x/n-in-the-code idea. I actually tried this by defining a bunch of function pointers to point to the desired areas of the code, and then spawning a pthread with each function pointer. To even my surprise, the game ran the first time. It even ran slightly faster. To my horror, instead of blowing up Capella in my playthrough of the retail campaign, the Shivan AI suddenly became transfixed by one random point in space and began to congregate all their ships there. And by all, I mean all. The area soon collapsed into a supermassive black hole into which all the surrounding systems were sucked. It took forever, less due to performance issues and more due to relativistic effects.

Needless to say, there is a small but crippling concurency bug in the AI that prevents this method of multithreading that I have no interest in fixing. There's no time, not if we want to beat the GL-117 team's next-generation effort to market. But don't worry, I've got a great idea they'll never see coming. You see, they only plan to take advantage of the processing power one machine has to offer. Which would be fine, if this were 1997. You see, however, multithreadedness is in the future, and distributed computing is on the horizon. If we get there first, the world, as they say, will be ours.

My friends, I give you FSOS. That's FreeSpaceOperatingSystem. With hardware IOMMUs (not the clumsy software things you brought up earlier, Enki) even closer to becoming mainstream, virtualizing an OS is starting to carry less and less of a penalty. If we make FreeSpace into an OS, we can harness this advantage!

To explain, an IOMMU is a device that arbitrates memory and peripherals so that each of any multiple OSes on a computer thinks it has complete and direct control of the hardware, at no performance penalty. In the future, we may harness this to run multiple copies of FSOS at the same time, all with little to no performance penalty, but we should first focus on getting one copy of FSOS stable working on multiple cores.

"But no!" enki is fuming, "You still haven't solved the problem of data contention!"

Did you really think I'd type all this without figuring out a solution to that too? The answer is simple. We reverse-engineer and use GoogleFS. To a CPU, the hard disk is slow, and even its RAM is slow. But the Internet is fast! Just look at how fast Google's servers get results to your computer. This is because they use a file system that is designed from the ground up for redundancy, distributibility, and to be used concurrently by thousands of clients.

Of course, this will have the unfortunate side effect of requiring that the first few FSOS users have a cluster of GoogleFS machines attached to a local network to act as their filesystem. The good news is that subsequent users can use this space as quickly as though it were part of the cache on their CPU.

yup, FS2 on one core leaves the other 3 free for music or torrents or rendering or whatever else i feel like doing :-P

That is the beauty of FSOS :) Once we reach critical mass (I define that here as one thread per every four hydrogen atoms in free space), you will have access to a game world so vast and dynamic, that you can take care of all your game needs inside the virtual world. Since it's the computers of the future that we're simulating here, any task you undertake on a simulated computer in FSOS would complete in a fraction of the time it would take to complete on your silly 21st century machine.

To summarize:

1. FreeSpace as a simulation is highly constricted by CPU power and lack of parallelism; just look at all the underlying details abstracted away.
2. Simulating the game world on a more fundamental level will lead to more interesting stories.
3. Since AMD utterly failed at it, we are stuck having to implement reverse-hyperthreading, and as a software library at that.
4. GPUs can be used to simulate drawing implements in the virutal world, since they're so good at rendering things.
5. I would love to see how sound fares in the engine when we transition to this more realistic model.
« Last Edit: November 08, 2008, 05:41:46 am by MikeRoz »
Rave reviews of my previous posts:
"Wow.  Just wow.  Well, just about the whole post is devoid of reasonable technical merit and accuracy." -Enki
"Wow, he just wasted about an hour of his life." -MachManX
"There are 5 million things wrong with your post, of which many have already been pointed out..." -blackhole
"Grrr. Someone please monkey mike...He's causing more problems than he's solving" -terran_emperor
"You're not very bright, are you." - General Battuta

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Quote
You've got all the systems of the fighter that have to be simulated: weapons, propulsion, life support, shields, sensors, communications, etc. Though they all have to work together to some extent, their tasks are largely independent, making them the perfect candidates to be split off into threads.

Okay, now I get it. You had me going for a while.

(In case you're not getting it, guys, he's kidding around.)

 

Offline Topgun

  • 210
We should Totaly Take Advantage of that!!!!
I mean.. That would make fs2 better then fs3!!!!11
it would be like so cool with paralism and stuff!

 

Offline MachManX

  • 26
  • The Fight Never Ends...This Is A Fact Of Life!
Oh yeah, I kinda figured he was kidding around when he talked about DXX-Rebirth ;)  But it's fun counter-arguing his pointless points :D

Quote
Yet we all know a simulation like FS2 needs all the processing power it can get, and that can easily be split off into multiple cores.

Um no, it doesn't need all the processing power it can get because it is already running at full speed.  And no, it cannot be easily split off into multiple cores.  But if you know how, then please do it for us.  Heck, I'll even donate some money if you can get a major improvement in performance by allowing the game to use multiple cores.  Otherwise, there's no point in enabling multiple cores if the performance improvement is minor.  Besides, the less my CPU works, the longer it'll last, and less heat produced by the processor ;)

Quote
it's a feat that Volition was able to make it run on the computers of 1998 and 1999

Um, the game only requires like 200Mhz with a 3D card, and I had a 400MHz computer with a Nvidia Riva 128ZX in 1997.  So it ain't no feat, and it is especially no feat to run that game on a modern 2008 computer, without the modifications of course ;)  Quake 3, now that's a game that was developed way ahead of its time.

Quote
There are several hydrogen atoms per centimeter. This is zillions of atoms, flying every which way, interacting with each other, bouncing off your ship, at every given moment.

Um, why would we bother calculating all of that if we cannot see or feel it?  Not even you know the effect of random particles on a ship in space.  But if you wanna find out, Battlestar Galactica is selling all their props, including a Viper Mark II, though you'll have to make it space ready  :lol:

Quote
In the meantime, there is still plenty the team can do with multiple cores. Like explaining where the Shivans came from.

What do multiple cores have to do with Shivan origin?


If you're that crazy in making all the things you said happen, then do it yourself.  Then show it to us.  The game better be in fully working condition and as interactive as Freespace 2 to get the acknowledgement of everyone here.  Otherwise, you're just talk.  You can't walk the walk.  :drevil:
AMD Ryzen 5 3600
B450I GAMING PLUS AC
Geforce GTX 1060 6GB
16GB DDR4-3600
WD SN750 1TB NVME
Samsung 850 EVO 250GB SSD
Corsair HX520W PSU
Cougar QBX Case
NEC V422 42" @ 1080p
Ubuntu 20.04 + Whatever I VM

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Oh, come on, don't feed the (uniquely awesome) troll.

 

Offline maya

  • 24
  • Some text here.
    • PN3
Actually, i read if you had 10 dual core centrino's hooked up via a GNDN coudit,
plugged your satilite dish into the tv card of your pc but reversed the polarity of the LNB,
all while watching Tron you could....
I am a guy....all the cool BSG guy names were taken.
aka EmmEff | aka Pilot

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
If I may say something, it is simply this. Please don't feed the trolls. The only correct thing that guy said was that multi-core CPUs are the wave of the future. That is correct. THE FUTURE. The game we work on is a game of the past. If he is too foolish to grasp this, we shouldn't bother responding to him.

Who wants to be stuck in the past?
-C