favreau / bullet

Automatically exported from code.google.com/p/bullet
0 stars 0 forks source link

AMD OpenCL Demo Does not run. #565

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Install Bullet SDK
2. Build Bullet Cloth Sample for OpenCL on AMD.
3. Run OpenCL Cloth demo.

What is the expected output? What do you see instead?
The sample to run, but instead i get an error when the context is created.

What version of the product are you using? On what operating system?

bullet-2.79-rev2440
AMD Catalyst 11.10 with opencl.

Please provide any additional information below.

Running on an Asus k53ta ( Radeon HD6720G2 1GB card )

Original issue reported on code.google.com by kphilli...@gmail.com on 10 Nov 2011 at 7:34

GoogleCodeExporter commented 9 years ago

Can you comment out those lines in 
Bullet\src\BulletMultiThreaded\GpuSoftBodySolvers\OpenCL\OpenCLC10\ApplyForces.c
l

    //if( dot(forceDTIM, forceDTIM) > dot(nodeV, nodeV) )
    //  nodeF = nodeFMinus;

and see if that works for you?

(it might be some regression in the AMD OpenCL drivers)

Original comment by erwin.coumans on 11 Nov 2011 at 12:53

GoogleCodeExporter commented 9 years ago
I would love to try that, but the code does not even make it to that point. 
Instead it fails at during the call of initCL at the line:

   cl_context retContext = clCreateContextFromType(cprops,

and as for the error... it gives me an invalid property error.

Original comment by kphilli...@gmail.com on 11 Nov 2011 at 1:01

GoogleCodeExporter commented 9 years ago
Before I forget, Here's the output from when I run clinfo on the amd app sdk v 
2.5 ( 775.2 ). Notice that i actually have Two different cards (Not by much), 
and a cpu device to work with.

Original comment by kphilli...@gmail.com on 11 Nov 2011 at 1:09

Attachments:

GoogleCodeExporter commented 9 years ago

Can you provide me with the full output of the OpenCL cloth demo (from the 
console) at the time of the crash?

Thanks for your help!

Original comment by erwin.coumans on 11 Nov 2011 at 1:21

GoogleCodeExporter commented 9 years ago
The Command line output i get is due to an assertion failure: 

createContextFromType(CL_DEVICE_TYPE_GPU)
OCL Error : -1000
Assertion failed: (ciErrNum) == (0), file 
..\..\Demos\OpenCLClothDemo\clstuff.cpp, line 73

Original comment by kphilli...@gmail.com on 11 Nov 2011 at 1:25

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
The point is that the bug occurred at the very start of the program, and the 
complete output is as i pasted in my last message. As as a kicker, this build 
was debug, so I stepped the program one step at a time. The program generates 
an odd error at the line i mentioned in comment 2.

Original comment by kphilli...@gmail.com on 11 Nov 2011 at 1:45

GoogleCodeExporter commented 9 years ago

Can you step into the 'createContextFromType' function (into file 
btOclCommon.cpp) and see which line causes the OCL Error: -1000?

I think the error happens in btOclCommon.cpp and not just clstuff.cpp.

Thanks for your help!

Original comment by erwin.coumans on 11 Nov 2011 at 1:47

GoogleCodeExporter commented 9 years ago
I stepped through btOclCommon.cpp.

Line: 108 - ciErrNum = 0;
line: 109 - Cprops changes ( 0x0018FBAC is the value), and ciErrNum is still 0.
line: 110 - retContext is NULL (0x00000000 ) and ciErrNum is -1000.

Original comment by kphilli...@gmail.com on 11 Nov 2011 at 1:53

GoogleCodeExporter commented 9 years ago
Every time i run the test, the error occurs at this call ( Lines 109 to 114):

cl_context retContext = clCreateContextFromType(cprops,
deviceType, NULL, NULL,&ciErrNum);

Original comment by kphilli...@gmail.com on 11 Nov 2011 at 1:59

GoogleCodeExporter commented 9 years ago
Could you try to comment out USE_GPU_COPY in 
Bullet/Demos/OpenCLClothDemo/cl_cloth_demo.cpp

//  #define USE_GPU_COPY //only tested on Windows

and see if that helps?

It could be that in a dual gpu, the sharing of GL/CL doesn't work.

Original comment by erwin.coumans on 11 Nov 2011 at 3:16

GoogleCodeExporter commented 9 years ago
That helps fix that problem, but now another arises. See the output log for 
this run.

Original comment by kphilli...@gmail.com on 11 Nov 2011 at 4:00

Attachments:

GoogleCodeExporter commented 9 years ago
Never Mind, applying the fix mentioned in Comment 1 fixes this other issue, and 
now the demo runs.

Original comment by kphilli...@gmail.com on 11 Nov 2011 at 4:09

GoogleCodeExporter commented 9 years ago
We should add some user interface to enable/disable some options at run-time,
and leave GPU CL/GL sharing off by default. That way, the demo runs on more 
machines.

Let's close the issue.

Original comment by erwin.coumans on 11 Nov 2011 at 4:27