MNN icon indicating copy to clipboard operation
MNN copied to clipboard

windows下是否支持GPU推理?

Open puxuntu opened this issue 1 year ago • 2 comments

我没有编译源代码,是直接使用的release 2.8.1的C++ windows包。

模型加载和config代码如下: std::shared_ptr<Interpreter> net; net.reset(Interpreter::createFromFile(modelPath)); if (net == nullptr) { MNN_ERROR("Invalid Model\n"); return 0; } ScheduleConfig config; config.type = MNN_FORWARD_CUDA; config.mode = MNN_GPU_TUNING_NORMAL | MNN_GPU_MEMORY_IMAGE; auto session = net->createSession(config); auto input = net->getSessionInput(session, nullptr);

控制台输出: Can't Find type=2 backend, use 0 instead

puxuntu avatar Apr 17 '24 12:04 puxuntu

默认发的版本支持 opencl / vulkan ,cuda 的话需要自行编译

jxt1234 avatar Apr 17 '24 12:04 jxt1234

Win32 总结 OpenGL 无法直接编译,需要 glew+ libGLES ,还需要修改不少配置和代码,勉强编译通过也不能正常运行 cuda 使用11.7 的 cudatoolkit 编译出错 opencl 可以编译和运行,benchmark相比cpu执行时间大约1/6 ---- 1/2 , 但是进程管理器里面没有提示使用 GPU vulkan 可以编译和运行,正常调用GPU (如果机器比较老不支持会自动切换到cpu)

sg0771 avatar Apr 18 '24 00:04 sg0771

Marking as stale. No activity in 60 days.

github-actions[bot] avatar Jun 17 '24 09:06 github-actions[bot]

默认发的版本支持 opencl / vulkan ,cuda 的话需要自行编译

请问下,编译出带cuda的dll后,引入后,使用报错:OSError: exception: access violation reading 0x000000000000000F,这个需要怎么解决呢?

yangy996 avatar Aug 28 '24 08:08 yangy996