Author Topic: Game consoles, GPGPU...  (Read 6150 times)

Offline jknilinux

  • Bot Destroyer
  • ***
  • Posts: 468
    • View Profile
Game consoles, GPGPU...
« on: October 14, 2008, 11:43:25 PM »
Hi,

Will DB3 support running on game consoles, like the PS3, etc... ? Also, will it support GPGPUs and multiple cores? The potential speedups are enormous, of course, as game consoles and GPUs have turned into little supercomputers.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Game consoles, GPGPU...
« Reply #1 on: October 15, 2008, 02:12:34 AM »
Multiple cores and the XBox 360 will probably be supported.  Until the time PS3 let's you run .Net (probably sometime after Hell freezes over), we can support that, too

Darwinbots is not as embarrassingly parallel as some other problems, so multiple cores will only help up to a point.  Beyond that I think we'll need to fall back on the old trick of running multiple instances of the program.

Offline jknilinux

  • Bot Destroyer
  • ***
  • Posts: 468
    • View Profile
Game consoles, GPGPU...
« Reply #2 on: October 16, 2008, 12:50:49 AM »
Quote from: Numsgil
Multiple cores and the XBox 360 will probably be supported.  Until the time PS3 let's you run .Net (probably sometime after Hell freezes over), we can support that, too

Darwinbots is not as embarrassingly parallel as some other problems, so multiple cores will only help up to a point.  Beyond that I think we'll need to fall back on the old trick of running multiple instances of the program.

Is there some way for you to provide a C++/other language version, so we can run it on linux/PS3/OSX? A quick search for "C# to C++ converter" gave me this:

http://tangiblesoftwaresolutions.com/Produ...arp_Edition.htm

I'm sure there are free equivalents.
Then, you could use this:

http://rapidmind.com/product.php

or free equivalent, to make the C++ version of DB3 take full advantage of the Cell BE (PS3), GPGPUs, etc...


Or maybe, you could try to just make it compatible with current *nix C# compilers. That'd probably be easier.



Anyway, I think it would be a good investment to make it at least *nix compatible. I mean, most people here know more about computers than the average joe, and people who know more about computers than the average joe also tend to use *nix anyway. Also, for people with an old PC, it would be nice to be able to run DB on there and not run at an average of 500 cycles/day. Obviously, with something like puppy/DSL, this is easier than if you tried it with xp/2k.
« Last Edit: October 16, 2008, 04:34:54 AM by jknilinux »

Offline Cyberduke

  • Bot Builder
  • **
  • Posts: 88
    • View Profile
Game consoles, GPGPU...
« Reply #3 on: October 16, 2008, 03:23:24 AM »
Well Linux is a possibility but something to look at much later on IMO.

There was talk around the web of Mono.XNA but I don’t think that materialized? Might have another look later.
Other than that it would involve creating a second graphics module that used OpenGL rather than DirectX/XNA.

And at the moment I am considering using Microsoft live to build a p2p network rather than write my own (which I was quite looking forward to). This would mean that nobody had to worry about server uptime and bandwidth and both X-Box and Windows versions could see each other and share bots over the same network. (Still needs some more research)
I suspect I would need to write my own networking from scratch and use the windows peers as cross-over relays between the two networks to get the Linux peers online.

As far as multi-cores go, I can’t comment too much as I am not sure how numsqil intends on approaching it, but I as far as I can see there should be a fair amount of room to manoeuvre on that front and I assume it would have always an intention of any new re-write to multithread darwinbots due to the obvious performance benefits. Of course it would want to be multithreaded to make full use of the X-box too.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Game consoles, GPGPU...
« Reply #4 on: October 16, 2008, 02:12:45 PM »
C++ isn't going to happen.  C# isn't just a different language, it's based on an entirely suite of programming tools, which make my life as a developer worth living   I've done some programming in managed C++, and if it made a difference at all I could be convinced to do it that way, but the problem isn't the language it's the run time library, which is supported by Microsoft, which is a competitor to Sony and it's PS3.  So it's not in the best interests for Sony to support .NET on its platform.

There is Mono, to run .NET apps on linux and mac boxes, so it's possible one day that you might be able to get a .NET port for PS3, driven by the open source community, and then you could compiler and run Darwinbots on the PS3, but I wouldn't hold my breath   Darwinbots on linux is likely to happen first, but it depends on the quality of the Mono platform, and how well it simulates proper .NET, which isn't something we can control.  I don't have (nor want) a linux OS, so I can't test it.  If someone with linux and a mind for programming wants to grab the current code and try compiling it with Mono, and see if it still works, and maybe tweak things if they don't, I can get behind that.

Things like running bot DNA is highly parallel, so lots of worker threads is definitely feasible.  But at the end of the day you have to entirely finish cycle 1 before you can start cycle 2.  You have to entirely finish DNA before you can start physics, etc. etc.  Most games are like this.  It's extremely difficult to take significant advantage of more than a few cores for something like this, because the overall way that games work is serial.  Their internals might be able to be paralleled, but the internals fit together in a highly serial fashion.  But I'll try to put some thought towards multithreading in all the modules.  It's one of my priorities.  Just don't expect it to run 4x faster on a quad core over a single core.  I think to get that sort of benefit you need to run multiple instances and network them together.  That is a solution that can scale very well with the number of cores, especially when the networking doesn't block on the server like it does now with the VB DB.

Offline jknilinux

  • Bot Destroyer
  • ***
  • Posts: 468
    • View Profile
Game consoles, GPGPU...
« Reply #5 on: October 17, 2008, 02:31:39 PM »
Quote from: Numsgil
C++ isn't going to happen.  C# isn't just a different language, it's based on an entirely suite of programming tools, which make my life as a developer worth living   I've done some programming in managed C++, and if it made a difference at all I could be convinced to do it that way, but the problem isn't the language it's the run time library, which is supported by Microsoft, which is a competitor to Sony and it's PS3.  So it's not in the best interests for Sony to support .NET on its platform.

There is Mono, to run .NET apps on linux and mac boxes, so it's possible one day that you might be able to get a .NET port for PS3, driven by the open source community, and then you could compiler and run Darwinbots on the PS3, but I wouldn't hold my breath   Darwinbots on linux is likely to happen first, but it depends on the quality of the Mono platform, and how well it simulates proper .NET, which isn't something we can control.  I don't have (nor want) a linux OS, so I can't test it.  If someone with linux and a mind for programming wants to grab the current code and try compiling it with Mono, and see if it still works, and maybe tweak things if they don't, I can get behind that.

Things like running bot DNA is highly parallel, so lots of worker threads is definitely feasible.  But at the end of the day you have to entirely finish cycle 1 before you can start cycle 2.  You have to entirely finish DNA before you can start physics, etc. etc.  Most games are like this.  It's extremely difficult to take significant advantage of more than a few cores for something like this, because the overall way that games work is serial.  Their internals might be able to be paralleled, but the internals fit together in a highly serial fashion.  But I'll try to put some thought towards multithreading in all the modules.  It's one of my priorities.  Just don't expect it to run 4x faster on a quad core over a single core.  I think to get that sort of benefit you need to run multiple instances and network them together.  That is a solution that can scale very well with the number of cores, especially when the networking doesn't block on the server like it does now with the VB DB.

Then would you mind using Mono to develop it? See http://www.go-mono.com/mono-downloads/download.html

They have a windows version, and if you develop in mono then porting it to linux should be painless.



Or, if you don't want to switch, maybe you could try using this: http://www.mono-project.com/MoMA
To make sure the code works in *nix.

Thanks!

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
Game consoles, GPGPU...
« Reply #6 on: October 17, 2008, 04:40:15 PM »
If you lisened well enough to numsgil. He said he is not going to run linux. If you want to test it, you can grab the code and compile it youself to linux. Then you can say if it works. If you're a coder you can try and change a little to get it working if it doesn't.
I'm neather running linux. So I'm too not very interesting in trying, sorry.
Oh my god, who the hell cares.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Game consoles, GPGPU...
« Reply #7 on: October 17, 2008, 04:50:47 PM »
I can give the MoMA thing a go at some point probably.  But I don't want to develop strictly on the mono platform.  There's a reason Microsoft can charge money for what they do even when other people give away free versions

Offline jknilinux

  • Bot Destroyer
  • ***
  • Posts: 468
    • View Profile
Game consoles, GPGPU...
« Reply #8 on: October 17, 2008, 05:06:37 PM »
Quote from: Peter
If you lisened well enough to numsgil. He said he is not going to run linux. If you want to test it, you can grab the code and compile it youself to linux. Then you can say if it works. If you're a coder you can try and change a little to get it working if it doesn't.
I'm neather running linux. So I'm too not very interesting in trying, sorry.

I know he said he doesn't run linux.

I was suggesting he use the mono platform instead of whatever compiler he's currently using to ensure linux compatibility. Like I said, it works on Windows too. And, if his current compiler is better somehow, then maybe he could use the MoMa tester instead.

I was suggesting this to numsgil because it would be easier to just develop with the mono constrictions in mind than for someone who doesn't know anything about DB3 or C# (me) to debug it with mono on my linux box.

Numsgil-
If it would be too time-consuming, don't lose sleep over it. But since we'll be using DB3 for a while, I just think it's a good investment.

Offline Cyberduke

  • Bot Builder
  • **
  • Posts: 88
    • View Profile
Game consoles, GPGPU...
« Reply #9 on: October 18, 2008, 02:29:52 AM »
Well what’s currently in the SVN gets green ticks from MoMA but I think it really only checks for p/invokes and I already knew it wasn’t using any. I think that’s kind of pointless, really the only test is to try compiling it with mono.

I might put Linux back on my pc at some later point, I have run red hat followed by fedora core before and have been tempted to put ubuntu on. I don’t really want to keep checking it though; I say we get a releasable windows version first, rather than slow development doing both.

Since we are sticking with purely safe managed code for the sake of the X-Box anyway I think our Linux issues will be centred around the Graphics, UI and networking.
Though most likely is that the Linux version would need an OpenGL graphics module written for it to use. So it’s lucky that darwinbots isn’t graphically intensive and we are going for a highly modular approach or that would be a non-starter.
« Last Edit: October 18, 2008, 02:32:48 AM by Cyberduke »

Offline jknilinux

  • Bot Destroyer
  • ***
  • Posts: 468
    • View Profile
Game consoles, GPGPU...
« Reply #10 on: October 18, 2008, 03:26:42 AM »
Quote from: Cyberduke
Well what’s currently in the SVN gets green ticks from MoMA but I think it really only checks for p/invokes and I already knew it wasn’t using any. I think that’s kind of pointless, really the only test is to try compiling it with mono.

I might put Linux back on my pc at some later point, I have run red hat followed by fedora core before and have been tempted to put ubuntu on. I don’t really want to keep checking it though; I say we get a releasable windows version first, rather than slow development doing both.

Since we are sticking with purely safe managed code for the sake of the X-Box anyway I think our Linux issues will be centred around the Graphics, UI and networking.
Though most likely is that the Linux version would need an OpenGL graphics module written for it to use. So it’s lucky that darwinbots isn’t graphically intensive and we are going for a highly modular approach or that would be a non-starter.

Do you have a link to it? Thanks!

Offline Cyberduke

  • Bot Builder
  • **
  • Posts: 88
    • View Profile
Game consoles, GPGPU...
« Reply #11 on: October 18, 2008, 04:35:02 AM »
Quote from: jknilinux
Do you have a link to it? Thanks!
The SVN Repository?
https://svn2.hosted-projects.com/Numsgil/Darwinbots3

Offline jknilinux

  • Bot Destroyer
  • ***
  • Posts: 468
    • View Profile
Game consoles, GPGPU...
« Reply #12 on: October 18, 2008, 01:40:49 PM »
Yeah, that's it.

But, which option has the entire C# program so far? I heard that the only thing that has been worked on at all was the physics engine. But when I go to trunk/modules/physics, there's nothing there except for an empty folder named "Lodestone".

Offline Cyberduke

  • Bot Builder
  • **
  • Posts: 88
    • View Profile
Game consoles, GPGPU...
« Reply #13 on: October 18, 2008, 02:16:32 PM »
Trunk\ProjectFiles\XnaWinformsSolution contains the current Windows\XNA based solution, which will link to all the relevant .proj files, which in turn link to all the relevant .cs files.

The DNA module is not currently linked to the Windows\XNA solution, but it is in the repository, and whatever physics there might be are still on Numsgil's HDD.
« Last Edit: October 18, 2008, 02:17:41 PM by Cyberduke »

Offline Cyberduke

  • Bot Builder
  • **
  • Posts: 88
    • View Profile
Game consoles, GPGPU...
« Reply #14 on: October 18, 2008, 02:24:00 PM »
I am currently working on the peer to peer networking and I haven’t committed that to the repository yet either.