News, PS4

Naughty Dog Explains PS4′s CPU, Memory and More in Detail and How They Can Make it “Run Really Fast”

by on March 11, 2014 8:30 PM 120

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.

NDPS4_1

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.

NDPS4_2

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.

NDPS4_3

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.

NDPS4_4

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.

NDPS4_5

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.

NDPS4_6

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.

NDPS4_7

NDPS4_8

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.”

Join the Discussion

  • http://E-mpire.com/ Omnistalgic

    Basically sounds like a much more refined platform versus what Ken was trying to do with PS3. I hope it means a lot more diversity in the software lineup this gen as games become easier to make/port…

    • Mikeherp Derp

      Krazy Ken tried to foist multicore on devs that hadn’t tried coding for 2 cores, let alone 8. And Cell is even harder to core for than the modern multicore CPUs we have today. It didn’t help that NVIDIA oversold and underdelivered on the PS3 GPU either. Huge mistakes all around with the PS3 design.

  • kevin

    Okay

    • shinitaru

      Okay

    • NL37

      LOL!! Kevin and shinitaru @ it again!!

      • shinitaru

        I don’t recall that, did he and I have words before?

  • Wargreymon559 .

    ND will make the xbone look like childs play.

    • Steph

      Lol ND is so overrated. There’s a reason Karis left and it’s not positive ;)

      • shinitaru

        U must be bored of your Xb1 as you constantly troll literally every single Sony article lol, keep proving us right champ

        • Demetre HG

          Right You Ponies are a failure at everything On wait did you look at the recent Stocks Phonies is Down again bahahahahahha and Microsoft are up beating Phonies all the time

          • shinitaru

            If that is what is important to you, have fun “playing” with your stocks. That crap doesn’t bother me, try again

          • You are flat out wrong

            This is what Xbot delusion looks like.

            Poor Demetre, I’d get your brain checked out if I were you.

          • ImonadrugcalledCharlieSheen

            I tried reading that but it was rife with spelling mistakes and grammatical errors, like most angry xbot posts.

          • shinitaru

            I’m fluent in gibberish…

          • ImonadrugcalledCharlieSheen

            Maybe you can tell me what that moron was going on about then.

          • shinitaru

            You really want me to? :/

          • SilentHashassin

            I bet Microsoft stock rising has absolutely nothing to do with the Xbox 1. The PS4 has been outselling it since launch and is consistently sold out. Every store has an Xbox 1… Simple mathematics and observation my friend.

          • shinitaru

            doesn’t really matter, stock rises and falls all the time. That’s for those bean counter Greenspan types, has nothing to do with us

            You remember correctly, MS stock fell sharply after the XB1 reveal

          • Michael Norris

            MS would pull the plug on the Xbone division faster then Sony would the Playstation division.

          • jayflow

            Let me guess how much stock you own in either of them…ahhhh that would be nothing right?

          • Michael Norris

            You are a moron lol…

          • Neil Riley

            I suspect your father and brother are the same person.

          • Oscar Portillo

            You got it wrong his mother is his father and the father is his mother.

            It’s a bit complicated as he has been taken advantage off by his transvestite brother.

            He is currently in counciling for what many call urine fettish; so yes this kid is a mess.

          • cozomel

            oh look another hateful, fearful xbot. They’re a dime a dozen. And man are they all dumb. Btw, Sony’s stock (SNE) has been up the last 5 days and the last month, just type in SNE and it’ll prove this clown wrong. Like they all are, bahahahahahha.

          • TheSoy

            Phonies is extremely clever. You should keep using that all the time.

          • Oscar Portillo

            Your comment only proves you know nothing about the money market ,first off Sony’s portfolio is not just Playstation so do a little research before you embarrass yourself.

            I bet you still live at home and depend on freinds for rides.

      • jayflow

        One of the dumbest commenters on this site.

        • Demetre HG

          Says the dumbass

          • You are flat out wrong

            Don’t talk about yourself, Demetre, you bedwetter!

          • jayflow

            Well damn I need to apologize to Steph, cause looks like Demetre has just taken her title!

          • Chris Hamilton

            the are probably the same person so you are right either way

      • Wargreymon559 .

        Lol Karis left cuz he wasn;t top tier level.

        Now begone xbot to play Tittiesfall…oh wait i forgot servers are having problems xD

      • DemonFenton

        Odd your not on your Xbox One and yet your talking smack….

      • static5125

        How does that actually have to do with this article? Sounds like someone is spending more time bashing anything that’s PS4 related than playing Titanfall…

      • Clate

        What is that? They got studio of the year and created the game that got more GOTY awards than any game in history…. Yep totally overrated /s

      • http://Xcite79.1up.com/ Keegs79

        *down vote*

      • choujij

        I see you’re back to acting stupid again.

      • superkarma

        There’s a reason why ND has survived for 20 years and still going incredibly strong…and it’s certainly not because they are overrated. It must suck to be as bitter as you and to be such a blind fanboy to not even give credit where credit is due.

        • Wargreymon559 .

          She just mad cuz she can’t play ND titles on her 90′s vcr console xD

      • Demetre HG

        Bahahahahahaha

      • ImonadrugcalledCharlieSheen

        Yeah cause he sucked and couldn’t keep up with a stellar development group, now he’s back at Epic where he belongs with the rest of the slackers.

      • Manoj Varughese

        He himself stated he isn’t a good fit there…so went back to Epic where he belongs.
        https://twitter.com/BrianKaris/statuses/441436788209762304

      • James

        Why? Did Karis just hit you up on Skype and told you first hand?

        What it’s like to be connected, huh lol

        • shinitaru

          I’ll hit him up about it later when he comes by for dinner :P

      • Bankai

        Nah, Naughty Dog is far from overrated and Hennig (at least get her name right) didn’t leave because of anything negative.

      • Jamic

        I can kind of agree with ND being overrated (havent been into their games much since Jak n Daxter series although I dont own any jak games) but I think they are pretty clever when it comes to hardware. They have been doing good things with PS2 and 3 hardware which are (in)famously more complex than their competitors.

        It was a great idea to allow them to design PS4 hardware. Even though MS was toutting (before the release) how they know what they are doing with XB1 hardware because “hey, we created directX so we know what we are doing” it turns out that its not the truth…

        I guess EsRAM sounds great on paper but in actual use its not, atleast not in the quanities that MS put in their box.

      • christrules0041

        He was working with Naughty Dog for 2 or 3 months. Funny how they are “over rated” yet make the most critically acclaimed games. The Last of Us and the DLC they released mixes story telling and gameplay perfectly.

        Of coarse everybody has there opinions. But when an entire industry loves something there is gonna be an oddball out(ie you).

      • Michael Norris

        You are a damn fool…and a damn troll…

      • Marek Kłos

        hAHAHAHA, This guy left after 3 weeks, because he is to weak to work for them.

      • TehP0werOfTehCloudz

        With ur logic Rockstar is overrated so is bethesda and bungie amirite ?

      • TehP0werOfTehCloudz

        and just stfu first u hate on infamous then the order and now uncharted
        bitch plz
        Jak 2 – uncharted 2 – the last of us – crash bandicoot 3 are all made by ND
        and they shit on any xbox have to offer

      • TheSoy

        I would say they are rated pretty accurately. The best first party dev Sony has and one of the best ones period.

      • Richard Attila

        In this moment Naughty Dog is the best studio in gaming industry,The Last of Us is the best game i ever played,and i play games from 30 years,i have a collection of more than 800 games.

      • Oscar Portillo

        No one is asking you kid.
        Hush it’s past your bedtime.

      • Jordan

        Overrated for while making every games that are GOTY the entire last gen. So that is overrated. But when people like you hype over something like TitanFall months ago before it even got release is not an overrated thing to do? That’s really lol right there

    • Demetre HG

      Dumbass Keep that garbagestation4 with framerate drops all your 2 exclusives bahahaha pathetic Get games and then talk oh Wait Titanfall leading on Xbox One bahahaha look at those crappy sales on infamous garbage 2 lmfao

      • You are flat out wrong

        You mean the framerate drops to single digits in Titanflop? The drops to 34fps in mechs?

        Kind of sad that the Xbone can’t run a last gen game on the ten year old Source engine any well, Demetre.

      • ImonadrugcalledCharlieSheen

        Now try it again in English, instead of that third world special needs child gibberish.

      • Bankai

        I wouldn’t be bragging about my system of choice having a 3rd party title as it’s most anticipated game of the year, while the PS4 has a first (Second Son), second (The Order: 1886) and third party title (take your pick) as it’s most anticipated titles of 2014.

        I also wouldn’t be bringing up framerates if my system of choice was forced to run a cross-gen titleat 792p and still couldn’t hold a steady framerate.

      • Wargreymon559 .

        Oh god you stupid xbots didn’t learn anything from last gen when Sony whooped M$ ass in the games department did you??Well be prepared cuz it’s gonna be deja vu again. http://postimg.org/image/8hiukow43/

    • LOL

      Like Killzone with multiplayer in 960×1080? Even Titanfall on Xbox One have better resolution 1408×792

  • Bankai

    I can only imagine what the geniuses over at Naughty Dog will bestow upon us next year, I can already tell that it’ll be magical.

    • shinitaru

      Hoping for a new IP, something Sci-Fi would be awesome

      • Bankai

        I’d like to see them do an RPG.

  • Nicholas Perry

    “more powerful than it’s necessary to render graphics at 1080p at 60 hz””

    Oh, well why don’t we see any games with awesome quality AA then? :|

    • Turbomite

      We’ll see them by Naughty Dog :)

    • shinitaru

      IDK, I didn’t see any jaggies in Killzone: Shadow Fall

    • benbenkr

      There is.
      You understand that statement is vague right? Rayman Legends runs at 1080p60 with AA applied. So there you go.

      They didn’t specifically say what type of game.

    • Mikeherp Derp

      On demanding next gen games like Witcher 3 you’re probably getting 1080p 30 fps at best. 1.84 teraflops is good but it won’t perform miracles.

      • Gannicus

        almost every card today even the onboard gfx in intel processors prolly even mobile chip in smartphone can output 1080p 60hz its not hard to do. Its how heavily the game is detailed that’s the problem aint it. It should be saying the hardware isn’t powerful enough to output 1080p 60hz on graphically heavy games but not very good to say that cus youll crush the fans dreams. I bet ND’s will be 1080p 30fps to, and if it is 60fps id do some heavy comparisons between infamous and the order and the witcher to see how demanding the graphics really are

        • Mikeherp Derp

          You probably need a R9 280 or 290 to output 1080p 60 on Witcher 3 at very high settings. Which are cards with 2-3 times the teraflop power.

          Anyone thinking PS4 will hit 1080p 60 with those kinds of demanding next gen games are kidding themselves.

          • Gannicus

            yep which is why the comment on “the GPU is more powerful than is necessary to render graphics at 1080p 60fps” is a ridiculous statement. a gfx card from 10 years ago could do it to but the gfx would be very very low, 2d side scroller prolly. I think you might need a 290 to do that with witcher 3 it depends how open the environment gets. If you standing on a mountain looking over a valley with 0 LOD scaling/texture downscaling its going to tank most stuff, 280x should be ok for the most part cant see it dropping below 30 in a similar scene though. Will have wait and see

          • Mikeherp Derp

            1080p 60 is an exaggeration I agree. Maybe if PS4 was 3.6 TF instead of 1.84. At half the teraflops they can probably pull 1080p 30.

          • Gannicus

            if the PS4 was 3.6Tflops it would be running alongside the 780Ti’s and 290x’s of the world with console optimisations I think consoles can generally get about 2x the performance than whats stated in terms of gpu power, depends how much extra cost it would be but 1. theres no way you can do an APU with say an Hawaii core on there cus its to big and then how much extra would it be. im thinking $150-200 for the chip, it might even be less pends how much GDDR5 is to manufacturers and all the other components that go into a board, then the PS4 would need about 2x the bandwidth, 2x more ROPs then CPU would need to faster think it would struggle at that speed even with low level optimistaion freeing the cpu and prolly need a full fledged cpu not a tablet one not sure what else it would need so guess the costs would go skyrocketing, probably so much that you may as well just go buy a PC and sony wouldn’t be able to market it to gamers without taking a significant loss on the console
            so that’s prolly why the consoles are how they are, behind in current generation of hardware performance prolly more bit higher than middle of the road and gap will only widen with successive years and especially Maxwell (750Ti aint far behind the PS4 atm) but pumping it decent visuals to clearly mark there is a gap between with gen and last to keep people happy. Unless sony/MS want to start taking significant losses on hardware for 4K gaming next gen they’ll have to wait for it to be possible on cheap hardware which is why I reckon 8 years isn’t a stretch for the next ones

          • C4

            It’s not ridiculous if you assume they are talking about modern engines and “AAA”-game worthy assets. Shaders, bandwidth and 32 ROPs are a good match for that resolution and framerate in my opinion, and more importantly have no obvious bottleneck. Much lower than that would be problematic if you ask me.

            Of course if they want to create awesome sceneries and characters ND might choose 30 fps in SP. In multiplayer 60 fps would be a possibility I think, the maps are more controllable, but of course you have to worry about performance when all 16 players or so are within 10 m². Maybe full dynamic resolution, LODs and other things is something we will see more in the future. Why drop the framerate when you can drop details on the fly. But it looks really hard to implement properly.

    • Bankai

      Developers haven’t had enough time with the hardware.

  • themuIe

    This, at a glance, it was makes (great) console game development trounce PC game development. Every. Single. Time.

    • shinitaru

      that’s because there’s no multi-billion dollar corporation invested in making PC gaming great. ND could make awesome PC games if they were paid to but that will never happen

      • themuIe

        I think it’s got more to do with optimizing for an specific closed architecture.

        • shinitaru

          Uh-huh because that always trumps pure processing muscle :p

          • themuIe

            You get my angle, don’t you? I mean, you can make a beast of a PC game, but you’re only going to get THE beast version of it on a few particular configurations (most powerful cards, etc). That’s great and everything, but not for all games, certainly not for all wallets.

          • shinitaru

            No, that’s what Direct X and OpenGL (and soon Mantle) are for. Sure, there will be some machines that run things better, but as far as visual fidelity, the software would see everything the same. Only difference would be framerate and that is what Minimum Spec Requirements are for. The only difference is that in PC’s as the system starts to show its age, you have to turn down some of the games features. In consoles as they start to show their age, the devs turn down those features for you

          • shinitaru

            Sorry, I should have said, “No, I don’t agree.” I didn’t mean to come across so rudely

  • Demetre HG

    Gaystation4 is available everywhere and Phonies are Posting articles that’s in not available FFS Ponies keep dreaming Uncharted 4 will come this year wait another 2 year for it with Powa of failstation 4 bahahhahaha

    • shinitaru

      You seem really, really bitter. Seems to me like you need to step away from it. You should stretch, take a deep breath, let it out slowly through your nose, then repeat these words, “I am a fanboy”

    • You are flat out wrong

      Those shortages are real, Demetre. You dumb pr*ck!

      By the way Towerfall – a 2D indie game – has a better metacritic score than Titanflop. What now?

    • ImonadrugcalledCharlieSheen

      Feel better now, a few more posts like that and you should just about have yourself convinced and all that buyers remorse you have should be gone.

    • shinitaru

      I know it wont happen this year, maybe not even next year. Who cares? There will be great games and other not so great to play between here and then. This is a launch year, this is as bad as it is ever going to get but I’m having fun anyway. Couple more weeks till Infamous SS too. What’s your problem? Did you get bored of Titanfall that quickly?

    • 3rdworldgamer

      finished playing Titanfall already?

    • Bankai

      The PS4 isn’t available much of anywhere right now, so the supply shortages are indeed real. That aside, you seem to be really regretting your Xbox One purchase and are now lashing out at the PS4 because you missed your chance to buy one.

    • WellWisher

      What are you doing here? What do you get out of trolling?

      • Mikeherp Derp

        Bored of titanfall already I guess.

        • Gannicus

          prolly… ya bored of not playing these amazing ps4 games yet to?

          • Mikeherp Derp

            Playing Dark Souls 2 on my PS3 actually. lol

          • Gannicus

            hahaha going last gen on the ps4 cus its more exciting?!!

          • Mikeherp Derp

            Would have got it for PS4 if it were available.

          • Gannicus

            the same game? why. its not going make it any better, well gfx will be but exactly the same story

      • Gannicus

        its fun to troll the PS4 threads, no point trolling the xbox threads cus they troll themselves just by being released as a game

    • Gamez Rule

      Bless Ya☺

    • superkarma

      “Gaystation”, “phonies”, “ponies”, and “failstation”…all in 1 laughable comment. Damn, bro…damn. Quite possibly the worst troll I’ve come across in quite some time. Very sloppy work, if I do say so myself.

    • Mikeherp Derp

      6 million to 3.5 million. Enough said?

    • DemonFenton

      Shouldn’t you be playing your Dusty Xbox One?

  • B00ME

    “Even in the PlayStation 4 you have 5 gigs,”

    I thought there was 6 gigs available to developers, the OS uses 3 gigs?

    • Cinnamon267

      Nope. Always was 5. Well, before the upgrade to 8GB.

      The amount of RAM the OS uses is unknown. But, much like MS, they would be locking some RAM away for possible features and services that may arrive in the future.

      • Jecht_Sin

        Actually from a virtual memory management system it would have made sense to reserve 4.5GB to the games, what it is needed by the OS and then to share the remaining RAM as virtual memory for both the OS and the game. With 500 MB of RAM used for the virtual memory reserved by the games, That might still be the case, it’s just that considering more RAM it can compromise the old games performances once the OS memory print will raise in the future.

        In other words considering 4.5GB + 0.5GB is the safest route.

    • ISISSecretAgent

      remember why the ps3 still lacks party chats and stuff? it is because the limited amount of memory the OS had to work with. Eventually they will free up space the more they optimize it

      it is easier to free up that space than the other way around because imagine a game was made with 5GB of ram in mind then suddenly sony decides to take 500MB for this feature they want to implement leaving the system with just 4.5GB of ram available obviously this will brake that said game in some way or the other.

      But if sony decides to shrink the OS or that it just doesnt need 500MB anymore the game made with 5GB of ram in mind wouldnt suffer for having 5.5GB instead.

      thats how i understand it lol

  • Mikeherp Derp

    The presentation once again hits home on the importance of GPGPU compute, something PS4 has a significant advantage in. Examples include Resogun’s voxels, Infamous’s particle system, and The Order’s cloth and destruction physics.

  • snOOziie

    Interesting the CPU stats were quite bad surprising”190 cycles”. I wouldn’t be bragging about those stats….. CPU split in two the latency of 26 cycles then latency of another hundred ninety plus and the latency of the RAM. wOw

    • Mikeherp Derp

      Both consoles have two 4 core Jaguars placed next to each other and called “8 core”. You could look at it as having two CPUs.

  • MrZweistein

    How is this exciting news? There was only one interesting thing which where the times for memory access cross CPU-core-cluster and memory access time for direct fetches from main memory. But the most interesting and important part is missing here: How are the cycles between GPU and Main Memory in different cases? This is common 1st or 2nd semester stuff if you study computer science … at least when I studied … Another interesting point: They used cycles as a measure for the time is needed to fetch the data. Without the exact knowledge of the actual frequency we cannot derive the real time for the fetch operations.

  • RealityCheck2013

    I didn’t understand any of that but i know the PS4 is AMAZING!!! :P :P :P

  • Marvin Deonte’ McClain

    Playstation=The best place to play!

    • Jecht_Sin

      And to develop too!!

  • Russell Gorall

    “As half of our staff leaves or is forced out, look at this other thing while we get some gag orders… ”

    About what I expect from them.

    • Jecht_Sin

      One must love the Xbots perception of proportions. 50% more is “slightly more powerful”, two people leaving is “half of the staff”. Now you are also going to tell us that $400 > $500. Oh.. wait. I’ve read even that one a couple of times!! lol

    • Mikeherp Derp

      Utterly delusional, wrong, and stupid fanboy.

  • GK15

    This is really interesting. I’m an Xbox gamer, but also a huge ND fan. Which is why I have my PS3, and why I’ll get a PS4.

    Can’t we just talk about how the PS4 is a great system without saying it will “make the Xbone look like dogsh*t”

    Both are great systems with a lot to offer.

  • Cahone2

    iono.

  • Oscar Portillo

    Just amagine an Uncharted game using the Sony’s VR headset.

    1080p goodness in a virtual world which only Naughty Dog & Sony can deliver.

Recent Comments

Powered by Disqus