Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
nairolf

Modern OpenGL vs Mantle? (from NVIDIA's talk at Steam Dev Days)

Recommended Posts

Posted · Original PosterOP

John McDonald (NVIDIA) dedicates the last 15 minutes of the Steam Dev Days talk "Beyond Porting: How Modern OpenGL can Radically Reduce Driver Overhead" to address the "need more draw calls per second" problem.

According to him this can be solved with modern OpenGL on current GPUs of the three major vendors.

No need to use new APIs like Mantle for that.

(He implicitly mentions Mantle in the beginning by saying "[More draw calls] is the motivation for an entirely new API. [...]")

Video

(should skip to 27:42 automatically)

The talk is quite technical but I'll try to summarize it in this post...

But first the results:

  • 5-30x increase in number of distinct objects per second
  • ~75% reduced interaction with driver (less CPU load/waste)
  • GPU can be affected negatively (although not too badly)
[Compared to the original OpenGL implementation and NOT to Direct3D. But as John said, OpenGL without these tricks is already better than Direct3D.]

Summary of the video:

PC developers are frustrated that console developers can get 5 to 20 times as many draw calls per second.

Direct3D is slow if you need to draw many objects, naive OpenGL is faster but by using a few of the newer OpenGL extensions you can improve that drastically.

They used API traces of a real-world application (Unreal Engine 4) and analyzed it to see how they can improve the code.

OpenGL function calls cause "state changes" inside the GPU. Think of the GPU as a factory with lots of machines that are all connected together.

Each of the machines can be configured to do something specific. Once everything is set up the factory will produce exactly that thing you specified it to produce.

The configuration of all machines is called the factory's state. If you want to change what the factory produces you have to change its state.

Different state changes have different costs because some machines are more difficult to reconfigure than others.

The following diagram shows how the different state changes compare to each other in terms of execution time:

HYh8KTV.png

Let's try to minimize the state changes as much as possible. The factory doesn't need to be reconfigured completely for each part that you produce. Many similar parts have almost the same production steps:

  • Use Sparse Bindless Textures to eliminate texture changes between draw calls (Place all your needed materials close to the machine that needs them instead of in a warehouse. Prepare everything you need before starting production.)
  • Pack many objects in an UBO, use persistent mappings, use ARB_shader_storage_buffer_object (Don't feed the machine parts individually. Give it a pile of stuff to work on.)
  • Use ARB_multi_draw_indirect to pack multiple draw calls together (Don't produce one thing and then have a meeting with all your machine operators to tell them what to do next. Plan ahead what the next N products will be and give a detailed list to all of the operators.)
Results of these optimizations:

Gh8jbGj.png

=> With modern OpenGL you can choose at run-time how you balance the workload on CPU and GPU

The following image shows the reduction in state changes (OpenGL function calls). Each square is a state change operation.

Each line is a draw operation and consists of up to 7 state change operations and one draw call.

Because of spacing there are 4 columns that should be seen as one big stream of draw operations (lines).

This is only a part of an even longer stream of draw operations so some state changes are not visible at all in this image (red and orange).

0VpnVp6.png

All of these OpenGL extensions are available on NVIDIA Kepler GPUs and some of them on Fermi.

All of them are also implemented by AMD and Intel "for a pretty reasonable fraction of hardware".

Here is a (hopefully complete) list of the used OpenGL extensions:

Sparse Textures (contributed by AMD, NVIDIA)

Bindless Textures (contributed by AMD)

UBOs (contributed by APPLE, NVIDIA)

Shader Storage Buffer Object (contributed by NVIDIA, AMD)

Persistent Mapping (contributed by NVIDIA)

Multi Draw Indirect (contributed by AMD)

My opinion:

If developers decide to move away from Direct3D, why not join the OpenGL club instead of Mantle?

OpenGL is vendor-independant, extensible, well tested and optimized and works on most platforms NOW.

Link to post
Share on other sites

AMD made it very clear that it wants Mantle to become the industry standard and has said on more than one occasion that it is open to the idea of handing over Mantle to an open source organization 'such as Khronos' for future development, once the API is out of beta is ready for prime time.

I would not be surprised if a future OpenGL version is in fact based on Mantle or at least in part inspired by it.

The issue with performance-enhancing extensions is that they're vendor specificity is defined by their developer which means that Nvidia, AMD Intel or whomever else can add OpenGL extensions which are only supported by their hardware.
And the game developer will have to pick and choose between which extensions to support and which to not. Which brings us back to the issue of adoption

That really doesn't solve anything that Mantle doesn't already address, since in its current form it is also vendor specific even though AMD is determined not to keep it that way for long.

I honestly don't think that we need to keep piling up new code on what is now a hopelessly outdated API base which was conceived two decades ago when graphics hardware was nothing like it is today. We need an API that is both modern & open to suit the graphics hardware available today and the hardware that is coming in the future, the sooner the better.

Whatever happens, the industry has to agree on a standard. We can't have both major graphics players stick to two different ideas to solve the same problem, because we know that one of those ideas has to fail. Which means that all the money, man hours & potential innovation associated with it would have also been wasted.

Link to post
Share on other sites

So this shows that any API is better than directX :P seriously now openGL is being a thing for quite some time now and I totally agree as to why would developers chose mantle when there is openGL already available and widely supported. If I understand this correctly its not the the same thing a Mantle but it eliminates the driver usage(like mantle) and is able to use the cpu more efficiently 


AMD FX 8320@ Stock - Asus M5A99X Evo R2.0 - Kingston HyperX 8GB 1600Mhz - Corsair Carbide 200R - Powercolor Radeon HD 7950 PCS+OC@970Mhz core 1400Mhz memory - Corsair CS650W - Samsung 840 EVO 250GB 
LG 22EA53VQ 21.5" - CM Storm Xornet - CM Storm Quickfire TK - Creative Inspire T3130 2.1

Link to post
Share on other sites

I've seen a lot of game developers prefer openGL over D3D for quite some time now.


i5 4670k @ 4.2GHz (Coolermaster Hyper 212 Evo); ASrock Z87 EXTREME4; 8GB Kingston HyperX Beast DDR3 RAM @ 2133MHz; Asus DirectCU GTX 560; Super Flower Golden King 550 Platinum PSU;1TB Seagate Barracuda;Corsair 200r case. 

Link to post
Share on other sites

GO NVIDIA


Spoiler

Corsair 400C- Intel i7 6700- Gigabyte Gaming 6- GTX 1080 Founders Ed. - Intel 530 120GB + 2xWD 1TB + Adata 610 256GB- 16GB 2400MHz G.Skill- Evga G2 650 PSU- Corsair H110- ASUS PB278Q- Dell u2412m- Logitech G710+ - Logitech g700 - Sennheiser PC350 SE/598se


Is it just me or is Grammar slowly becoming extinct on LTT? 

 

Link to post
Share on other sites

Time for me to brag a little bit.  Here is my post from more than 4 months ago:

 

http://linustechtips.com/main/topic/61261-downside-of-mantle/

 

The post goes on to say how Mantle can lead us down a path right back where we started.  But, the first part of my post applies more-so to this thread.  It states that OpenGL can already be used to enhance your games with the proper usage of OpenGL and proper usage of GL Extensions.

 

But anyway, I am just bragging because I know about this stuff, whereas most people in this forum are like "OMFG MANTLE ROXORS! 400% MOAR FPS" <-- 3 months before it even arrived.

Link to post
Share on other sites

The question that begs itself is that if indeed OpenGL can achieve what Mantle can.

#1 Why have flag-ship game engines like Frostbite 3, CryEngine (4) & Nitrous were the first to support Mantle ?
#2 The proof is in the pudding, people were shouting for months that Mantle was unproven and they didn't stop until it was. The same applies here, prove it.

Link to post
Share on other sites

#1 Why have flag-shipt game engines like Frostbite 3, CryEngine (4) & Nitrous were the first to hop on the Mantle band-wagon ?

Game_evolved_2.png


i5 4670k @ 4.2GHz (Coolermaster Hyper 212 Evo); ASrock Z87 EXTREME4; 8GB Kingston HyperX Beast DDR3 RAM @ 2133MHz; Asus DirectCU GTX 560; Super Flower Golden King 550 Platinum PSU;1TB Seagate Barracuda;Corsair 200r case. 

Link to post
Share on other sites

The question that begs itself is that if indeed OpenGL can achieve what Mantle can.

#1 Why have flag-ship game engines like Frostbite 3, CryEngine (4) & Nitrous were the first to support Mantle ?

 

Money


My PC CPU: 2600K@4.5GHz 1.3v Cooler: Noctua NH-U12P SE2 MB: ASUS Maximus IV RAM: Kingston 1600MHz 8GB & Corsair 1600MHz 16GB GPU: 780Ti Storage: Samsung 850 Evo 500GB SSD, Samsung 830 256GB SSD, Kingston 128GB SSD, WD Black 1TB,WD Green 1TB. PSU: Corsair AX850 Case: CM HAF X. Optical drive: LG Bluray burner  MacBook Pro, Hackintosh

Link to post
Share on other sites

Some people fail to realize that implementing vendor specific extensions for OpenGL is analogous to implementing Mantle.
The only issue here is that these efficient OpenGL extensions would still have to go through the garbage code remnants of piles upon piles of legacy OpenGL code.
It's like putting beautiful cake dressing on dog food. It looks better but it's still crap underneath.

For the industry to go forward we need a new API from the ground-up, one that contains absolutely no unnecessary or otherwise pointless legacy code.
Mantle is just that, it's no longer a question of whether we need or in fact can have a very efficient very advanced and very performant API, because the answer is yes to all three.

The actual question now is how to transform Mantle into an industry standard, this is obviously AMD's goal and Nvidia is resisting it.
I can't see a future where Nvidia welcomes their competitor's API with open arms, such a future does not exist.
What I see however is a future where an equivalently promising API, perhaps a direct or indirect derivative of Mantle is developed to become the next OpenGL.

In which case Nvidia and other GPU vendors for that matter have no choice but to support it because it is an industry standard.

Link to post
Share on other sites

Since we're talking about GL, Mantle and DX 11.2, would someone do a comparson on how good will those three improve game performance in general? Imagine having all three at once, PLAY ALL THE GAMEEEEES!!! Now running all three isn't possible, now a question pops up, what  API to use?

Link to post
Share on other sites

OpenGL is 22 years old, I think it's about time we adopt a new API from the ground-up.

Silicon based chips are even older. Isn't it time to be on those graphene CPU's already? Nope.


My PC CPU: 2600K@4.5GHz 1.3v Cooler: Noctua NH-U12P SE2 MB: ASUS Maximus IV RAM: Kingston 1600MHz 8GB & Corsair 1600MHz 16GB GPU: 780Ti Storage: Samsung 850 Evo 500GB SSD, Samsung 830 256GB SSD, Kingston 128GB SSD, WD Black 1TB,WD Green 1TB. PSU: Corsair AX850 Case: CM HAF X. Optical drive: LG Bluray burner  MacBook Pro, Hackintosh

Link to post
Share on other sites

Silicon based chips are even older. Isn't it time to be on those graphene CPU's already? Nope.

That's some convoluted logic you got there, what engineers were able to achieve with Silicone 22 years ago is nowhere near what they are able to achieve now.

 

Link to post
Share on other sites

That's some convoluted logic you got there, what engineers were able to achieve with Silicone 22 years ago is nowhere near what they are able to achieve now.

 

Open GL has come a long ways too. Just saying


My PC CPU: 2600K@4.5GHz 1.3v Cooler: Noctua NH-U12P SE2 MB: ASUS Maximus IV RAM: Kingston 1600MHz 8GB & Corsair 1600MHz 16GB GPU: 780Ti Storage: Samsung 850 Evo 500GB SSD, Samsung 830 256GB SSD, Kingston 128GB SSD, WD Black 1TB,WD Green 1TB. PSU: Corsair AX850 Case: CM HAF X. Optical drive: LG Bluray burner  MacBook Pro, Hackintosh

Link to post
Share on other sites

If you outgrow your sweater, do you cut it open, stretch it & patch it to make it bigger, or do you buy a new sweater... just sayin.

That's some convoluted logic. It's a lot harder to make a new CPU out of a new material than to buy a sweater. But I see where you're coming from.


My PC CPU: 2600K@4.5GHz 1.3v Cooler: Noctua NH-U12P SE2 MB: ASUS Maximus IV RAM: Kingston 1600MHz 8GB & Corsair 1600MHz 16GB GPU: 780Ti Storage: Samsung 850 Evo 500GB SSD, Samsung 830 256GB SSD, Kingston 128GB SSD, WD Black 1TB,WD Green 1TB. PSU: Corsair AX850 Case: CM HAF X. Optical drive: LG Bluray burner  MacBook Pro, Hackintosh

Link to post
Share on other sites

By that logic more games should support Nvidia's OpenGL extensions, since Nvidia has more money and is known to strong-arm developers.

 

Nvidia doesn't want its name on the buggy mess that is battlefield 4.


Like E-Sports? Check out the E-Sports forum for competitive click click pew pew

Like Anime? Check out Heaven Society the forums local Anime club

I was only living because it was too much trouble to die.

 

Link to post
Share on other sites

I've seen a lot of game developers prefer openGL over D3D for quite some time now.

 

Reason for that. Mac, Wii, PS4, mobile, linux, Steam OS = OpenGL. So they have to work with OpenGL anyways on ports. The only thing not OpenGL is Windows/Xbox. Many of the new up and coming people are doing mobile and that is OpenGL. Games like Angry Birds are OpenGL.

Many triple A games in the past were OpenGL.

 

http://en.wikipedia.org/wiki/List_of_OpenGL_programs

 

What happens when you talk about OpenGL, or question MS forcing OS upgrades through Direct X?

 

This happens. 

http://en.wikipedia.org/wiki/Astroturfing

 

MS is very good at it. 

 

http://antitrust.slated.org/www.iowaconsumercase.org/011607/3000/PX03096.pdf

 

Here are documents that surfaced in an antitrust case where MS laid out plans to do just that. MS "evangelists" as they call themselves have sets of rules, which involve getting control of people in media, and changing opinion through message boards. They also have plans of attack, such as questioning the mental abilities of people who disagree with them, associating people that don't use or like a product as being mentally deficient

 

How many times have you seen "only non tech savvy people hate Win8", "you are holding back technology", and on and on. This is nothing new. This is Microsoft. The funny thing is, their shenanigans have been shown in the court of law, they have been caught astroturfing and impersonating people that are dead when writing in letters to press, and their "evangelists" will tell you that you wear a tin foil hat when you talk about it.

 
Now as far as Mantle? OpenGL with extensions would be the same thing. AMD showed a slide (Mantle presentation) where they wanted Mantle on Linux, Mac OS. This would not be using DirectX shaders which Mantle does, this would be using OpenGL. AMD is a partner of the group that owns OpenGL along with Nvidia and Intel.
 

CPU:24/7-4770k @ 4.5ghz/4.0 cache @ 1.22V override, 1.776 VCCIN. MB: Z87-G41 PC Mate. Cooling: Hyper 212 evo push/pull. Ram: Gskill Ares 1600 CL9 @ 2133 1.56v 10-12-10-31-T1 150 TRFC. Case: HAF 912 stock fans (no LED crap). HD: Seagate Barracuda 1 TB. Display: Dell S2340M IPS. GPU: Sapphire Tri-x R9 290. PSU:CX600M OS: Win 7 64 bit/Mac OS X Mavericks, dual boot Hackintosh.

Link to post
Share on other sites
Posted · Original PosterOP

AMD made it very clear that it wants Mantle to become the industry standard and has said on more than one occasion that it is open to the idea of handing over Mantle to an open source organization 'such as Khronos' for future development, once the API is out of beta is ready for prime time.

They also said that if you use modern OpenGL you won't be bottle-necked by the API: https://twitter.com/grahamsellers/status/383242587609395201

The question is if Khronos (or a different org) wants to be responsible for Mantle. I mean why should they want to work on two competing open APIs at the same time?

Also, AMD repeatedly compares Mantle to Direct3D, not OpenGL. Mantle is supposed to kill DirectX.

 

I would not be surprised if a future OpenGL version is in fact based on Mantle or at least in part inspired by it.

For AMD's OpenGL drivers that is reasonable. For other companies probably not.

 

The issue with performance-enhancing extensions is that they're vendor specificity is defined by their developer which means that Nvidia, AMD Intel or whomever else can add OpenGL extensions which are only supported by their hardware.

And the game developer will have to pick and choose between which extensions to support and which to not. Which brings us back to the issue of adoption

That was an issue when OpenGL had a feature-driven release model. The committee delayed new API versions until there were enough new extensions that could get promoted into the standard. That lead to fragmentation because ATI/Nvidia/... didn't want to wait for years to get their new features in. So they did their own extensions so that developers could use them if they wanted. Nowadays OpenGL has a schedule-driven release model with two releases a year. So there is less reason to write their own extensions when they can get their stuff supported by an official OpenGL release in less then 6 months. More info

 

That really doesn't solve anything that Mantle doesn't already address, since in its current form it is also vendor specific even though AMD is determined not to keep it that way for long.

The thing that are mentioned in the talk are not at all vendor specific. Also they have fallback solutions and don't need to be used together. That's answered in the Q&A part at the end.

 

I honestly don't think that we need to keep piling up new code on what is now a hopelessly outdated API base which was conceived two decades ago when graphics hardware was nothing like it is today.

You mean the fixed function pipeline? That's gone for quite some time now. They keep removing old and slow stuff from the API since release 3.0 (where the change from feature-driven to schedule-driven happened).

 

We need an API that is both modern & open to suit the graphics hardware available today and the hardware that is coming in the future, the sooner the better.

modern? OpenGL (it says so in the title of the talk)

open? OpenGL

suits the graphics hardware available today? OpenGL

and in the future? OpenGL

Link to post
Share on other sites
Posted · Original PosterOP

The question that begs itself is that if indeed OpenGL can achieve what Mantle can.

#1 Why have flag-ship game engines like Frostbite 3, CryEngine (4) & Nitrous were the first to support Mantle ?

#2 The proof is in the pudding, people were shouting for months that Mantle was unproven and they didn't stop until it was. The same applies here, prove it.

#1 CryEngine also has an internal OpenGL port. I don't know about the others.

#2 Mantle is not available to the general public. So there is no way to compare them at the moment.

Link to post
Share on other sites

They also said that if you use modern OpenGL you won't be bottle-necked by the API: https://twitter.com/grahamsellers/status/383242587609395201

The question is if Khronos (or a different org) wants to be responsible for Mantle. I mean why should they want to work on two competing open APIs at the same time?

Also, AMD repeatedly compares Mantle to Direct3D, not OpenGL. Mantle is supposed to kill DirectX.

 

For AMD's OpenGL drivers that is reasonable. For other companies probably not.

 

That was an issue when OpenGL had a feature-driven release model. The committee delayed new API versions until there were enough new extensions that could get promoted into the standard. That lead to fragmentation because ATI/Nvidia/... didn't want to wait for years to get their new features in. So they did their own extensions so that developers could use them if they wanted. Nowadays OpenGL has a schedule-driven release model with two releases a year. So there is less reason to write their own extensions when they can get their stuff supported by an official OpenGL release in less then 6 months. More info

 

The thing that are mentioned in the talk are not at all vendor specific. Also they have fallback solutions and don't need to be used together. That's answered in the Q&A part at the end.

 

You mean the fixed function pipeline? That's gone for quite some time now. They keep removing old and slow stuff from the API since release 3.0 (where the change from feature-driven to schedule-driven happened).

 

modern? OpenGL (it says so in the title of the talk)

open? OpenGL

suits the graphics hardware available today? OpenGL

and in the future? OpenGL

I don't see Mantle & OpenGL as competing APIs, AMD cleverly avoids comparing Mantle to OpenGL & only focuses on D3D, primarily because D3D commands the most established games library but perhaps because Mantle is actually supposed to be the next OpenGL.

I can really see the next major iteration of OpenGL being entirely or partly based on Mantle.

You have to remember that AMD is a member of the Khronos group, I can't imagine why AMD would go through all the trouble of making an entirely new API if they could simply achieve the same results with OpenGL extensions, I don't buy it because it doesn't make sense.

 

Link to post
Share on other sites

#1 CryEngine also has an internal OpenGL port. I don't know about the others.

#2 Mantle is not available to the general public. So there is no way to compare them at the moment.

#1 This reaffirms the position that if indeed OpenGL can achieve what Mantle can, why would Crytek bother implementing both.

#2 That's not true there are many ways to illustrate performance advantages over DX or even Mantle through engine demos or even a code sample.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×