Bullet 3 GPU Crashes

Post Reply
Richmar1
Posts: 7
Joined: Wed Jul 30, 2014 6:38 pm

Bullet 3 GPU Crashes

Post by Richmar1 »

Hello all! I'm experiencing a consistent crash that is preventing me from using Bullet 3, and i was wondering if someone could help me. Firstly, here are my computer specifications:

PC Specifications:
OS: Windows 8.1 Pro x64 with latest updates.
CPU: AMD Phenom II x6 1055T Thuban.
GPU: Nvidia GTX 970 with driver version 344.65 (Latest)/

Related PC Software:
AMD: AMD OpenCL SDK 2.9.1(Latest) AKA. "AMD App SDK".
Nvidia: Nvidia Cuda SDK 6.5(Latest) with support for my GPU.

The crash is consistent and is the same for every run when targeting the CPU. The crash is consistant and is the same for every run when targeting the GPU.

CPU Crash:
Bullet 3 OpenCL Crash CPU.png
Bullet 3 OpenCL Crash CPU.png (139.82 KiB) Viewed 3383 times
GPU Crash:
Bullet 3 OpenCL Crash GPU.png
Bullet 3 OpenCL Crash GPU.png (172.38 KiB) Viewed 3383 times
The crash in CPU, and the assert in GPU, occur inside the very first simulation step

Code: Select all

pWorld->stepSimulation();
making it impossible to use Bullet 3.

Here is my initialization code, and all of it does indeed succeed.

Code: Select all

int ErrorCode = 0;
m_pOpenCLContext = b3OpenCLUtils::createContextFromType( CL_DEVICE_TYPE_CPU, &ErrorCode );
if( !m_pOpenCLContext || ( ErrorCode != 0 ) )
{
	Shutdown();
	CryFatalError( "Failed To Create An OpenCL Context.  OpenCL Reported Error Code %i", ErrorCode );
}

m_pOpenCLDeviceID = b3OpenCLUtils::getDevice( m_pOpenCLContext, 0 );
if( !m_pOpenCLDeviceID )
{
	Shutdown();
	CryFatalError( "Failed To Get An OpenCL Device." );
}

b3OpenCLUtils::getDeviceInfo( m_pOpenCLDeviceID, m_pOpenCLDeviceInfo );
m_pOpenCLCommandQueue = clCreateCommandQueue( m_pOpenCLContext, m_pOpenCLDeviceID, m_pOpenCLDeviceInfo->m_queueProperties, &ErrorCode );
if( !m_pOpenCLCommandQueue || ( ErrorCode != 0 ) )
{
	Shutdown();
	CryFatalError( "Failed To Create The OpenCL Command Queue.  OpenCL Reported Error Code %i", ErrorCode );
}

m_pNarrowPhase = new b3GpuNarrowPhase( m_pOpenCLContext, m_pOpenCLDeviceID, m_pOpenCLCommandQueue, *m_pConfig );
m_pBroadPhase = new b3GpuSapBroadphase( m_pOpenCLContext, m_pOpenCLDeviceID, m_pOpenCLCommandQueue );
m_pBVHBroadPhase = new b3DynamicBvhBroadphase( m_pConfig->m_maxConvexBodies );

m_pWorld = new b3GpuRigidBodyPipeline( m_pOpenCLContext, m_pOpenCLDeviceID, m_pOpenCLCommandQueue, m_pNarrowPhase, m_pBroadPhase, m_pBVHBroadPhase, *m_pConfig );
m_pWorld->setGravity( b3MakeVector3( 0, 0, -9.8f ) );
m_pBVHBroadPhase->m_paircache->setOverlapFilterCallback( m_pOverlapFilterCallback );
I hope that I can get help with this error. Thank you for your time.
Richmar1
Posts: 7
Joined: Wed Jul 30, 2014 6:38 pm

Re: Bullet 3 GPU Crashes

Post by Richmar1 »

Problem is partially solved. The issue was improper API usage on my part. Although, the SAP GPU broad-phase only works when it feels like it. One run it will work, the other it will crash. If I use the GRID GPU broad-phase it works every time. Unfortunately, any GPU solution doesn't detect collision, only when using the CPU, is collision detected. Can anyone help me as to why the SAP broad-phase causes a crash most times and why no collision occurs when using OpenCL on the GPU?
Post Reply