• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

PhysX: 1 thread @ 100% cpu usage.

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

Zantal

Member
Joined
Mar 19, 2009
Ok, first time posting here =)
i'll be as brief as i can.

Me and some of my friends wanted to make a pc game, using Ogre3D and PhysX.

We managed to get them working but there are 2 huge problems.

First i noticed that the program would use 100% cpu of 1 thread (it's 13-12% all the time on my i7) making the camera movement choppy. adding vsync didn't help. there is not much going on in the game as of yet, and even when it will be completed it won't be a very demanding game.

at the moment it just renders 1 flat area and 20-30 PhysX cubes.
I just don't know how to see what is causing the problem, and we can't afford those high priced visual studios or whatever to decently debug the program.

The second problem is that PhysX won't run on the gpu, no matter what we do.
We have all checked that the flags were set up correctly for gpu use, but with no results. I don't know if this problem is related to the first one but i am really out of ideas and my task now is to fix all the major bugs i encounter.

If someone is willing to help us i will share our project with him, and if the game really takes off as we want him to you will get a free copy of it as a sign of gratitude from all of us =)

it's our first game but we really want to finish it.

thanks in advance whoever gives a shot =)
 
i am getting mad at trying to figure this out.

and there's nothing on physx forums. i foresee a complete physx init rewrite =(
(thanks for bumping this)
 
Just a suggestion you may have tried already: Has PhysX been forced to use the video card only in the driver settings? With the latest drivers (under Windows), PhysX can be set to Auto (use GPU or CPU), CPU, or GPU only.
 
I already checked that out. was first thing tbh. physx will have to run on cpu if there is no physx on the pc.

funny thing i couldn't get the sdk samples to work on gpu either. none of us did
makes me sad . . .
Anyway major problem is 100% cpu usage atm. the gpu thing is a bonus.
 
If you looking at going commercial with this I would suggest getting a good, legal, environment setup. Drop the cash and get Visual Studio or the likes. The plugins and addons will be much better than what you can get with a cheaper solution.

As for your cpu usage I'm going to assume that its only at 100% because the game loop isn't getting the graphics pushed off to the gpu and thus it has to do it all itself. Since it was supposed to be pushed over to the gpu, it isn't multi-threaded and is eating up just the single core instead of being spread across all available cores. I think as soon as you can get it to properly offset the PhysX to the gpu your cpu usage will drop back down to the levels you are expecting.

I have no experience with PhysX itself, so I can only ask the basic questions (ones you probably already asked yourself)... Did you initialize your PhysX object(s) properly? Are you setting you graphics objects to be rendered by your PhysX object?
 
If you looking at going commercial with this I would suggest getting a good, legal, environment setup. Drop the cash and get Visual Studio or the likes. The plugins and addons will be much better than what you can get with a cheaper solution.
no money at all at the moment.
As for your cpu usage I'm going to assume that its only at 100% because the game loop isn't getting the graphics pushed off to the gpu and thus it has to do it all itself. Since it was supposed to be pushed over to the gpu, it isn't multi-threaded and is eating up just the single core instead of being spread across all available cores. I think as soon as you can get it to properly offset the PhysX to the gpu your cpu usage will drop back down to the levels you are expecting.
i do not get this. the game loop isn't getting the graphics push over to the gpu? if you could see our game as it is now (like pre pre alpha) you would say 100% cpu is too much. there is just a round platform where the cubes collide. they spawn from above. and you can move a sphere. that's it
we are setting up the tools now. actual game making will come at a later stage =)
anyway. physx must run on the cpu.
on physx we have only gravity and collisions on. + adding force to objects.
nothing intensive. it should run ok on cpu only.
I have no experience with PhysX itself, so I can only ask the basic questions (ones you probably already asked yourself)... Did you initialize your PhysX object(s) properly? Are you setting you graphics objects to be rendered by your PhysX object?
I was not the one who did the physx stuff. i should get them to check it. although atm i have no work to do. so focusing only on solving this bug.
 
anyway. physx must run on the cpu.
on physx we have only gravity and collisions on. + adding force to objects.
nothing intensive. it should run ok on cpu only.

I think you should take a more open minded approach - if you dismiss possibilities, you overlook things. Seeing as how the game isn't working as you expect it to right now, something was overlooked. :eh?:

We don't really have any of the necessary information to troubleshoot this for you. If you have any method to log or export what is currently being crunched that would help, otherwise you need to start eliminating components to the game until you see what makes performance go back to normal - then you know which part of the code to look closer at.

If you take out the spheres and just have the basic environment, and there is no problem, then you know its something to do with rendering the spheres and you can look at that part of code. That would get you past the point you are at now, and it would be more productive.
 
i think i'll do that. thanks.

Shouldn't be too difficult.
I mainly asked here to see if anyone has ever encountered such a behaviour.
 
i do not get this. the game loop isn't getting the graphics push over to the gpu? if you could see our game as it is now (like pre pre alpha) you would say 100% cpu is too much. there is just a round platform where the cubes collide. they spawn from above. and you can move a sphere. that's it
we are setting up the tools now. actual game making will come at a later stage =)

Yes the 100% for something so simple IS too much. A gpu is much better at doing the kind of logic that is needed to do graphic rendering than the cpu. It seems like all the rendering of where your graphics objects are in your space is being done on the cpu instead of the gpu. By pushing I simply meant the gpu was doing all that logic for you and not your cpu. If it isn't getting done on the gpu that would explain why you have such high usage of the cpu. Yes PhysX stuff can run on a cpu, but its a HUGE difference to properly run it on a PhysX enabled gpu. You by any chance wouldn't happen to be running on an AMD or older NVidia graphics card on the development machine are you?
 
the development machine is the one in my sig.
today i tried to run the app without updating physx to see what happens.

cpu usage 100%, but i should try to remove it completely instead of just remove the call to the update function. will try later i have else to do now =)
 
Back