By using this site, you agree to our Privacy Policy and our Terms of Use. Close

Forums - Sony Discussion - Gods... ops Naughty Dog Explains PS4's CPU, Memory and More in Detail and How They Can Make it “Run Really Fast”

Kane1389 said:
Naughty Dog is more appreciative of CPUs rather than GPUs it seems, which is a shame, because PS4's CPU is nowhere near as impressive as its GPU. Even in making of UC2 videos, they talked about how important the CPU tasks were

The article is about the cpu interaction with memory, not about the gpu. Anyway it shows how exclusives can get a lot more out of the hardware as they are written with the specifics of the hardware in mind, optimized to run on 6 cpu cores.
Other then that it's failry generic, I would like to see some more stuff on the gpu as well.



Around the Network
Dr.Henry_Killinger said:

Memory Architecture and Systems is barely covered in intro series, and system specific in upper graduate courses but we are talking a select few universities and this is commercial system specific hardware. These magical PS4 optimization courses wouldn't exist cause they wouldn't have books, projects, or professors.

The only way you would learn this is through handons practice.


I understand your point, but if you lern about variable, pointers and memory management (garbage colector)  in C/C++ you have all the basis of what ND is talking , minus the thread alocation and jobs pipeline.

But as I said, I just understood what all that was about in my fourth year when I did "enfasis" classes on Software/Hardware desing and optimisation... Unfurtunally since I graduated I went to work in a differente area... but I´m planning to go back to get a master´s degree with my former professor, unfortunually it´s to good making money with a easy and well paid job, even if I don´t like the subject (data base and big data), I hope to get fired by the end of this year.



VanceIX said:
If there's anyone that can use the PS4 to its full potential, it's Naughty Dog. Can't wait for Uncharted 4!


Me too....if it continues with Nate's adventures. Uncharted without Nate is like Raiders of the Lost Ark without Harrison Ford. They had better not fuck us over.



Very good presentation, it's nice to have some insights on hardware project decisions coming from experienced developers.



vivster said:
Dark_Feanor said:
Good, those are things that every Computer Science/Engineer learn in the first semester of the course. And you only really understand by the graduation, and may be never work with it.

Any way, GDDR 5 has nothing special, it just faster than normal DDR 3, but it´s interesting a game studio working that close to the metal for optmisation, that is the benefit of working in only one platform.

For me the guys at Epic and Cryteck are the real gods.

Crysis 3 and Farcry 3 were some of the worst optimized games I ever had to torture my GPU with.They may be good at utilizing new tech but they absolutely suck at optimizing for performance.


Farcry 3 is not Cryengine and Crysis 3 SP runned smoth in my 360, MP was a hell though.



Around the Network
Dark_Feanor said:
Dr.Henry_Killinger said:

Memory Architecture and Systems is barely covered in intro series, and system specific in upper graduate courses but we are talking a select few universities and this is commercial system specific hardware. These magical PS4 optimization courses wouldn't exist cause they wouldn't have books, projects, or professors.

The only way you would learn this is through handons practice.


I understand your point, but if you lern about variable, pointers and memory management (garbage colector)  in C/C++ you have all the basis of what ND is talking , minus the thread alocation and jobs pipeline.

But as I said, I just understood what all that was about in my fourth year when I did "enfasis" classes on Software/Hardware desing and optimisation... Unfurtunally since I graduated I went to work in a differente area... but I´m planning to go back to get a master´s degree with my former professor, unfortunually it´s to good making money with a easy and well paid job, even if I don´t like the subject (data base and big data), I hope to get fired by the end of this year.

Understanding it is trivial, implementing it requries system specific knowledge.
Especially if it uses a propritary language.



In this day and age, with the Internet, ignorance is a choice! And they're still choosing Ignorance! - Dr. Filthy Frank

Dark_Feanor said:
Good, those are things that every Computer Science/Engineer learn in the first semester of the course. And you only really understand by the graduation, and may be never work with it.

Any way, GDDR 5 has nothing special, it just faster than normal DDR 3, but it´s interesting a game studio working that close to the metal for optmisation, that is the benefit of working in only one platform.

For me the guys at Epic and Cryteck are the real gods.

Hahahahahahahahaha!

You always give me a good laugh when I need one. 



Sigs are dumb. And so are you!

read the article multiple times. Great one !!! :)



If I'm understanding the first part correctly, the reason they can only use 5GB is because the dev kits only use 8GBs (most likely due to costs), part of which is used for debugging. So, once Sony gets out dev kits with more RAM (when prices lower), they should be able to use more. Could just be misunderstanding that, though.



ethomaz said:

During the tail of an extremely interesting presentation at at the Semana Informática in Lisbon Naughty Dog Lead Programmer Jason Gregory described the PS4′s CPU, its memory, it’s GPU, its cache architecture and more in great detail, also explaining how the studio optimizes those resources to achieve superior results thanks to the knowledge of the strengths and weaknesses of the hardware, taking full advantage of it and making code “run really fast.”

First of all, Gregory explained that while 8 gigabytes of ram seem like a lot, only five are allocated to games, and they can be filled up quite easily:

Even in the PlayStation 4 you have 5 gigs, which seems like a lot but you’ll be amazed by how quickly it fills up.

Due to that Naughty Dog is very careful on how the memory is budgeted and allocated in order to use it efficiently.

Memory fragmentation is one of the worst enemies, because it causes a game to run out of memory a lot faster than it normally would. Naughty Dog solves that by custom-tailoring memory allocators to match the software’s allocation patterns.

The studio also uses explicit memory maps in their engine, that tells at any given time where the memory is being used and what kind of memory it is.

That’s quite important because many development kits, especially PS3 ones, have twice as much memory, used for debug purposes. That means that game features should not to use that memory.

Moving on to multi core processor management, Gregory explained how The PS4, which he defined as a “highly paralel machine,” works.

There are 8 CPU cores, that are “higher quality more powerful processors than what you have on the main CPU of the PS3,” and they’re organized into two clusters.

Gregory also explains that the GPU is “more powerful than it’s necessary to render graphics at 1080p at 60 hz” and that the idea of the designers of the PS4 was to give the console extra GPU resources because it’s “incredibly good at doing massive amounts of parallel processing” and they envisioned that game designers are going to take advance of that processing to do physics, cloth simulation, fluids and more on the GPU.

With the PS3 Naughty Dog developed in conjunction with Sony’s ICE team a “Job system” to make efficient use of the multi-core CPU, and a similar one has been created for the PS4.

Only six cores are available for games, as two are used by the operating system. The Job system also uses the GPU on top of these six cores, as it’s enabled to run code. Each CPU core runs a worker thread, and while the first takes care of the main game loop, other jobs are allocated between the remaining five cores.

On the other hand the GPU takes care of the rendering and the GPGPU (genral purpose GPU programming) Wavefronts, basically the physics, cloth and similar computing mentioned above.

Another very important concept is optimization, and a crucial element of it is the “80/20 rule,” meaning that your program spends 80% of its time running 20% of your code. The rest of that code is run very seldom.

So when you optimize your code, you don’t want to optimize that 80%, because you’d be wasting your time. On the other hand Naughty Dog focuses on that 20% that really matters, and that allows them to get the most bang for their buck.

Knowing the hardware is very important as well, as there are optimizations that can be adapted only to one specific piece of hardware, given a deep knowledge of its inner workings.

Memory caching is a very relevant part of optimization, as modern processors take a fairly high number of cycles to access data from the main RAM, which is big. Then there’s a much smaller memory cache named L2, that is also much faster to be accessed, the L1 cache that is even faster, and then there are Regs on the chip itself that are super small, but basically instantaneous.

Keeping high performance data small helps thanks to this, as it can fit in the cache, which can be accessed extremely quickly. Having them small and contiguous in memory is even more beneficial.

The PS4, specifically, has eight cores arranged in two clusters. The L2 cache is actually split in two, one for each cluster, and communicating from each cluster to its own L2 cache takes 26 cycles. Communication between a cluster and the L2 cache attached to the other cluster is much slower, taking 190 cycles.

In addition to that, when you read a single byte in the main RAM, it also loads a whole 64 bytes of memory into the cache.

The knowledge of those PS4-specific quirks allows the studio to optimize the code so that it avoids having clusters that communicate with the “wrong” L2 cache and puts data on separate cache lines, removing the chance of conflicts and slowdowns.

A last very interesting detail is that the PS3 had really terrible branch prediction hardware in the CPU, meaning that “If” branches in code often caused bad performance if they weren’t given “all sorts of hints” simply because the CPU wasn’t good at predicting what the code would do.

On the other hand the PS4 has “really really good” branch prediction hardware, that will “guess” what the code will do, removing the need for all the additional work that was necessary on the PS3.

One thing is for sure: hearing this talk it’s hard not to feel even more excited about seeing the first Naughty Dog PS4 title. We’ll have to wait and see if the studio’s technomancy will really make the platform sing, but my money is on “yes.”

http://www.dualshockers.com/2014/03/11/naughty-dog-explains-ps4s-cpu-memory-and-more-in-detail-and-how-they-can-make-them-run-really-fast/


Nice to read about actual cycle-delays but what exactly is there new in these slides? Game coders already know everything they present in these slides... You don't have to tell coders how computers work.