Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (481)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (548)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2
  ignore  |  Print  
  AMD has revealed an API that gives developers direct access to GPUs using ...  (Read 5538 times)
0 Members and 1 Guest are viewing this topic.
Offline Andre Lopes
« Posted 2013-09-28 03:57:00 »

AMD has revealed an API that gives developers direct access to GPUs using the GCN architecture.


Now that AMD is powering all four major gaming platforms – namely the Wii U, Xbox One, PlayStation 4 and PC – the company has finally revealed its secret weapon to bind these platforms together: the low-level high-performance "Mantle" graphics API. This will allow developers to "speak the native language" of AMD's Graphics Core Next architecture used in modern AMD-based graphics cards and APUs.

"http://www.tomshardware.com/news/amd-mantle-api-gcn-battlefield-4,24418.html"

Offline Andre Lopes
« Reply #1 - Posted 2013-09-28 03:57:29 »

What does that means for us? Java programmers...
Offline Jeremy
« Reply #2 - Posted 2013-09-28 04:00:46 »

What does that means for us? Java programmers...

I thought this might've had something to do with GPU acceleration that they're intending to add to Java.

I'm too busy to compare the two articles, but for anyone interested:
http://www.computerweekly.com/news/2240206233/Executive-interview-The-significance-of-the-GPU-accelerated-Java

JevaEngine, Latest Playthrough (This demo is networked with a centralized server model)

http://www.youtube.com/watch?v=rWA8bajpVXg
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline xsvenson
« Reply #3 - Posted 2013-09-28 10:18:00 »

Mu question is, how will it affect OpenGL and the future of the APIs. Could it not have been abstracted under OpenGL ?
Or maybe the cgn supported cards actually have their implementation on top of mantle but having access to the raw mantle gives additional benefits.

The information is kinda lacking or I just don't see it.

“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Offline Spasi
« Reply #4 - Posted 2013-09-28 13:21:39 »

Mantle is mostly targeted at titles that will be deployed on both next-gen consoles and PC. Console developers take advantage of the direct hardware access they enjoy on those platforms and both PS4 and Xbox One have AMD hardware under the hood. Mantle will enable the reuse of the same optimized paths on the PC. Everyone else will also be able to use it of course, but I'm not sure many will.

Both OpenGL and Direct3D need a lot more work to enable low-level access to the GPU and, in any case, abstracting over the hardware differences will be hard and probably not as optimal as a proprietary API. But we'll definitely see more work in that direction for both APIs and the gap will close.

As for Java, Mantle will be just another API to bind with JNI to. But you need to keep in mind that this will not be just another set of function pointers that, by calling them, magically increase your draw calls per second. Instead of handles, there will probably be a lot of direct pointers to GPU-specific data structures and misc buffers and it's going to be awkward to work with in Java. The power will be great; better reuse of buffers for reduced memory/bandwidth pressure and you'll be able to do novel things that enable new algorithms and effects. It's just going to be horribly unnatural and unsafe to use from Java. There's also been some info during JavaOne that the sun.* package will be inaccessible in Java 9 with Jigsaw modularization. Not sure what that means exactly yet, but it's scary to think how we're going to be able to deal with all that without sun.misc.Unsafe.

Anyway, AMD is obviously taking full advantage of the unique opportunity it has with so much hardware being deployed with its GCN architecture underneath. As much as I don't appreciate proprietary APIs (see CUDA), this is a decent step towards moving the PC to the living room, which I really want to see happening. Imagine a Mantle optimized game running on SteamOS; direct GPU access on top a very lightweight platform that minimizes kernel - user space context switches. The efficiency will be awfully close to that of a console and it'd still be an open(-ish) platform.
Offline gouessej
« Reply #5 - Posted 2013-10-07 20:00:29 »

There's also been some info during JavaOne that the sun.* package will be inaccessible in Java 9 with Jigsaw modularization. Not sure what that means exactly yet, but it's scary to think how we're going to be able to deal with all that without sun.misc.Unsafe.
I'm a bit worried. Sun and Oracle already refused several times to provide a public API to release the native memory reserved by direct NIO buffers, they are almost unusable in performance-critical code without a mean to trigger their "destruction".

Offline kappa
« League of Dukes »

JGO Kernel


Medals: 76
Projects: 15


★★★★★


« Reply #6 - Posted 2013-10-07 20:39:32 »

AMD are also adding new high performance OpenGL extensions as explained here.
Offline Spasi
« Reply #7 - Posted 2013-10-07 22:38:41 »

There's also been some info during JavaOne that the sun.* package will be inaccessible in Java 9 with Jigsaw modularization. Not sure what that means exactly yet, but it's scary to think how we're going to be able to deal with all that without sun.misc.Unsafe.
I'm a bit worried. Sun and Oracle already refused several times to provide a public API to release the native memory reserved by direct NIO buffers, they are almost unusable in performance-critical code without a mean to trigger their "destruction".

Sorry, I forgot to follow-up on this. There's been additional info on Unsafe specifically. It's going to be cleaned-up and move into the official JDK in Java 9. It's obviously too popular to kill.

I'm not sure what kind of trouble you're having with buffer deallocation. Have you tried using a large buffer as a memory pool and using .slice()d buffers out of it? Also, direct buffers are simple wrappers around Unsafe.allocateMemory() and Unsafe.freeMemory(). Why not use those directly and construct the ByteBuffer instances out of the pointer .allocateMemory() returns?
Offline princec

JGO Kernel


Medals: 362
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #8 - Posted 2013-10-08 09:36:38 »

As I understand it there are moves to getting "structs" into Java at some point, so there's hope it'll be useful for someone yet. Of course the idea of writing to the metal (and indeed, only AMD's metal, at that), is kinda useless to most people who aren't building bespoke hardware and software solutions. Even a console writer would be loathe to bother because it means a lot of extra effort for a minimal performance gain and then having to ignore it all anyway when the inevitable PC port (read: Steambox) comes along.

Cas Smiley

Offline gouessej
« Reply #9 - Posted 2013-10-08 10:41:08 »

There's also been some info during JavaOne that the sun.* package will be inaccessible in Java 9 with Jigsaw modularization. Not sure what that means exactly yet, but it's scary to think how we're going to be able to deal with all that without sun.misc.Unsafe.
I'm a bit worried. Sun and Oracle already refused several times to provide a public API to release the native memory reserved by direct NIO buffers, they are almost unusable in performance-critical code without a mean to trigger their "destruction".

Sorry, I forgot to follow-up on this. There's been additional info on Unsafe specifically. It's going to be cleaned-up and move into the official JDK in Java 9. It's obviously too popular to kill.
Thanks. I feel better now. Where can I get some more information about those public APIs? We'll have to use different code paths depending on the Java version but as long as it works, it's ok for me.

I'm not sure what kind of trouble you're having with buffer deallocation. Have you tried using a large buffer as a memory pool and using .slice()d buffers out of it? Also, direct buffers are simple wrappers around Unsafe.allocateMemory() and Unsafe.freeMemory(). Why not use those directly and construct the ByteBuffer instances out of the pointer .allocateMemory() returns?
In some cases, it is difficult to plan how much native memory I'm going to use when launching my applications, I can vaguely estimate that but my own code isn't the only one to use the native heap. I often use the direct NIO buffers obtained from the public API and I use Oracle/Sun/Apache proprietary API only to destroy them. Most of the direct NIO buffers that I use are created by third party libraries, I can override a mechanism to get them and destroy them quite easily but using Unsafe.allocateMemory would require some modifications of the architecture and some maintainers don't want to expose any API to release the native memory (it has been a source of debates for JMonkeyEngine 3 and I handle that in my own code for Ardor3D).

AMD are also adding new high performance OpenGL extensions as explained here.
This might be interesting  Grin

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Sindisil
« Reply #10 - Posted 2013-10-08 12:53:05 »

I don't think there *are* any details yet. Just tyus morning I came across this link in /r/java:

http://mail.openjdk.java.net/pipermail/discuss/2013-October/003162.html
Offline Spasi
« Reply #11 - Posted 2013-11-14 20:17:48 »

Yesterday's presentation: AMD Mantle Technical Deep Dive. There were two more but those are not available publicly yet. No code was shown either, but it's still a nice abstraction layer above the hardware; it won't be much more code than using OpenGL. Highlights:

- Multi-vendor and multi-platform. Obviously it'll start as AMD and Windows 7/8 only, but it's not tied to any of that. They're hoping it will become an industry standard.
- It completely eliminates CPU bottlenecks. An FX8350 underclocked to 2GHz can drive an R9 290X with no loss in frame rate. They claim a FX8350 is just as fast as an i7-4770K.
- They're targeting 100k draw calls (compared to the 3k-10k cap today). RTS games with 3000 units on screen, 25000 discrete objects simulating and moving.
- Explicit multi-threading. Basically your application's threads are the rendering threads, there's no threading at the driver level. This is a huge deal considering Java's concurrency features.
- Multiple threads, driving multiple command queues, executing on multiple GPUs. Full application-level control, multi-GPUs will be able to get to 90%+ scaling. Can do AFR, SFR or your own custom scheme.
- GPU page table remapping exposed. Used to implement AMD's Partial Resident Textures, can now be used however you like.
- Generalized resources, everything is either "memory" or "texture". Usage hints are gone (and so is driver behavior unpredictability as a result), you now explicitly tell the driver how you're using a resource and when that usage changes. The driver then handles low-level details like flushing, compression/decompression, etc. When you do have to stall, you can control when it happens and that it happens only once.
- New binding model that's as flexible as bindless, but without complicating the shaders.
- Monolithic pipelines. You build (almost) all state in advance, binding is done without validation. Some state is left out of pipelines, to avoid combinatorial explosion (they profiled existing engines to determine which state should be left out).
- Pipeline serialization, which includes pre-compiled shader code, for low start-up times.
Offline lcass
« Reply #12 - Posted 2013-11-14 20:22:19 »

I use and prefer nvidia so do half of the market so having it implemented into major online games would cause large issues on pcs without AMD technology.
Offline Spasi
« Reply #13 - Posted 2013-11-14 21:10:00 »

It's a valid concern, but I think you missed the first point in my post:

Quote
Multi-vendor and multi-platform. Obviously it'll start as AMD and Windows 7/8 only, but it's not tied to any of that. They're hoping it will become an industry standard.

I intentionally mentioned it before everything else. It's very important that both AMD's Mantle and Nvidia's G-Sync are to be open (or at least licenseable) and eventually become industry standards. Unlike, say, Nvidia's CUDA and PhysX.
Offline Danny02
« Reply #14 - Posted 2013-11-14 22:46:24 »

Do you know how one programs the GPU with Mantel, GLSL or something new?
What is with all the low level rasterization stuff(stencil, depth, blending ...) just a copy from OpenGL or something new?
Offline Spasi
« Reply #15 - Posted 2013-11-15 00:56:44 »

Do you know how one programs the GPU with Mantel, GLSL or something new?

They did not say (unless I missed something). I don't think it's going to be something new though. I did read something about HLSL last month and they should easily provide GLSL extensions if necessary. Also, @grahamsellers mentioned OpenGL extensions that will provide Mantle-like functionality & performance.

What is with all the low level rasterization stuff(stencil, depth, blending ...) just a copy from OpenGL or something new?

Yes, such standard GPU features are identical across all APIs. Depth-testing and blending were actually mentioned in the presentation as two pieces of state that are not included in the monolithic pipelines.
Offline Spasi
« Reply #16 - Posted 2013-11-15 13:16:22 »

More details in these slides: Mantle for Developers (Frostbite, DICE)

edit: more slides: How Mantle Changes the Game (Nitrous, Oxide)
Offline Spasi
« Reply #17 - Posted 2013-11-17 01:13:28 »

Q&A with developers, very interesting stuff.

Info from past couple of days: There is a validation layer on top of Mantle which is "indeed extremely important and very valuable. also makes it significantly easier than on PS4" according to DICE. Seems AMD is taking profiling, debugging and integration with other tools (e.g. PerfStudio) very seriously.
Offline lcass
« Reply #18 - Posted 2013-11-17 10:46:55 »

Issue is though they could use different apis and could have bugs with individual processes meaning the languages would be different on both.
Offline opiop65

JGO Kernel


Medals: 154
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #19 - Posted 2013-11-17 13:29:41 »

Issue is though they could use different apis and could have bugs with individual processes meaning the languages would be different on both.
You do know that all those systems don't use the same language, correct?

Offline theagentd
« Reply #20 - Posted 2013-11-17 16:46:52 »

I used to be extremely skeptical to Mantle since I thought Nvidia wouldn't be able to implement it. If Mantle failed it'd be a loss for AMD which could increase Nvidia's market share killing competition, and if it succeeded it'd split up PC between Nvidia and AMD since in that case Nvidia and Intel might make their own Mantle-like API. If Nvidia actually swallows their stupid pride and  makes a Mantle driver (assuming they can) I would definitely start using it immediately. Multithreaded rendering? Precompiled pipelines? Much more flexible state? Just to mention a few? Sign me the f*ck up.

Does anyone have a clue on how hard it'd be to create a Java binding?

Myomyomyo.
Offline Spasi
« Reply #21 - Posted 2013-11-17 17:10:26 »

Without having seen any code, I'm sure I'll add it to LWJGL the same day it's out. Interestingly, we might have to start worrying about JNI. It's only noise with OpenGL, but if we're moving to 100k-1M draw calls per frame, JNI overhead could easily add up to a few milliseconds. An FFI mechanism would be nice in Java 9...

I think a multi-vendor, multi-platform Mantle would be a great opportunity for Linux to directly compete with Windows as a gaming platform. I also can't wait for lightweight drivers vs the 200+ MB monstrosities we have to download now every couple of weeks.
Offline theagentd
« Reply #22 - Posted 2013-11-17 19:24:05 »

Without having seen any code, I'm sure I'll add it to LWJGL the same day it's out.
Damn. Have a medal, good sir.

Myomyomyo.
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 76
Projects: 15


★★★★★


« Reply #23 - Posted 2013-11-18 10:27:01 »

Biggest hurdle for Mantle is going to be getting Nvidia, Intel and Apple to support it, without that not sure its going to have widespread enough appeal. For that to happen it'll need to be an open standard and AMD will have to give up its exclusively control on the API probably to a party like Khronos.

Having said that, AMD is in a pretty strong position atm as their chips are used in all the next gen consoles (PS4, XB1 & WiiU) and in about 1/3 of the gaming PC's out there. Therefore it could become pretty common as the code is suppose to be shareable across hardware.
Offline QQQ

Senior Newbie


Medals: 1



« Reply #24 - Posted 2013-11-27 14:22:24 »

What does that means for us? Java programmers...
Read this article: Tech Giants [...] Join the HSA Foundation

HSA seems to be an architecture (or concept?), that allows CPU and GPU to access the same adress space, i.e. passing pointers instead of copying data, and other stuff. The new AMD third generation APU (Kaveri) A10-7850K will have this. Kaveri will include AMD’s Mantle API [2].

The article above says that many companies, including Oracle, are members of the HSA Foundation. It says also, by joining HSA Foundation Oracle strives for better utilization of the GPU with Java.

Other interesting things:
[1] Java 8 Sumatra processing demo (Sumatra is an OpenJDK Project to allow to take advantage of GPUs and APUs)
[2] a biased article with more details about the APUs (read also comments of user Ken Luskin for more background info)

edit: Oh, I see there is already a thread about HSA+Java.
Offline lcass
« Reply #25 - Posted 2013-12-07 22:22:33 »

Nvidia and java have announced they will be allowing speed boosts using the gpu , this involves even array scanning functions with up to 48* performance on some tasks.
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 76
Projects: 15


★★★★★


« Reply #26 - Posted 2013-12-08 12:04:36 »

Nvidia and java have announced they will be allowing speed boosts using the gpu , this involves even array scanning functions with up to 48* performance on some tasks.
Missed that but seems like its acceleration is done using Nvidia's CUDA library.

Its not clear from the links I've found whether it'll be automatic behind the scene acceleration, like what AMD is working on for Java 9 (using OpenCL), or whether its just a simple binding to Nvidia's CUDA libraries which developers will have to work with directly, since the articles states Java 8 then i'm assuming its probably just a binding to CUDA.

Link 1 and Link 2.
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 76
Projects: 15


★★★★★


« Reply #27 - Posted 2013-12-19 17:09:59 »

Noticed the following new video presentation in relation to Mantle:<a href="http://www.youtube.com/v/QIWyf8Hyjbg" target="_blank">http://www.youtube.com/v/QIWyf8Hyjbg</a>
Quote
Things to note:

    Not difficult nor expensive to add Mantle support on modern engines (probably expect all of the major ones to have it, and maybe even nvidia could use it, it seems that the decision to use it or not is still up to nvidia).

    It's in alpha stage, they have not fully optimized Mantle yet and they are already hitting GPU bottlenecks instead of CPU, but there is still much room for optimization. Underclocked to 2GHz, the FX-8350 was still GPU bottlenecked with R9 290X. They have not even looked much at GPU performance yet, just CPU, and there are already amazing gains.

    Support to fully utilize CPU cores means FX-8350 is comparable to power to an i7 4770K. High-end CPUs not needed to support high-end GPUs. Everything scales amazingly well with more cores.

    Frame rate jumped up to x3 when changed from Direct3D (DirectX) to (alpha) Mantle. The tech demo shown is supposed to come out on Q1 2014 and will be moddable. It looks damn pretty (starts at min 25 in the video).

    Future: GPU might be used as a co-processor even for non multimedia applications.

source
Offline jmguillemette
« Reply #28 - Posted 2013-12-20 01:41:18 »

very interesting vid.

now will we be able to use this while leveraging java..  Smiley oh i hope so....

-=Like a post.. give the author a medal!=-
Offline theagentd
« Reply #29 - Posted 2014-01-01 00:27:11 »

Merry Christmas and a happy new year! Please accept this present from me and my fellow Swedes!

Myomyomyo.
Pages: [1] 2
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

atombrot (26 views)
2014-08-19 09:29:53

Tekkerue (24 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (14 views)
2014-08-16 06:20:21

Tekkerue (22 views)
2014-08-16 06:12:11

Rayexar (60 views)
2014-08-11 02:49:23

BurntPizza (38 views)
2014-08-09 21:09:32

BurntPizza (30 views)
2014-08-08 02:01:56

Norakomi (37 views)
2014-08-06 19:49:38

BurntPizza (67 views)
2014-08-03 02:57:17
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!