Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory usage #7

Closed
joen66 opened this issue Jun 24, 2013 · 1 comment
Closed

Memory usage #7

joen66 opened this issue Jun 24, 2013 · 1 comment

Comments

@joen66
Copy link

joen66 commented Jun 24, 2013

Hi, everyone!

I have a question about launching several bullet3 demo applications such as App_BasicGpuDemo at the same time. If I launched a demo application and closed it repeatedly, everything is fine, but the computer is crashed when I launched 3 or more demo applications and didn't close any demo application. That is, when launched, the 3rd application leaded to the computer's crash. I think that the memory on the GPU has exhausted, and found that the memory usage is allocated by the b3Config class.

                                                                            
  b3Config()                                                                        
    :m_maxConvexBodies(128*1024),                                                   
    m_maxVerticesPerFace(64),                                                       
    m_maxFacesPerShape(12),                                                         
    m_maxConvexVertices(8192),                                                      
    m_maxConvexIndices(81920),                                                      
    m_maxConvexUniqueEdges(8192),                                                   
    m_maxCompoundChildShapes(8192),                                                 
    m_maxTriConvexPairCapacity(256*1024)                                            
  {                                                                                 
    m_maxConvexShapes = m_maxConvexBodies;                                          
    m_maxBroadphasePairs = 8*m_maxConvexBodies;                                     
    m_maxContactCapacity = m_maxBroadphasePairs;                                    
  }                                       

If there are 100 boxes or spheres in the demo application, how much memory should I allocate? The original setting is too large to utilize memory efficiently.

The Platform info:
CL_PLATFORM_VENDOR: Advanced Micro Devices, Inc.
CL_PLATFORM_NAME: AMD Accelerated Parallel Processing
CL_PLATFORM_VERSION: OpenCL 1.2 AMD-APP (1113.2)
Device Info:
CL_DEVICE_NAME: Pitcairn
CL_DEVICE_VENDOR: Advanced Micro Devices, Inc.
CL_DRIVER_VERSION: 1113.2 (VM)
CL_DEVICE_TYPE: CL_DEVICE_TYPE_GPU
CL_DEVICE_MAX_COMPUTE_UNITS: 16
CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS: 3
CL_DEVICE_MAX_WORK_ITEM_SIZES: 256 / 256 / 256
CL_DEVICE_MAX_WORK_GROUP_SIZE: 256
CL_DEVICE_MAX_CLOCK_FREQUENCY: 870 MHz
CL_DEVICE_ADDRESS_BITS: 32
CL_DEVICE_MAX_MEM_ALLOC_SIZE: 512 MByte
CL_DEVICE_GLOBAL_MEM_SIZE: 1792 MByte
CL_DEVICE_ERROR_CORRECTION_SUPPORT: no
CL_DEVICE_LOCAL_MEM_TYPE: local
CL_DEVICE_LOCAL_MEM_SIZE: 32 KByte
CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE: 64 KByte
CL_DEVICE_QUEUE_PROPERTIES: CL_QUEUE_PROFILING_ENABLE
CL_DEVICE_IMAGE_SUPPORT: 1
CL_DEVICE_MAX_READ_IMAGE_ARGS: 128
CL_DEVICE_MAX_WRITE_IMAGE_ARGS: 8

CL_DEVICE_IMAGE 2D_MAX_WIDTH 16384
2D_MAX_HEIGHT 16384
3D_MAX_WIDTH 2048
3D_MAX_HEIGHT 2048
3D_MAX_DEPTH 2048

Thanks

@erwincoumans
Copy link
Member

The latest default settings should work better, it pre-allocates 32k bodies, see
https://github.com/erwincoumans/bullet3/blob/master/src/Bullet3OpenCL/RigidBody/b3Config.h
If your GPU cannot deal with those new defaults, there is probably no point in using Bullet 3.x for the GPU, and it is better to simply use Bullet 2.x on the CPU.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants