Does Azure allow App need OpenGL, any way to go around?

别来无恙 提交于 2019-12-11 05:13:17

问题


I was hoping to host a remote app on Azure Virtual Machine, that was developed on top of VTK using python. Every time, I got crash message says "vtkWin32OpenGLRenderWindow...GL version2.1 with the gpu_shader4 extension is not supported by your graphic driver". I tried windows server 2016 and windows 10 Virtual machine, same crash.

Is that Azure does not support to run app need OpenGl support? Unless renting super expensive N virtual machine?

Any advise how to get my app run on normal cost virtual machine without revising my program too much?


回答1:


Answer:

Azure VM in general does not have GPU, unless Azure N-series VMs: https://blogs.technet.microsoft.com/hybridcloudbp/2016/12/13/n-series-azure-vms-with-gpu/

Solution:

1)Build Mesa3D+LLvmpipe version opengl32.dll which use software rasterizer.

You may follow: https://fdossena.com/?p=mesa/build.frag to build your own or download a prebuilt opengl32.dll from internet.

2)Replace windows/system32/opengl32.dll:

Saving Mesa opengl32.dll in the same directory of application does not works - not sure why yet.

Replacing windows/ssytem32/openggl32.dll, needs changing the ownership of opengl32.dll from trustedinstaller to administrator, and assign full access right to administrator.

*Mesa3D&LLvmpipe are great! But buidling Mesa3D+LLvmpipe is a pain!




回答2:


Building Mesa from source is not so hard when the process is automated to some extent: https://github.com/pal1000/mesa-dist-win

You don't have to mess with file permissions and overwrite opengl32.dll on VMs lacking GPUs to install Mesa3D. There is a registry tweak that tells Windows to use Mesa3D as default software rasterizer. Just rename Mesa3D opengl32.dll file(s) to mesadrv.dll, drop them in windows\system32 and windows\syswow64 if applicable and then apply these registry tweaks:

  • For 64-bit applications or 32-bit applications on 32-bit Windows

REGEDIT4

; https://technet.microsoft.com/en-us/library/cc749368.aspx
; https://www.msfn.org/board/topic/143241-portable-windows-7-build-from winpe-30/page-5#entry942596
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOGL]
"DLL"="mesadrv.dll"
"DriverVersion"=dword:00000001
"Flags"=dword:00000001
"Version"=dword:00000002
  • For 32-bit applications on 64-bit Windows

REGEDIT4

; https://technet.microsoft.com/en-us/library/cc749368.aspx
; https://www.msfn.org/board/topic/143241-portable-windows-7-build-from winpe-30/page-5#entry942596
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOGL]
"DLL"="mesadrv.dll"
"DriverVersion"=dword:00000001
"Flags"=dword:00000001
"Version"=dword:00000002

Reference: https://www.mesa3d.org/llvmpipe.html



来源:https://stackoverflow.com/questions/48433641/does-azure-allow-app-need-opengl-any-way-to-go-around

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!