FAQ  •  Login

PROJECT TOPIC 1: GPU Discrete Element Method

Moderator: Dan Negrut

<<

Dan Negrut

Global Moderator
Global Moderator

Posts: 833

Joined: Wed Sep 03, 2008 12:24 pm

Unread post Tue Mar 01, 2011 6:18 pm

PROJECT TOPIC 1: GPU Discrete Element Method

Please post here questions related to this project topic.

For starters, please indicate that you adopt this as your Midterm Project topic.

Area coordinator: Toby Heyn.

Thank you,
Dan
<<

ArmanP

Newbie
Newbie

Posts: 28

Joined: Wed Feb 16, 2011 12:02 pm

Unread post Mon Mar 14, 2011 9:36 am

Re: PROJECT TOPIC 1: GPU Discrete Element Method

IAN OLSON,
STUART SLATTERY,
BENJAMIN WILSON,
have planned to work on this topic.
<<

ME964BenjaminW

Jr. Member
Jr. Member

Posts: 85

Joined: Wed Jan 12, 2011 1:53 pm

Unread post Mon Mar 14, 2011 10:36 am

Re: PROJECT TOPIC 1: GPU Discrete Element Method

What is required in the two page intermediate report? What are you looking for?

Thanks.
<<

ArmanP

Newbie
Newbie

Posts: 28

Joined: Wed Feb 16, 2011 12:02 pm

Unread post Mon Mar 14, 2011 4:06 pm

Re: PROJECT TOPIC 1: GPU Discrete Element Method

JOSHUA ANDERSON,
also planned to work on this topic.
<<

Dan Negrut

Global Moderator
Global Moderator

Posts: 833

Joined: Wed Sep 03, 2008 12:24 pm

Unread post Tue Mar 15, 2011 8:49 am

Re: PROJECT TOPIC 1: GPU Discrete Element Method

ME964BenjaminW wrote:What is required in the two page intermediate report? What are you looking for?

Thanks.


Ben - what you should provide is an overview of the algorithm that you plan to implement.
Specifically, a flow diagram, data structures that you plan to use, discuss how your algorithm maps upon the underlying SIMD architecture, possible limiting factors that work against your solution implementation (for instance, if all threads executing a kernel need to synchronize, or to perform atomic operations, etc.).
Please indicate the use of any third party CUDA libraries such as thrust, for instance. The use of existing libraries is encouraged (as long as they don't completely solve your problem...).

I hope this helps.
Dan
<<

ME964BenjaminW

Jr. Member
Jr. Member

Posts: 85

Joined: Wed Jan 12, 2011 1:53 pm

Unread post Wed Mar 16, 2011 2:01 pm

Re: PROJECT TOPIC 1: GPU Discrete Element Method

How is the data outputted from the collision detection scheme? I am trying to figure out how to go about creating a flowchart/algorithm for calculating the forces, but am having trouble getting started, and I think it might help if I better understood how the collision detection data is represented. I have found in the "particle.h" file the declaration for the "contact_Data*", but I don't really know what that does. Any help with this would be appreciated.

Thanks,

Ben
<<

ME964BenjaminW

Jr. Member
Jr. Member

Posts: 85

Joined: Wed Jan 12, 2011 1:53 pm

Unread post Wed Mar 16, 2011 2:33 pm

Re: PROJECT TOPIC 1: GPU Discrete Element Method

Also, I have noticed in the pdf from class, there is a normal force calculation that is somewhat confusing. It is expressed by:

Fnij = f(deltaij/d)*(k*deltaij*nij - gamma*m*vnij)

I was wondering what f(deltaij/d) is?

Thanks,

Ben
<<

TobyH

Newbie
Newbie

Posts: 39

Joined: Wed Sep 03, 2008 12:26 pm

Unread post Thu Mar 17, 2011 11:56 am

Re: PROJECT TOPIC 1: GPU Discrete Element Method

ME964BenjaminW wrote:How is the data outputted from the collision detection scheme? I am trying to figure out how to go about creating a flowchart/algorithm for calculating the forces, but am having trouble getting started, and I think it might help if I better understood how the collision detection data is represented. I have found in the "particle.h" file the declaration for the "contact_Data*", but I don't really know what that does. Any help with this would be appreciated.

Thanks,

Ben


After the collision detection (CD) step, the data is in a vector on the GPU. In the class ParticleSystem there is a data member m_numContacts which is updated during CD to hold the number of sphere-sphere collisions. Then, entries contactDataD[0] through contactDataD[m_numContacts-1] hold the contact pairs. Each entry is of type contact_Data, which is a structure defined in collide.h. The structure holds the ID number of the two bodies participating in the collision.
You can access these ID numbers like:
int iA=contactDataD[i].objectIdA;
int iB=contactDataD[i].objectIdB;
<<

TobyH

Newbie
Newbie

Posts: 39

Joined: Wed Sep 03, 2008 12:26 pm

Unread post Thu Mar 17, 2011 11:59 am

Re: PROJECT TOPIC 1: GPU Discrete Element Method

ME964BenjaminW wrote:Also, I have noticed in the pdf from class, there is a normal force calculation that is somewhat confusing. It is expressed by:

Fnij = f(deltaij/d)*(k*deltaij*nij - gamma*m*vnij)

I was wondering what f(deltaij/d) is?

Thanks,

Ben


f(deltaij/d) is a functional dependence which can take different forms for different collision force model. We can take f(deltaij/d)=1.
Therefore, work with this expression for the interaction force: Fnij = k*deltaij*nij - gamma*m*vnij
<<

Dan Negrut

Global Moderator
Global Moderator

Posts: 833

Joined: Wed Sep 03, 2008 12:24 pm

Unread post Tue Mar 22, 2011 2:16 pm

Re: PROJECT TOPIC 1: GPU Discrete Element Method

A sample final report for a past Midterm Project is available here:
http://sbel.wisc.edu/Courses/ME964/2011/MidtermProject/midtermProjectReport.doc
Dan
<<

ME964IanO

Newbie
Newbie

Posts: 9

Joined: Wed Jan 12, 2011 1:53 pm

Location: UW-Madison

Unread post Mon Mar 28, 2011 1:32 pm

Re: PROJECT TOPIC 1: GPU Discrete Element Method

I've been struggling for several days to get the "out of the box" code for this project to compile on my machine.

After connecting everything in a Visual Studio project and adding include directores, I receive the following error in collide.h:
"fatal error C1083: Cannot open include file: 'cutil.h': No such file or directory"

Has anybody successfully compiled the base code for this project?
<<

TobyH

Newbie
Newbie

Posts: 39

Joined: Wed Sep 03, 2008 12:26 pm

Unread post Tue Mar 29, 2011 2:38 pm

Re: PROJECT TOPIC 1: GPU Discrete Element Method

ME964IanO wrote:I've been struggling for several days to get the "out of the box" code for this project to compile on my machine.

After connecting everything in a Visual Studio project and adding include directores, I receive the following error in collide.h:
"fatal error C1083: Cannot open include file: 'cutil.h': No such file or directory"

Has anybody successfully compiled the base code for this project?



Note that there is already a VisualStudio project file in the provided directory. You should be able to open the file DEM_project.sln in VisualStudio 2008 and all files should be already added. If you open this file, select Release mode, and still cannot compile, the issue is likely related to environment variables.
To check:
-right-click on the project, select Properties
-select C/C++, General
-The entry Additional Include Directories must have the path to the CUDA files. On my machine, the necessary paths are C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\include and E:\Programs\NVIDIA\NVIDIA GPU Computing SDK 3.2\C\Common\inc. On my machine, I have environment variables defined, CUDA_INC_PATH and CUDA_COMMON_INC_PATH respectively. On your machine the directories might be in different locations or the environment variables may have different names.
-select CUDA, General
-The same paths should be entered here under Additional Include Directories
<<

ME964BenjaminW

Jr. Member
Jr. Member

Posts: 85

Joined: Wed Jan 12, 2011 1:53 pm

Unread post Tue Mar 29, 2011 3:31 pm

Re: PROJECT TOPIC 1: GPU Discrete Element Method

Okay, I have attempted to move the cutil.h into a library that is in the same directory as the DEM project file. Using the properties feature of the project I have followed your instructions to have it access that library, however, it still cannot find it. When I open up the window to find it, even though cutil.h is a folder with all the relevant cutil files, the Additional Libraries browser cannot find it. When I go to the cutil folder and click on it, it comes up empty when in reality it is not empty. I have even taken the additional step of putting cutil.h in the header files associated with solution. I have added a screen shot to this post that shows the cutil.h has been added to the header files. However it still says it isn't there when I try to compile. Why won't it find the cutil.h library?
Attachments
cutilh.png
cutilh.png (239.48 KiB) Viewed 15878 times
<<

Andrew Seidl

Administrator
Administrator

Posts: 193

Joined: Thu Oct 28, 2010 11:54 am

Unread post Tue Mar 29, 2011 4:09 pm

Re: PROJECT TOPIC 1: GPU Discrete Element Method

It's not finding the cutil.h header because your code is saying to look for the system one (<cutil.h>) instead of your own ("cutil.h") which is what it thinks it is when you manually add it to Header Files. Instead, go to Additional Include Directories (for both the normal project properties and the CUDA properties) and add the path to the directory cutil.h is in. If you have your own path variables defined/once had an older version of CUDA installed (like Toby does), you can just use those; otherwise you can use the ones Nvidia sets when you installed the toolkit and SDK (similar to $(NVSDKCOMPUTE_ROOT)\C\common\inc). You might also have to add $(NVSDKCOMPUTE_ROOT)\C\common\lib to Additional Library Dependencies and cutil{something}.lib to Additional Dependencies. If you cannot find cutil{something}.lib, you will have to build it using the Visual Studio project in the SDK ($(NVSDKCOMPUTE_ROOT)\C\common\cutil_vc90.sln)

Note: the {something} should be one of: 32, 32D, 64, or 64D, depending on if you built it for 32- or 64-bit and in release or debug mode.
<<

TobyH

Newbie
Newbie

Posts: 39

Joined: Wed Sep 03, 2008 12:26 pm

Unread post Tue Mar 29, 2011 4:14 pm

Re: PROJECT TOPIC 1: GPU Discrete Element Method

ME964BenjaminW wrote:Okay, I have attempted to move the cutil.h into a library that is in the same directory as the DEM project file. Using the properties feature of the project I have followed your instructions to have it access that library, however, it still cannot find it. When I open up the window to find it, even though cutil.h is a folder with all the relevant cutil files, the Additional Libraries browser cannot find it. When I go to the cutil folder and click on it, it comes up empty when in reality it is not empty. I have even taken the additional step of putting cutil.h in the header files associated with solution. I have added a screen shot to this post that shows the cutil.h has been added to the header files. However it still says it isn't there when I try to compile. Why won't it find the cutil.h library?


EDIT: I see Andrew answered while I was typing this. We say pretty much the same thing.

You should not have to (and you should not) move the file cutil.h to the directory with your project.

The project is set up using the following environment variables (these values are on my machine and may be different for you):
CUDA_INC_PATH = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\include
CUDA_COMMON_INC_PATH = E:\Programs\NVIDIA\NVIDIA GPU Computing SDK 3.2\C\common\inc
CUDA_LIB_PATH = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\lib\Win32
CUDA_COMMON_LIB_PATH = E:\Programs\NVIDIA\NVIDIA GPU Computing SDK 3.2\C\common\lib

Depending on where you installed the CUDA SDK and toolkit, these directories will be different.

Solution 1: Define these environment variables on your system and set the values to the appropriate paths.

Solution 2: In project properties, there are three places where the paths must be set.
a) C/C++, General: delete the entries in Additional Include Directories and add two entries: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\include; E:\Programs\NVIDIA\NVIDIA GPU Computing SDK 3.2\C\common\inc
b) Linker, General: delete the entries in Additional Library Directories and add two entries: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\lib\Win32; E:\Programs\NVIDIA\NVIDIA GPU Computing SDK 3.2\C\common\lib
c) CUDA, General: delete the entries in Additional Include Directories and add two entries: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\include; E:\Programs\NVIDIA\NVIDIA GPU Computing SDK 3.2\C\common\inc
Once again, use the appropriate paths for your machine.
Next

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.