(CLOSED) Physx 3.3.2 enabling GPU acceleration on Linux

I installed the latest version of physx (3.3.2) on Linux, and I would like to enable the GPU, but the program crash when calling the function “mCudaContextManager-> getGpuDispatcher ()”, because PxCudaContextManager not created.

Are there any examples or guidelines on how to enable physx GPU on linux?

The documentation refers to an “application GUID”, how can I get it?

Thanks in advance.

Did you create an instance of the CUDA context manager? Object creation does not differ between the different versions of PhysX afaik, so I don’t see how the CUDA context manager creation would be different on Linux than say on Windows.

Thanks for the reply …

I’m new to Physx.

I have followed the user guide and I think I created the CUDA context manager but when I run “mCudaContextManager->getGpuDispatcher();” the program crash.

I tried to remove the CPUDispatcher and put it back but it does not change anything.

However enclose the entire statement Physx:

mFoundation = PxCreateFoundation(PX_PHYSICS_VERSION,mAllocator,mErrorCallback);
    PxProfileZoneManager* profileZoneManager = &PxProfileZoneManager::createProfileZoneManager(mFoundation);
    mPhysics = PxCreatePhysics(PX_PHYSICS_VERSION, *mFoundation, PxTolerancesScale(),true);

    mCPUDispatcher = PxDefaultCpuDispatcherCreate(2);

    PxCudaContextManagerDesc cudaContextManagerDesc;
    mCudaContextManager = PxCreateCudaContextManager(*mFoundation,cudaContextManagerDesc,profileZoneManager);

    PxSceneDesc sceneDesc(mPhysics->getTolerancesScale());
    sceneDesc.gravity = PxVec3(0.0f, -9.81f, 0.0f);
    sceneDesc.cpuDispatcher	= mCPUDispatcher;
    <b>CRASH HERE ---></b> sceneDesc.gpuDispatcher = mCudaContextManager->getGpuDispatcher();
    sceneDesc.filterShader	= PxDefaultSimulationFilterShader;
    sceneDesc.flags = PxSceneFlag::eENABLE_ACTIVETRANSFORMS;
    mScene = mPhysics->createScene(sceneDesc);
    mCooking = PxCreateCooking(PX_PHYSICS_VERSION, *mFoundation, PxCookingParams(PxTolerancesScale()));
    mControllerManager = PxCreateControllerManager(*mScene);

From first glance everything with the CUDA context manager seems ok. I would suggest putting a breakpoint in your code and checking to see if its actually created. Also what HW are you running on.

CUDA is Nvidia proprietary so if you are not using a Nvidia GPU, it will not work. Also what version of the drivera are you using?

Searching the net I read that GPU Physx 3.3.2 only works with gpu Fermi and higher …
Damn, my gpu is a Nvidia GTS250 and I think that is not supported (it’s a bit old) …

Driver Version : 340.46

I ask for confirmation …

Yes, I think you will have to use a more recent card. However the function calls should be returning an error code that will indicate that the driver or GPU is not up to spec.

Thank you all for the answers …
Now I have everything clear.