【问题标题】:Deploy Blender to Azure App将 Blender 部署到 Azure 应用程序
【发布时间】:2016-08-02 15:44:38
【问题描述】:

我已将 Blender.exe 和所有相关文件复制到 Azure API App 中,然后尝试使用我的自定义 Python 脚本运行它(使用 System.Dianostics.Process()):

blender.exe --background --python myscript.py

但不能让它正常运行。请注意,它在我的本地 IIS 中运行良好。

所以问题是 Azure App 是否支持运行 Blender? (因为 Blender 可能需要有 GPU 支持的机器才能运行,而 Azure 还不支持 GPU)

如果是,那么如何查看blender.exe 命令返回的错误? (不幸的是,我无法远程桌面到Azure Api App 手动运行命令)

更新:

我可以手动使用Azure Console 命令行成功运行上面的搅拌机脚本。 但是当使用代码 System.Diagnostics.Process() 运行脚本时,它从 StandardError 流中得到了这个错误:

致命的 Python 错误:Py_Initialize: 无法初始化 sys 标准流

OSError: [WinError 6] 句柄无效

【问题讨论】:

  • 我没用过,但是有一个 project on github 可以在 azure 上运行 blender。

标签: python azure blender azure-api-apps


【解决方案1】:

@MinhNguyen,根据 Kudu 的 wiki page,由于 Win32k.sys (User32/GDI32) 的限制,包含 Api App 的 Azure App Services 不支持使用 GDI+ 的场景,但 blender 可以使用 gdi32。所以很遗憾blender不能在Azure Api App上运行,请考虑使用Azure云服务或blender虚拟机。


更新: 正如@MinhNguyen cmets 所说,搅拌机可以在 Kudu 控制台中手动运行,尽管搅拌机似乎可以与 GDI 一起使用,因为编译搅拌机需要 gdi32.lib。所以这个问题的解决方案是将blender.exe和相关的python脚本打包成一个webjob在Azure上运行。

【讨论】:

  • 谢谢。但是为什么我仍然可以在 Kudu 调试控制台中使用命令行在 Azure Api App 中运行 Blender 脚本?
  • @MinhNguyen,我搜索了编译搅拌机需要gdi32.lib,但我不确定是否只需要使用cmd运行搅拌机是否需要gdi。如果你可以在 Kudu 控制台手动运行,我想你可以尝试将它们打包成一个 webjob 来运行。
  • 谢谢@PeterPan。我将它移到 WebJob 并且它可以工作。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-09-03
  • 1970-01-01
相关资源
最近更新 更多