Pergunta

I'm implementing fluid simulator using PhysiX. Unfortunately sth is wrong with cuda context manager and I have a problem with recognizing what it is. I have an init method which looks like this:

void InitializePhysX() {
    bool recordMemoryAllocations = true;
    const bool useCustomTrackingAllocator = true;

    PxAllocatorCallback* allocator = &gDefaultAllocatorCallback;
    PxErrorCallback* error = &gDefaultErrorCallback;
    PxFoundation* mFoundation = PxCreateFoundation(PX_PHYSICS_VERSION, *allocator, *error);
    if(!mFoundation)
            printf("PxCreateFoundation failed!\n");
    PxProfileZoneManager* mProfileZoneManager = &PxProfileZoneManager::createProfileZoneManager(mFoundation);
    if(!mProfileZoneManager)
            printf("PxProfileZoneManager::createProfileZoneManager failed!\n");
#ifdef PX_WINDOWS
    pxtask::CudaContextManagerDesc cudaContextManagerDesc;
    pxtask::CudaContextManager* mCudaContextManager = pxtask::createCudaContextManager(*mFoundation, cudaContextManagerDesc, mProfileZoneManager);
    if( mCudaContextManager ){
            if( !mCudaContextManager->contextIsValid() ){
                    mCudaContextManager->release();
                    mCudaContextManager = NULL;
                    printf("invalid context\n");
            }
    } else {
            printf("create cuda context manager failed\n");
    }
#endif
    mPhysX = PxCreatePhysics(PX_PHYSICS_VERSION, *mFoundation, PxTolerancesScale(), recordMemoryAllocations, mProfileZoneManager);
    if(!mPhysX)
            printf("PxCreatePhysics failed!\n");
    ...
}

When I try to run my application it occures that mCudaContextManger is never created properly. "create cuda context manager failed" is being wrote on the console and:

"....\LowLevel\software\src\PxsContext.cpp (1122) : warning : GPU operation faied. No px::CudaContextManager available. ....\SimulationController\src\particles\ScParticleSystemSim.cpp (73) : warning : GPU particle system creation failed. Falling back to CPU implementation."

I have GeForce560Ti with newest driver (error also shows up on GeForce460 on my friend's laptop). Physix is set to use GPU in NVidia Control Panel.

Does anybody know what we made wrong and how to make GPU work? Thanks in advance!

Foi útil?

Solução

File PhysX3Gpu_x86.dll was missing. I added it and now everything is fine.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top