2 FPS with Newton

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

2 FPS with Newton

Postby carli2 » Mon Aug 27, 2012 12:54 pm

Hi,

When I have lots of objects at one place, newton gets really slow.
I get only 2 FPS and 70% of the total CPU time is spent to dgJacobianMemory::CalculateForcesSimulationMode(float) const
The bodies don't move any more, but they still consume CPU time.
Image

And btw. I use the latest core_200 before you deleted them and you know the reasons. (no trigger volumes, compilation breaks every day, no CMake or working makefiles)
carli2
 
Posts: 157
Joined: Thu Nov 10, 2011 1:53 pm

Re: 2 FPS with Newton

Postby Julio Jerez » Mon Aug 27, 2012 2:20 pm

you need to se the arch mode to 3
I do not rememver the function in core 200, but the defulet solver mode is to calcuate exact solution.
This is only good for people doing realistic simulations where they need the correct reaction forces.
But the solver is much slower.

also this is why you need to switch to core 300, do not keep switching forth and back.
how many bodies?

I said that I will do the triggers, but I need to have those collision function working with zero error 100% of the time.
There are not there yet.
It is not just having then working, is having the working very fast for all shapes, no special cases like core 200 did.
this is a much harder problem.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: 2 FPS with Newton

Postby Julio Jerez » Mon Aug 27, 2012 2:59 pm

wow I believe I finally got the correct funtion, I will try to check that in soon this afetrnoon.
I took me a whilebut I beleive this the final one.

basically this will cover all purpose collision for all shapes pairs. so now I can move on to next funtionality.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: 2 FPS with Newton

Postby carli2 » Tue Aug 28, 2012 11:38 am

Yep. Not using the correct solver solved the prolem. Thanks.

I will switch to core_300, it is all prepared. I prepared the header, I prepared a branch where I can test if the current version of core_300 will work better than the one before.
But the production system runs on core_200 unless the core_300 branch of my project behaves exactly the same (there is also the thing with ConvexCast returning 0 for lots of situations which I have to workaround first)
carli2
 
Posts: 157
Joined: Thu Nov 10, 2011 1:53 pm

Re: 2 FPS with Newton

Postby Julio Jerez » Tue Aug 28, 2012 11:57 am

try again the convex cast in core 300, I just fix the big bug and cheked in, it sodul be fine now
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: 2 FPS with Newton

Postby carli2 » Tue Aug 28, 2012 6:31 pm

Code: Select all
make: *** No rule to make target `../../source/core/dgSimd_128.o', needed by `libNewton.a'.  Stop.


I can remember that I fixed this issue some time ago and posted the patch in the forum.
carli2
 
Posts: 157
Joined: Thu Nov 10, 2011 1:53 pm

Re: 2 FPS with Newton

Postby Julio Jerez » Wed Aug 29, 2012 8:18 am

yes I do remember too, I remambe teh class to be just dgSimd and remove th AVX code.
can you mak eteh patch again?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: 2 FPS with Newton

Postby carli2 » Thu Aug 30, 2012 4:36 am

Julio Jerez wrote:yes I do remember too, I remambe teh class to be just dgSimd and remove th AVX code.
can you mak eteh patch again?


(relative to projects/posix64)
Code: Select all
Index: makefile
===================================================================
--- makefile   (revision 2392)
+++ makefile   (working copy)
@@ -43,8 +43,6 @@
    $(DG_PATH)dgRandom.cpp \
    $(DG_PATH)dgRefCounter.cpp \
    $(DG_PATH)dgRef.cpp \
-   $(DG_PATH)dgSimd_128.cpp \
-   $(DG_PATH)dgSimd_256.cpp \
    $(DG_PATH)dgSmallDeterminant.cpp \
    $(DG_PATH)dgSPDMatrix.cpp \
    $(DG_PATH)dgSphere.cpp \
@@ -53,6 +51,10 @@
    $(DG_PATH)dgTree.cpp \
    $(DG_PATH)dgTypes.cpp
 
+DG_INCLUDED_OPENCL_PATH = ../../source/openCL
+DG_OPENCL_PATH = $(DG_INCLUDED_OPENCL_PATH)/
+DG_OPENCL_SRCS = \
+   $(DG_OPENCL_PATH)dgOpenCL.cpp
 
 # ******************************************************
 #
@@ -104,7 +106,6 @@
    $(DG_PHYSICS_PATH)dgUserConstraint.cpp \
    $(DG_PHYSICS_PATH)dgWorld.cpp \
    $(DG_PHYSICS_PATH)dgWorldDynamicsParallelSolver.cpp \
-   $(DG_PHYSICS_PATH)dgWorldDynamicsParallelSolverSimdAVX.cpp \
    $(DG_PHYSICS_PATH)dgWorldDynamicsParallelSolverSimd.cpp \
    $(DG_PHYSICS_PATH)dgWorldDynamicsSimpleSolver.cpp \
    $(DG_PHYSICS_PATH)dgWorldDynamicsSimpleSolverSimd.cpp \
@@ -157,7 +158,7 @@
 #
 # ******************************************************
 #ALL_SRC_FILES = $(DG_SRCS) $(DG_PHYSICS_SRCS) $(DG_MESH_SRCS) $(DG_NEWTON_SRCS) $(DG_AI_SRCS)
-ALL_SRC_FILES = $(DG_SRCS) $(DG_PHYSICS_SRCS) $(DG_MESH_SRCS) $(DG_NEWTON_SRCS)
+ALL_SRC_FILES = $(DG_SRCS) $(DG_PHYSICS_SRCS) $(DG_MESH_SRCS) $(DG_NEWTON_SRCS) $(DG_OPENCL_SRCS)
 DG_OBJ_FILES = $(ALL_SRC_FILES:.cpp=.o)
 
 COMPILER = gcc
@@ -169,7 +170,7 @@
 CPU_FLAGS = -O2 -fpic -g -msse -msse2 -mfpmath=sse -ffloat-store -ffast-math -freciprocal-math -funsafe-math-optimizations -fsingle-precision-constant
 
 #FLAGS = -c -Wall -Wno-strict-aliasing -D_POSIX_VER -D_POSIX_VER_64 $(CPU_FLAGS) -I$(DG_INCLUDED_PATH) -I$(DG_INCLUDED_PHYSICS_PATH) -I$(DG_INCLUDED_MESH_PATH) -I$(DG_INCLUDED_AI_PATH)
-FLAGS = -c -Wall -Wno-strict-aliasing -D_POSIX_VER -D_POSIX_VER_64 $(CPU_FLAGS) -I$(DG_INCLUDED_PATH) -I$(DG_INCLUDED_PHYSICS_PATH) -I$(DG_INCLUDED_MESH_PATH)
+FLAGS = -D__DEBUG -c -Wall -Wno-strict-aliasing -D_POSIX_VER -D_POSIX_VER_64 $(CPU_FLAGS) -I$(DG_INCLUDED_PATH) -I$(DG_INCLUDED_PHYSICS_PATH) -I$(DG_INCLUDED_MESH_PATH) -I$(DG_INCLUDED_OPENCL_PATH)
 
 
 .SUFFIXES : .o .cpp


Here's the next compilation error:
Code: Select all
gcc -D__DEBUG -c -Wall -Wno-strict-aliasing -D_POSIX_VER -D_POSIX_VER_64 -O2 -fpic -g -msse -msse2 -mfpmath=sse -ffloat-store -ffast-math -freciprocal-math -funsafe-math-optimizations -fsingle-precision-constant -I../../source/core -I../../source/physics -I../../source/meshUtil -I../../source/openCL -o ../../source/physics/dgCollisionConvex.o ../../source/physics/dgCollisionConvex.cpp
../../source/physics/dgCollisionConvex.cpp: In member function ‘dgVector dgCollisionConvex::ReduceTriangleLarge(dgInt32&, dgBigVector*, dgBigVector*) const’:
../../source/physics/dgCollisionConvex.cpp:2488:55: error: could not convert ‘((dgBigVector*)triangleDiff)->dgBigVector::<anonymous>.dgTemplateVector<T>::operator+ [with T = double]((*(const dgTemplateVector<double>*)(& segment.dgBigVector::<anonymous>.dgTemplateVector<T>::Scale [with T = double]((num / den)))))’ from ‘dgTemplateVector<double>’ to ‘dgVector’
../../source/physics/dgCollisionConvex.cpp:2501:70: error: could not convert ‘normal.dgBigVector::<anonymous>.dgTemplateVector<T>::Scale [with T = double]((normal.dgBigVector::<anonymous>.dgTemplateVector<T>::operator% [with T = double]((*(const dgTemplateVector<double>*)(&((dgBigVector*)triangleDiff)->dgBigVector::<anonymous>))) / normal.dgBigVector::<anonymous>.dgTemplateVector<T>::operator% [with T = double]((*(const dgTemplateVector<double>*)(& normal.dgBigVector::<anonymous>)))))’ from ‘dgTemplateVector<double>’ to ‘dgVector’
../../source/physics/dgCollisionConvex.cpp:2508:1: warning: control reaches end of non-void function [-Wreturn-type]
make: *** [../../source/physics/dgCollisionConvex.o] Error 1


and
Code: Select all
../../source/meshUtil/dgMeshEffect1.cpp: In member function ‘dgMeshEffect::dgMeshEffect(dgMemoryAllocator*, const char*)::ParceOFF::Token dgMeshEffect::dgMeshEffect(dgMemoryAllocator*, const char*)::ParceOFF::GetToken(char*) const’:
../../source/meshUtil/dgMeshEffect1.cpp:992:34: error: ‘_stricmp’ was not declared in this scope
../../source/meshUtil/dgMeshEffect1.cpp:988:34: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
../../source/meshUtil/dgMeshEffect1.cpp: In member function ‘void dgMeshEffect::dgMeshEffect(dgMemoryAllocator*, const char*)::ParceOFF::SkipLine() const’:
../../source/meshUtil/dgMeshEffect1.cpp:1004:37: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
make: *** [../../source/meshUtil/dgMeshEffect1.o] Error 1
carli2
 
Posts: 157
Joined: Thu Nov 10, 2011 1:53 pm

Re: 2 FPS with Newton

Postby Julio Jerez » Thu Aug 30, 2012 10:39 am

Ok, I will run the linux make file this saturday and add all the changes
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: 2 FPS with Newton

Postby carli2 » Sat Sep 01, 2012 3:42 pm

Code: Select all
gcc -D__DEBUG -c -Wall -Wno-strict-aliasing -D_POSIX_VER -D_POSIX_VER_64 -O2 -fpic -g -msse -msse2 -mfpmath=sse -ffloat-store -ffast-math -freciprocal-math -funsafe-math-optimizations -fsingle-precision-constant -I../../source/core -I../../source/physics -I../../source/meshUtil -I../../source/openCL -o ../../source/physics/dgCollisionConvex.o ../../source/physics/dgCollisionConvex.cpp
gcc -D__DEBUG -c -Wall -Wno-strict-aliasing -D_POSIX_VER -D_POSIX_VER_64 -O2 -fpic -g -msse -msse2 -mfpmath=sse -ffloat-store -ffast-math -freciprocal-math -funsafe-math-optimizations -fsingle-precision-constant -I../../source/core -I../../source/physics -I../../source/meshUtil -I../../source/openCL -o ../../source/meshUtil/dgMeshEffect1.o ../../source/meshUtil/dgMeshEffect1.cpp
../../source/meshUtil/dgMeshEffect1.cpp: In member function ‘dgMeshEffect::dgMeshEffect(dgMemoryAllocator*, const char*)::ParceOFF::Token dgMeshEffect::dgMeshEffect(dgMemoryAllocator*, const char*)::ParceOFF::GetToken(char*) const’:
../../source/meshUtil/dgMeshEffect1.cpp:992:34: error: ‘_stricmp’ was not declared in this scope
../../source/physics/dgCollisionConvex.cpp: In member function ‘dgVector dgCollisionConvex::ReduceTriangleLarge(dgInt32&, dgBigVector*, dgBigVector*) const’:
../../source/physics/dgCollisionConvex.cpp:2488:55: error: could not convert ‘((dgBigVector*)triangleDiff)->dgBigVector::<anonymous>.dgTemplateVector<T>::operator+ [with T = double]((*(const dgTemplateVector<double>*)(& segment.dgBigVector::<anonymous>.dgTemplateVector<T>::Scale [with T = double]((num / den)))))’ from ‘dgTemplateVector<double>’ to ‘dgVector’
../../source/physics/dgCollisionConvex.cpp:2501:70: error: could not convert ‘normal.dgBigVector::<anonymous>.dgTemplateVector<T>::Scale [with T = double]((normal.dgBigVector::<anonymous>.dgTemplateVector<T>::operator% [with T = double]((*(const dgTemplateVector<double>*)(&((dgBigVector*)triangleDiff)->dgBigVector::<anonymous>))) / normal.dgBigVector::<anonymous>.dgTemplateVector<T>::operator% [with T = double]((*(const dgTemplateVector<double>*)(& normal.dgBigVector::<anonymous>)))))’ from ‘dgTemplateVector<double>’ to ‘dgVector’
../../source/physics/dgCollisionConvex.cpp:2508:1: warning: control reaches end of non-void function [-Wreturn-type]
make: *** [../../source/physics/dgCollisionConvex.o] Error 1
make: *** Waiting for unfinished jobs....
../../source/meshUtil/dgMeshEffect1.cpp:988:34: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
../../source/meshUtil/dgMeshEffect1.cpp: In member function ‘void dgMeshEffect::dgMeshEffect(dgMemoryAllocator*, const char*)::ParceOFF::SkipLine() const’:
../../source/meshUtil/dgMeshEffect1.cpp:1004:37: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
make: *** [../../source/meshUtil/dgMeshEffect1.o] Error 1
carli2
 
Posts: 157
Joined: Thu Nov 10, 2011 1:53 pm


Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 8 guests