如何在Windows上部署CUDA程序?
我有一个链接到 cuda
、cublas
和 cudart
的程序。
有没有一种方法可以在不强制用户安装最新的 nvidia 驱动程序的情况下部署它?
当我将提到的 dll 复制到启动路径中时,程序无法启动并抱怨 nvcuda.dll
中不存在程序。即使我也提供这个,该程序的行为也很奇怪。如果安装了最新的驱动程序,一切正常。
相关问题...我如何检查cuda是否受支持(+最新),如果不是这种情况,则回退到我的情况BLAS/LAPACK?如果我提供 dll 程序。行为不端,如果我不提供它们,它甚至可能无法启动。
谢谢!
I have a program linking against cuda
, cublas
, and cudart
.
Is there a way to deploy it without forcing the users to install the very latest nvidia drivers?
When I just copy the mentioned dlls into the startup path, the program doesn't start and complains about a non-existent procedure in nvcuda.dll
. Even if I supply this one as well, the program behaves strangely. If the most recent drivers are installed, everything works fine.
Related question ... how can I check that cuda is supported (+ up to date) and if this is not the case fallback into my case BLAS/LAPACK? If I provide the dlls the prog. misbehaves, if I don't supply them it might not even start.
Thx!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试不链接 CUDA dll,而是动态加载并调用 cudaGetDeviceCount()?像这样:
这很不方便,因为您不能只链接到 cudart 或其他库,但它可能允许您回退到 BLAS,而不会导致用户看到可怕的启动错误。免责声明:我没有测试甚至编译此代码,如果您使用它并且它有效,请告诉我们:)
此线程 建议您必须从特定版本的 CUDA 工具包(例如 cudart64_40_17.dll)重新分发 dll,这样就可以了。
Did you try not to link against CUDA dlls, but load dynamically and call cudaGetDeviceCount()? Like this:
It's inconvenient because you can't just link against cudart or other libraries, but it may allow you to fallback to BLAS without user seeing horrible startup errors. Disclaimer: I didn't test or even compile this code, please let us know if you use it and it works :)
This thread suggests you have to redistribute dlls from your particular version of the CUDA toolkit (e.g. cudart64_40_17.dll), so that's fine.