FAQ  •  Login

PROJECT TOPIC 1: GPU Discrete Element Method

Moderator: Dan Negrut

<<

ME964BenjaminW

Jr. Member
Jr. Member

Posts: 85

Joined: Wed Jan 12, 2011 1:53 pm

Unread post Tue Mar 29, 2011 4:36 pm

Re: PROJECT TOPIC 1: GPU Discrete Element Method

Okay. I got it to recognize the cutil.h, but now it can't find the thrust/sort.h. Which directory am I missing now?
<<

Andrew Seidl

Administrator
Administrator

Posts: 193

Joined: Thu Oct 28, 2010 11:54 am

Unread post Tue Mar 29, 2011 4:45 pm

Re: PROJECT TOPIC 1: GPU Discrete Element Method

Add thrust's parent directory to the add'l include dirs (don't add the thrust directory itself since then you'd instead have to include sort.h instead of thrust/sort.h).

Or try changing it from <thrust/sort.h> to "thrust/sort.h" since I believe thrust was distributed with the project and the main project directory is automatically included.
<<

ME964BenjaminW

Jr. Member
Jr. Member

Posts: 85

Joined: Wed Jan 12, 2011 1:53 pm

Unread post Tue Mar 29, 2011 5:33 pm

Re: PROJECT TOPIC 1: GPU Discrete Element Method

Which addl include library do I add it to?
<<

ME964BenjaminW

Jr. Member
Jr. Member

Posts: 85

Joined: Wed Jan 12, 2011 1:53 pm

Unread post Tue Mar 29, 2011 6:39 pm

Re: PROJECT TOPIC 1: GPU Discrete Element Method

I should add that I tried you're suggestion of putting quotes around it, but it ended up I was going to have to change a whole bunch more libraries to that. Also, what does changing it to quotes do?
<<

ME964BenjaminW

Jr. Member
Jr. Member

Posts: 85

Joined: Wed Jan 12, 2011 1:53 pm

Unread post Wed Mar 30, 2011 11:39 am

Re: PROJECT TOPIC 1: GPU Discrete Element Method

I have added the thrust library to the C/C++ general, Linker general, and CUDA general and still it does not recognize the thrust/sort.h file. What do I need to do to get this thing to compile?
<<

Andrew Seidl

Administrator
Administrator

Posts: 193

Joined: Thu Oct 28, 2010 11:54 am

Unread post Wed Mar 30, 2011 1:46 pm

Re: PROJECT TOPIC 1: GPU Discrete Element Method

$(ProjectDir) most likely
<<

ME964BenjaminW

Jr. Member
Jr. Member

Posts: 85

Joined: Wed Jan 12, 2011 1:53 pm

Unread post Wed Mar 30, 2011 1:49 pm

Re: PROJECT TOPIC 1: GPU Discrete Element Method

What does that mean?
<<

Andrew Seidl

Administrator
Administrator

Posts: 193

Joined: Thu Oct 28, 2010 11:54 am

Unread post Wed Mar 30, 2011 2:06 pm

Re: PROJECT TOPIC 1: GPU Discrete Element Method

It's a Visual Studio macro/variable that points to the directory your project is in. Since the thrust directory should be directly inside there, forcibly add it.

Again, since thrust is included in the project instead of in a system-wide include dir, it would be better to just use "thrust/blah.h" instead.
<<

ME964BenjaminW

Jr. Member
Jr. Member

Posts: 85

Joined: Wed Jan 12, 2011 1:53 pm

Unread post Wed Mar 30, 2011 2:15 pm

Re: PROJECT TOPIC 1: GPU Discrete Element Method

So how do I do that? I am still confused as to what I need to do to make sure its seeing the thrust library.
<<

Andrew Seidl

Administrator
Administrator

Posts: 193

Joined: Thu Oct 28, 2010 11:54 am

Unread post Wed Mar 30, 2011 3:29 pm

Re: PROJECT TOPIC 1: GPU Discrete Element Method

Swing by the lab when you get a chance, that will be the easiest way to get everything working.
<<

ME964BenjaminW

Jr. Member
Jr. Member

Posts: 85

Joined: Wed Jan 12, 2011 1:53 pm

Unread post Wed Mar 30, 2011 3:48 pm

Re: PROJECT TOPIC 1: GPU Discrete Element Method

Okay, thanks. It will probably after class tomorrow.
<<

ME964StuartS

Newbie
Newbie

Posts: 11

Joined: Wed Jan 12, 2011 1:53 pm

Unread post Sat Apr 02, 2011 3:05 pm

Re: PROJECT TOPIC 1: GPU Discrete Element Method

Hi Ben and Andrew

Could you share the outcome of your chat in the lab for getting the DEM skeleton code to compile with thrust? To actually get it to run locally I am assuming we will need to compile thrust so there are actually libraries to link against. But we should still be able to compile the DEM code given the right visual studio configuration.

Thanks
<<

Andrew Seidl

Administrator
Administrator

Posts: 193

Joined: Thu Oct 28, 2010 11:54 am

Unread post Sat Apr 02, 2011 3:42 pm

Re: PROJECT TOPIC 1: GPU Discrete Element Method

Ben: could you post your .sln and .vcproj files? I don't remember what changes we had to make...

Stuart: I guess you could refer to Thrust (http://code.google.com/p/thrust/) as a code library (my terminology...couldn't think of a better name) rather than a regular old compiled library. It's a set of includes and inline functions that you simply need to include into your source to use, no linking necessary. Therefore you can safely ignore all the talk above about Project Dependencies, just need to make sure your include dirs are correct.
<<

ME964StuartS

Newbie
Newbie

Posts: 11

Joined: Wed Jan 12, 2011 1:53 pm

Unread post Fri Apr 08, 2011 8:05 pm

Re: PROJECT TOPIC 1: GPU Discrete Element Method

Here is a new issue I have come across.

When executing on Newton I get the following error:

  Code:
Cuda error: A in file 'c:/Users/Stuart Slattery/Documents/class/me964/midterm/DEM/collide.cu' in line 133 : invalid configuration argument.


Here is the first chunk of the collision detection driver where this check exists:

  Code:
void CollisionSystem::CudaCollision(float4 *bodyPosDptr, contact_Data *contactDataDptr){

   cMin=fabs(cMin);
   mMaxDim=maxf3(cMin+cMax);
   mBinSize=1.0;//??????????????????????????????????
   mEnvelope=0;
   CUT_CHECK_ERROR("A");


This lead me to believe that I was altering some of the data structures that the collision detection relies on and therefore would not work. To try and isolate the problem, I began by commenting out my code step by step. I found that if I call any GPU kernel, regardless of whether it does anything or not or contains references to contact data, I still get this problem.

After some internet searching, I found a lot of people come across this problem with an incorrect grid/block specification or by running too many blocks. I thought it may be possible that I was running too many blocks but at 100 spheres and a maximum of 6 collisions per sphere, I should never be executing more than 1024 threads (512 threads per block, 2 blocks with some threads idle).

If I comment out completely the force computation and integration functions, the code will run all the way through the time steps, computing collisions but no updating any particle. I've verified that I haven't altered any of the code other than what can be found in DEM.cu as well.

I'm not really sure what to do on this one. Any suggestions?

Thanks
<<

ME964StuartS

Newbie
Newbie

Posts: 11

Joined: Wed Jan 12, 2011 1:53 pm

Unread post Sat Apr 09, 2011 12:44 pm

Re: PROJECT TOPIC 1: GPU Discrete Element Method

Just follow up on my previous post:

After some more investigation I learned that this error can occur not necessarily where the code is actually failing. My hint that it was a block configuration issue was correct. Essentially, if the collision detection code returned no collisions for the iteration, my block/grid construction logic would come up with a situation which the kernel could not launch. I solved this by only launching the force calculation kernel if the number of collisions detect was greater than zero.
PreviousNext

Return to ME964 Spring 2011: High Performance Computing

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software.