创建cuda上下文管理器失败



我正在使用PhysiX实现流体模拟器。不幸的是,cuda上下文管理器有问题,我有一个问题,认识到它是什么。我有一个init方法,看起来像这样:

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 contextn");
            }
    } else {
            printf("create cuda context manager failedn");
    }
#endif
    mPhysX = PxCreatePhysics(PX_PHYSICS_VERSION, *mFoundation, PxTolerancesScale(), recordMemoryAllocations, mProfileZoneManager);
    if(!mPhysX)
            printf("PxCreatePhysics failed!n");
    ...
}

当我尝试运行我的应用程序时,发生 mcudacontextmanager 从未正确创建。"创建cuda上下文管理器失败"正在控制台上写入:

"....LowLevelsoftwaresrcPxsContext.cpp(1122):警告:GPU操作失败。没有px::CudaContextManager可用。....SimulationControllersrcparticlesScParticleSystemSim.cpp(73):警告:GPU粒子系统创建失败。回到CPU实现。"

我有最新的驱动程序GeForce560Ti(错误也显示在我朋友的笔记本电脑上的GeForce460)。在NVidia控制面板中设置phys6使用GPU。

有谁知道我们做错了什么,如何使GPU工作?提前感谢!

文件PhysX3Gpu_x86.dll丢失。我添加了它,现在一切都很好。

最新更新