【问题标题】:create cuda context manager failed创建 cuda 上下文管理器失败
【发布时间】:2013-01-04 21:40:57
【问题描述】:

我正在使用 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 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");
    ...
}

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

"....\LowLevel\software\src\PxsContext.cpp (1122):警告:GPU 操作失败。没有可用的 px::CudaContextManager。 ....\SimulationController\src\particles\ScParticleSystemSim.cpp (73):警告:GPU 粒子系统创建失败。回退到 CPU 实现。”

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

有人知道我们做错了什么以及如何让 GPU 工作吗?提前致谢!

【问题讨论】:

    标签: cuda gpu physx cuda-context


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-07-13
      • 2013-02-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-22
      • 1970-01-01
      相关资源
      最近更新 更多