Multi-processor parallel programming in TGE
by Duncan Gray · in Torque Game Engine · 05/10/2007 (12:17 am) · 83 replies
I just tried running 4 threads on a single CPU and I did not get the above predicted clash in the assembly code.
In fact I get no problems at all.
Although I only adapted the updateSkin method for this test, this multiprocess approach can be used to increase performance in collission, physics, animation calculations, AI etc as well
If you want to try the demo, please post here or email me.
In fact I get no problems at all.
Although I only adapted the updateSkin method for this test, this multiprocess approach can be used to increase performance in collission, physics, animation calculations, AI etc as well
If you want to try the demo, please post here or email me.
About the author
#2
05/10/2007 (12:56 am)
Email sent to William
#3
05/10/2007 (1:13 pm)
Duncan, Ben Garney was doing some research on this a while ago. It may be worth sending him an e-mail as well.
#4
05/10/2007 (1:23 pm)
Duncan, sounds interesting can I get an email also
#5
The reason I'm asking for an email is just to control the download bandwidth. If I just post a link, 50 people will download and only 1 person will report back what their finding were
05/10/2007 (1:41 pm)
Email sent to Pat, Ben and MB6019.The reason I'm asking for an email is just to control the download bandwidth. If I just post a link, 50 people will download and only 1 person will report back what their finding were
#6
I'm very interested in the subject.
05/10/2007 (10:59 pm)
Duncan, I'd be glad to give it a whirl, too. I tried to email the address in your profile, but it bounced.I'm very interested in the subject.
#7
It crashed when I tried it with my poly and vehicle intensive game:
http://www.singularityfps.com/demo.php
I daresay there isn't a better test than my alpha. Tons of polys, and my vehicles are making the server quite busy, just sitting there.
This mirrors what happened when I tried to run the server dedicated on one core, and the client on the other--my performance went down. Obviously, there is more work to do! :-)
btw your exe crashed on my game out of the box. I'm going to try to isolate the problem, now.
05/10/2007 (11:41 pm)
I didn't see where I could do what you described, but I opened Stronghold.mis and got 95/96 on the first view, and 75/76 with your exe. E6600 core duo, nvidia 8800 gtx. There were trees in view...sorry...It crashed when I tried it with my poly and vehicle intensive game:
http://www.singularityfps.com/demo.php
I daresay there isn't a better test than my alpha. Tons of polys, and my vehicles are making the server quite busy, just sitting there.
This mirrors what happened when I tried to run the server dedicated on one core, and the client on the other--my performance went down. Obviously, there is more work to do! :-)
btw your exe crashed on my game out of the box. I'm going to try to isolate the problem, now.
#8
Yeah...in my "speical fps guaging spot" I get 20fps on this machine. It could really use some magic multi-cpu optimization.
05/10/2007 (11:47 pm)
It appears to be the interiors--perhaps any of them.Yeah...in my "speical fps guaging spot" I get 20fps on this machine. It could really use some magic multi-cpu optimization.
#9
Go into 3rd person mode and use the mouse to move the camera so that you are looking down on the player.
For starter.fps, I only modded the updateskin method which only affects player characters, so including building, water, trees will not show what effect the mod has made to your fps
05/11/2007 (12:03 am)
@Lee, please use the Barebones mission for fps compares.Go into 3rd person mode and use the mouse to move the camera so that you are looking down on the player.
For starter.fps, I only modded the updateskin method which only affects player characters, so including building, water, trees will not show what effect the mod has made to your fps
#10
~140 stock, hmmm 136-145 with your binary. ~137 with yours. It was hard to tell, both fluctuated quite a lot. I did it again, and waited untl the instant the other guy ran OFF the screen. Yours was generally a few fps lower, for sure. I did it a few times.
Not as strict a test as I would like with the AI running around.
And yeah, I knew I was being a little asinine trying it with my mission. What can I say, I was curious! :)
05/11/2007 (12:13 am)
Doh, my bad you did list the mission.~140 stock, hmmm 136-145 with your binary. ~137 with yours. It was hard to tell, both fluctuated quite a lot. I did it again, and waited untl the instant the other guy ran OFF the screen. Yours was generally a few fps lower, for sure. I did it a few times.
Not as strict a test as I would like with the AI running around.
And yeah, I knew I was being a little asinine trying it with my mission. What can I say, I was curious! :)
#11
05/11/2007 (12:25 am)
Can you check the top of your log file and see if it says it was using 2 CPU's?
#12
Parallel Processing Actvated on 2 CPU's
edit: no, it was the second line. hehe.
05/11/2007 (12:30 am)
1st line from the log:Parallel Processing Actvated on 2 CPU's
edit: no, it was the second line. hehe.
#13
(1) The system call I used to count CPU's sees the duel core as one CPU, or
(2) Windows found 2 CPU's but shedueled both my threads to run on the same CPU.
05/11/2007 (12:32 am)
I suspect that either:(1) The system call I used to count CPU's sees the duel core as one CPU, or
(2) Windows found 2 CPU's but shedueled both my threads to run on the same CPU.
#14
05/11/2007 (12:34 am)
OK, that makes it option 2 then..... I need a dual core to figure this out ( goes out to buy lottery ticket)
#15
Or heck, on my Windows box. But with my cruddy upstream bandwidth, a terminal session would drag badly.
05/11/2007 (12:37 am)
If you can work on Linux, I'd be glad to give you an account on my machine to work with.Or heck, on my Windows box. But with my cruddy upstream bandwidth, a terminal session would drag badly.
#16
Perhaps some other people will have better luck on their particular hardware.
05/11/2007 (12:47 am)
Thanks for the offer, I can do Linux but the lag would kill me, so I'll think on this some more. Perhaps some other people will have better luck on their particular hardware.
#17
Just wondering if you would uncover the detail how you do this in the near future?
Steven
05/11/2007 (12:54 am)
@Duncan:Just wondering if you would uncover the detail how you do this in the near future?
Steven
#18
I rechecked the vague data regarding the threadaffinitymask and made a change which should hopefully now let the threads run on separate cores. Who know what the Windows scheduller will really do with it.
Can you re-download and try again :)
@Steven... probably eventually, when I get it working properly.
05/11/2007 (1:11 am)
@Lee, last attempt for now. I rechecked the vague data regarding the threadaffinitymask and made a change which should hopefully now let the threads run on separate cores. Who know what the Windows scheduller will really do with it.
Can you re-download and try again :)
@Steven... probably eventually, when I get it working properly.
#19
05/11/2007 (2:09 am)
My email is currently not working by the look of things, I may have missed a few emails.
Torque Owner William Todd Scott
I would be very interested in seeing your approach to threading the skin code.