Unity VM 崩溃(看起来像加速问题)

Posted

技术标签:

【中文标题】Unity VM 崩溃(看起来像加速问题)【英文标题】:Unity VM crash (looks like acceleration issue) 【发布时间】:2021-01-04 09:25:11 【问题描述】:

在 Hyper-V 虚拟机上运行 Unity 项目时出现问题。长话短说,我的 Unity 项目在我的 PC 上运行,但不能在 VM 上运行。我在这里详细描述了这一点:

https://***.com/q/65550732/5709159.

我发现了一个崩溃日志,其中 Unity 编写了所有内容。因为我可以在堆栈溢出时发布的字符数有限制,所以我在这里上传了完整文件:https://drive.google.com/file/d/1xAtTUytNGH7WFSSIr8WGotCDrvQKW9f-/view,在这里我只是发布了这个文件的最后一部分:


 ...


    GetAllGuidsForCategorization: 0.097ms
    CategorizeAssets: 17.293ms
    ImportAndPostprocessOutOfDateAssets: 1693.143ms (1617.367ms without children)
        CompileScripts: 75.401ms
        PostProcessAllAssets: 0.000ms
        EnsureUptoDateAssetsAreRegisteredWithGuidPM: 0.092ms
        InitializingProgressBar: 0.011ms
        PostProcessAllAssetNotificationsAddChangedAssets: 0.150ms
        RestoreLoadedAssetsState: 0.119ms
    ReloadSourceAssets: 0.143ms
    UnloadImportedAssets: 0.003ms
    Hotreload: 0.520ms
    FixTempGuids: 0.003ms
    GatherAllCurrentPrimaryArtifactRevisions: 0.000ms
    UnloadStreamsBegin: 1.003ms
    LoadedImportedAssetsSnapshotReleaseGCHandles: 0.003ms
    GetLoadedSourceAssetsSnapshot: 0.152ms
    PersistCurrentRevisions: 0.207ms
    UnloadStreamsEnd: 5.491ms
    GenerateScriptTypeHashes: 0.056ms
    Untracked: 7.164ms
Application.AssetDatabase Initial Script Refresh End
Application.AssetDatabase.Refresh Start
Refresh completed in 0.024548 seconds.
RefreshInfo: RefreshV2(ForceSynchronousImport) scanfilter: 
RefreshProfiler: Total: 24.529ms
Application.AssetDatabase.Refresh End
RefreshInfo: StopAssetImportingV2(ForceSynchronousImport) scanfilter: 
RefreshProfiler: Total: 8.669ms
Refresh completed in 0.023319 seconds.
RefreshInfo: RefreshV2(NoUpdateAssetOptions) scanfilter: 
RefreshProfiler: Total: 23.298ms
Launched and connected shader compiler UnityShaderCompiler.exe after 0.04 seconds
Initializing Unity extensions:
Unloading 52 Unused Serialized files (Serialized files now loaded: 0)
ProgressiveSceneManager::Cancel()
Loaded scene 'Assets/co Player/Scenes/SampleScene.unity'
    Deserialize:            2.830 ms
    Integration:            5.376 ms
    Integration of assets:  0.004 ms
    Thread Wait Time:       38.134 ms
    Total Operation Time:   46.344 ms
System memory in use before: 71.8 MB.
System memory in use after: 71.1 MB.

Unloading 77 unused Assets to reduce memory usage. Loaded Objects now: 1590.
Total: 2.199700 ms (FindLiveObjects: 0.146600 ms CreateObjectMapping: 0.036000 ms MarkObjects: 1.540400 ms  DeleteObjects: 0.475200 ms)

[MODES] ModeService[none].Initialize
[MODES] ModeService[none].LoadModes
[MODES] Loading mode Default (0) for mode-current-id-StreamingSample
[LAYOUT] About to load Library/CurrentLayout-default.dwlt, keepMainWindow=False
<RI> Initialized touch support.

<RI> Initialized touch support.

<RI> Initialized touch support.

<RI> Initialized touch support.

<RI> Initialized touch support.

<RI> Initialized touch support.

<RI> Initialized touch support.

<RI> Initialized touch support.

[MODES] ModeService[default].InitializeCurrentMode
[MODES] ModeService[default].UpdateModeMenus
<RI> Initializing input.

XInput1_3.dll not found. Trying XInput9_1_0.dll instead...
<RI> Input initialized.

Dedicated video D3D11 device creation failed (error: 0x887a0004). This device is used specifically for video decoding, we will use software video decoding instead.[Project] Loading completed in 8.659 seconds
    Project init time:              0.617 seconds
        Template init time:         0.000 seconds
        Package Manager init time:      0.000 seconds
        Asset Database init time:       0.000 seconds
        Global illumination init time:  0.000 seconds
        Assemblies load time:           0.000 seconds
        Unity extensions init time:     0.001 seconds
        Asset Database refresh time:    0.000 seconds
    Scene opening time:             0.941 seconds
Created GICache directory at C:/Users/aleks/AppData/LocalLow/Unity/Caches/GiCache. Took: 0.026s, timestamps: [8.667 - 8.693]
gi::BakeBackendSwitch: switching bake backend from 3 to 1.
Setting up 2 worker threads for Enlighten.
  Thread -> id: 1ee8 -> priority: 1 
  Thread -> id: 6d0 -> priority: 1 
TrimDiskCacheJob: Current cache size 0mb
<RI> Initialized touch support.

Reloading assemblies for play mode.
Begin MonoManager ReloadAssembly
Native extension for WindowsStandalone target not found
Refreshing native plugins compatible for Editor in 2.90 ms, found 7 plugins.
Preloading 0 native plugins for Editor in 0.00 ms.
Invoked RoslynAnalysisRunner static constructor.
RoslynAnalysisRunner will not be running.
RoslynAnalysisRunner has terminated.
[MODES] ModeService[none].Initialize
[MODES] ModeService[none].LoadModes
[MODES] Loading mode Default (0) for mode-current-id-StreamingSample
Mono: successfully reloaded assembly
- Completed reload, in  0.953 seconds
Platform modules already initialized, skipping
Loaded scene 'Temp/__Backupscenes/0.backup'
    Deserialize:            0.808 ms
    Integration:            14.881 ms
    Integration of assets:  0.002 ms
    Thread Wait Time:       18.473 ms
    Total Operation Time:   34.164 ms
TAG :: co_DecoderStream::init_model_by_path, message :: coStreamRender SOUND error, AudioChunks not found
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:Log (object)
coCAPI:DebugMethod (string,string) (at Assets/co Player/Runtime/Scripts/coCAPI.cs:48)
coStreamFile:Open (string) (at Assets/co Player/Runtime/Scripts/coStream.cs:59)
coStreamComposite:Open (string) (at Assets/co Player/Runtime/Scripts/coStream.cs:221)
coPlayer:StartStream (string) (at Assets/co Player/Runtime/Scripts/coPlayer.cs:289)
coPlayerGpu:StartStream (string) (at Assets/co Player/Runtime/Scripts/coPlayerGpu.cs:55)
coPlayer/<Start>d__65:MoveNext () (at Assets/co Player/Runtime/Scripts/coPlayer.cs:319)
UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr)

(Filename: Assets/co Player/Runtime/Scripts/coCAPI.cs Line: 48)

TAG :: co_DecoderStream::load_thread_main, message :: >>> DecodeVideo 0 To 60
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:Log (object)
coCAPI:DebugMethod (string,string) (at Assets/co Player/Runtime/Scripts/coCAPI.cs:48)

(Filename: Assets/co Player/Runtime/Scripts/coCAPI.cs Line: 48)

[AVHWFramesContext @ 00000126dd07e600] Could not create the surfaces
[AVHWFramesContext @ 00000126dd07e600] Error creating an internal frame pool
[h264 @ 00000126dd07d5c0] Failed setup for format dxva2_vld: hwaccel initialisation returned error.
Failed to get HW surface format.
[h264 @ 00000126dd07d5c0] decode_slice_header error
[h264 @ 00000126dd07d5c0] no frame!
co_FFmpegDecoder::DecodeFrameImp: error (-1094995529 - AVERROR_INVALIDDATA) in avcodec_send_packet
Stacktrace:


=================================================================
Got a SIGFPE while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

Crash!!!
SymInit: Symbol-SearchPath: 'C:/Program Files/Unity/Hub/Editor/2020.2.1f1/Editor/Data/Mono;.;C:\Users\aleks\Downloads\new_zips\coUnity\co_unity\co_unity\coSample;C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor;C:\Windows;C:\Windows\system32;SRV*C:\websymbols*http://msdl.microsoft.com/download/symbols;', symOptions: 534, UserName: 'aleks'
OS-Version: 10.0.0
C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Unity.exe:Unity.exe (00007FF6E23C0000), size: 134111232 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2020.2.1.3544
C:\Windows\SYSTEM32\ntdll.dll:ntdll.dll (00007FFED2B10000), size: 2056192 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.662
C:\Windows\System32\KERNEL32.DLL:KERNEL32.DLL (00007FFED0C50000), size: 774144 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.662
C:\Windows\System32\KERNELBASE.dll:KERNELBASE.dll (00007FFED0570000), size: 2920448 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.662
C:\Windows\System32\CRYPT32.dll:CRYPT32.dll (00007FFED0410000), size: 1429504 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\System32\ucrtbase.dll:ucrtbase.dll (00007FFED0870000), size: 1048576 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\System32\USER32.dll:USER32.dll (00007FFED1870000), size: 1703936 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.685
C:\Windows\System32\win32u.dll:win32u.dll (00007FFED0840000), size: 139264 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.662
C:\Windows\System32\GDI32.dll:GDI32.dll (00007FFED1840000), size: 172032 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.685
C:\Windows\System32\gdi32full.dll:gdi32full.dll (00007FFED02A0000), size: 1085440 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.685
C:\Windows\System32\msvcp_win.dll:msvcp_win.dll (00007FFED0AD0000), size: 643072 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\System32\ADVAPI32.dll:ADVAPI32.dll (00007FFED2100000), size: 704512 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.610
C:\Windows\System32\msvcrt.dll:msvcrt.dll (00007FFED22B0000), size: 647168 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 7.0.19041.546
C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\libfbxsdk.dll:libfbxsdk.dll (00007FFE84120000), size: 8974336 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2020.0.0.0
C:\Windows\System32\sechost.dll:sechost.dll (00007FFED21B0000), size: 638976 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.662
C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\optix.6.0.0.dll:optix.6.0.0.dll (00007FFEA1480000), size: 208896 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 6.0.0.0
C:\Windows\System32\RPCRT4.dll:RPCRT4.dll (00007FFED1AA0000), size: 1224704 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.662
C:\Windows\System32\SHELL32.dll:SHELL32.dll (00007FFED0F40000), size: 7610368 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.662
C:\Windows\System32\SHLWAPI.dll:SHLWAPI.dll (00007FFED2540000), size: 348160 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\System32\ole32.dll:ole32.dll (00007FFED2400000), size: 1220608 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\System32\combase.dll:combase.dll (00007FFED1D00000), size: 3497984 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.662
C:\Windows\System32\IMM32.dll:IMM32.dll (00007FFED2350000), size: 196608 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\umbraoptimizer64.dll:umbraoptimizer64.dll (00007FFE9E130000), size: 1306624 (result: 0), SymType: '-deferred-', PDB: ''
C:\Windows\System32\SETUPAPI.dll:SETUPAPI.dll (00007FFED2660000), size: 4616192 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\System32\WS2_32.dll:WS2_32.dll (00007FFED2060000), size: 438272 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\OpenImageDenoise.dll:OpenImageDenoise.dll (00007FFE81750000), size: 43806720 (result: 0), SymType: '-deferred-', PDB: ''
C:\Windows\System32\cfgmgr32.dll:cfgmgr32.dll (00007FFED0250000), size: 319488 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\System32\WLDAP32.dll:WLDAP32.dll (00007FFED1BD0000), size: 352256 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\System32\bcrypt.dll:bcrypt.dll (00007FFED0A20000), size: 159744 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.662
C:\Windows\System32\Normaliz.dll:Normaliz.dll (00007FFED20F0000), size: 32768 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\System32\OLEAUT32.dll:OLEAUT32.dll (00007FFED1C30000), size: 839680 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\FreeImage.dll:FreeImage.dll (0000000180000000), size: 6414336 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 3.18.0.0
C:\Windows\System32\WINTRUST.dll:WINTRUST.dll (00007FFED03B0000), size: 393216 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.662
C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\ispc_texcomp.dll:ispc_texcomp.dll (00007FFE9BD80000), size: 1609728 (result: 0), SymType: '-deferred-', PDB: ''
C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\WinPixEventRuntime.dll:WinPixEventRuntime.dll (00007FFEAAB80000), size: 45056 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 1.0.1812.6001
C:\Windows\SYSTEM32\OPENGL32.dll:OPENGL32.dll (00007FFEA40A0000), size: 1200128 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\SYSTEM32\GLU32.dll:GLU32.dll (00007FFEC56F0000), size: 180224 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\SYSTEM32\IPHLPAPI.DLL:IPHLPAPI.DLL (00007FFECF660000), size: 241664 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\SYSTEM32\VCRUNTIME140.dll:VCRUNTIME140.dll (00007FFEC6600000), size: 94208 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 14.0.23026.0
C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\tbb.dll:tbb.dll (00007FFE9F5A0000), size: 413696 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2017.0.2016.1004
C:\Windows\SYSTEM32\WINHTTP.dll:WINHTTP.dll (00007FFEC7A70000), size: 1048576 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\SYSTEM32\WINMM.dll:WINMM.dll (00007FFEB70F0000), size: 159744 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\SYSTEM32\HID.DLL:HID.DLL (00007FFECEB60000), size: 53248 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\RadeonImageFilters.dll:RadeonImageFilters.dll (00007FFE814E0000), size: 2535424 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 1.5.1.0
C:\Windows\SYSTEM32\VERSION.dll:VERSION.dll (00007FFEC8110000), size: 40960 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\SketchUpAPI.dll:SketchUpAPI.dll (00007FFE80C50000), size: 8978432 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 19.0.753.0
C:\Windows\SYSTEM32\WSOCK32.dll:WSOCK32.dll (00007FFEC7380000), size: 36864 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.1
C:\Windows\SYSTEM32\MSVCP140.dll:MSVCP140.dll (00007FFEBFF70000), size: 647168 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 14.0.23026.0
C:\Windows\SYSTEM32\CRYPTBASE.DLL:CRYPTBASE.DLL (00007FFECFB60000), size: 49152 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\SYSTEM32\MSVCP120.dll:MSVCP120.dll (00007FFEB7210000), size: 679936 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 12.0.21005.1
C:\Windows\SYSTEM32\MSVCR120.dll:MSVCR120.dll (00007FFEBC2B0000), size: 978944 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 12.0.21005.1
C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\SketchUpCommonPreferences.dll:SketchUpCommonPreferences.dll (00007FFE9BD00000), size: 483328 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 19.0.753.20342
C:\Windows\SYSTEM32\Secur32.dll:Secur32.dll (00007FFEBB4D0000), size: 49152 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\SYSTEM32\SSPICLI.DLL:SSPICLI.DLL (00007FFED0130000), size: 245760 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.662
C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\OpenRL.dll:OpenRL.dll (00000126BA720000), size: 12779520 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 1.5.100.0
C:\Windows\SYSTEM32\MSVCP100.dll:MSVCP100.dll (00000000677B0000), size: 622592 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.30319.1
C:\Windows\SYSTEM32\MSVCR100.dll:MSVCR100.dll (00000000676D0000), size: 856064 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.30319.1
C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\embree.dll:embree.dll (00007FFE7FC60000), size: 16711680 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2.14.0.0
C:\Windows\SYSTEM32\MSWSOCK.DLL:MSWSOCK.DLL (00007FFECF970000), size: 434176 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\OpenRL_pthread.dll:OpenRL_pthread.dll (00000126BB370000), size: 61440 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2.9.0.0
C:\Windows\SYSTEM32\MSASN1.dll:MSASN1.dll (00007FFECFD70000), size: 73728 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\SYSTEM32\kernel.appcore.dll:kernel.appcore.dll (00007FFECE1C0000), size: 73728 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\System32\bcryptPrimitives.dll:bcryptPrimitives.dll (00007FFED0A50000), size: 524288 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.662
C:\Windows\system32\uxtheme.dll:uxtheme.dll (00007FFECDD00000), size: 647168 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.610
C:\Windows\System32\shcore.dll:shcore.dll (00007FFED0E30000), size: 712704 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.662
C:\Windows\SYSTEM32\windows.storage.dll:windows.storage.dll (00007FFECE3C0000), size: 7950336 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.662
C:\Windows\SYSTEM32\Wldp.dll:Wldp.dll (00007FFECFBF0000), size: 180224 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.662
C:\Windows\SYSTEM32\profapi.dll:profapi.dll (00007FFED0180000), size: 155648 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\System32\clbcatq.dll:clbcatq.dll (00007FFED25A0000), size: 692224 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2001.12.10941.16384
C:\Windows\system32\wbem\wbemprox.dll:wbemprox.dll (00007FFEBBE30000), size: 69632 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.610
C:\Windows\SYSTEM32\wbemcomn.dll:wbemcomn.dll (00007FFEC0AD0000), size: 548864 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\system32\wbem\wbemsvc.dll:wbemsvc.dll (00007FFEBBD90000), size: 81920 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.610
C:\Windows\system32\wbem\fastprox.dll:fastprox.dll (00007FFEBBA20000), size: 1093632 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\SYSTEM32\amsi.dll:amsi.dll (00007FFEBBD70000), size: 102400 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.610
C:\Windows\SYSTEM32\USERENV.dll:USERENV.dll (00007FFED0100000), size: 188416 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.572
C:\ProgramData\Microsoft\Windows Defender\platform\4.18.2011.6-0\MpOav.dll:MpOav.dll (00007FFEBB900000), size: 495616 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 4.18.2011.6
C:\Windows\SYSTEM32\CRYPTSP.dll:CRYPTSP.dll (00007FFECFB40000), size: 98304 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\system32\rsaenh.dll:rsaenh.dll (00007FFECF300000), size: 212992 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\System32\imagehlp.dll:imagehlp.dll (00007FFED20D0000), size: 118784 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\SYSTEM32\gpapi.dll:gpapi.dll (00007FFECEB70000), size: 143360 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.572
C:\Windows\System32\cryptnet.dll:cryptnet.dll (00007FFEAA950000), size: 200704 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\SYSTEM32\WINNSI.DLL:WINNSI.DLL (00007FFEC9830000), size: 45056 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\System32\NSI.dll:NSI.dll (00007FFED2530000), size: 32768 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.610
C:\Windows\System32\MSCTF.dll:MSCTF.dll (00007FFED0D10000), size: 1138688 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.662
C:\Windows\SYSTEM32\textinputframework.dll:textinputframework.dll (00007FFEB9B90000), size: 1036288 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.662
C:\Windows\SYSTEM32\CoreMessaging.dll:CoreMessaging.dll (00007FFECD900000), size: 991232 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.610
C:\Windows\SYSTEM32\CoreUIComponents.dll:CoreUIComponents.dll (00007FFECD4C0000), size: 3530752 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\SYSTEM32\ntmarta.dll:ntmarta.dll (00007FFECEF90000), size: 208896 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\SYSTEM32\wintypes.dll:wintypes.dll (00007FFECCDF0000), size: 1400832 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.662
C:\Windows\System32\netprofm.dll:netprofm.dll (00007FFECAE60000), size: 253952 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.630
C:\Windows\System32\npmproxy.dll:npmproxy.dll (00007FFEC7880000), size: 65536 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.630
C:\Windows\SYSTEM32\dhcpcsvc6.DLL:dhcpcsvc6.DLL (00007FFEC97B0000), size: 94208 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\SYSTEM32\dhcpcsvc.DLL:dhcpcsvc.DLL (00007FFEC9720000), size: 118784 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\SYSTEM32\DNSAPI.dll:DNSAPI.dll (00007FFECF6A0000), size: 831488 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.610
C:\Windows\System32\fwpuclnt.dll:fwpuclnt.dll (00007FFEC7B80000), size: 520192 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\System32\rasadhlp.dll:rasadhlp.dll (00007FFEC7770000), size: 40960 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\system32\explorerframe.dll:explorerframe.dll (00007FFEB31C0000), size: 2232320 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.488_none_ca04af081b815d21\comctl32.dll:comctl32.dll (00007FFEB4E90000), size: 2732032 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 6.10.19041.488
C:\Windows\SYSTEM32\TextShaping.dll:TextShaping.dll (00007FFEB51D0000), size: 704512 (result: 0), SymType: '-deferred-', PDB: ''
C:\Windows\System32\MMDevApi.dll:MMDevApi.dll (00007FFEC8550000), size: 544768 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\System32\DEVOBJ.dll:DEVOBJ.dll (00007FFECFF30000), size: 180224 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\SYSTEM32\d3d11.dll:d3d11.dll (00007FFECC5C0000), size: 2506752 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\SYSTEM32\dxgi.dll:dxgi.dll (00007FFECEBA0000), size: 995328 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\SYSTEM32\d3d10warp.dll:d3d10warp.dll (00007FFEC8FE0000), size: 7299072 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\SYSTEM32\dxcore.dll:dxcore.dll (00007FFEC9770000), size: 241664 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\radeonrays.dll:radeonrays.dll (00007FFEC0030000), size: 552960 (result: 0), SymType: '-deferred-', PDB: ''
C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\MonoBleedingEdge\EmbedRuntime\mono-2.0-bdwgc.dll:mono-2.0-bdwgc.dll (00007FFE9D4F0000), size: 7790592 (result: 0), SymType: '-deferred-', PDB: ''
C:\Windows\System32\PSAPI.DLL:PSAPI.DLL (00007FFED2650000), size: 32768 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\system32\apphelp.dll:apphelp.dll (00007FFECDB30000), size: 589824 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.572
C:\Windows\system32\dataexchange.dll:dataexchange.dll (00007FFEB3430000), size: 253952 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\system32\dcomp.dll:dcomp.dll (00007FFECCF50000), size: 1994752 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.662
C:\Windows\system32\twinapi.appcore.dll:twinapi.appcore.dll (00007FFECB1F0000), size: 2129920 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\SYSTEM32\dwmapi.dll:dwmapi.dll (00007FFECE0B0000), size: 192512 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\SYSTEM32\xinput9_1_0.dll:xinput9_1_0.dll (00007FFEC7C10000), size: 28672 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.1
C:\Users\aleks\Downloads\new_zips\coUnity\co_unity\co_unity\coSample\Assets\co Player\Plugins\co_DecoderEngine.dll:co_DecoderEngine.dll (00007FFEC5A00000), size: 229376 (result: 0), SymType: '-deferred-', PDB: ''
C:\Users\aleks\Downloads\new_zips\coUnity\co_unity\co_unity\coSample\Assets\co Player\Plugins\swscale-5.dll:swscale-5.dll (00007FFEBDD10000), size: 614400 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 5.5.100.0
C:\Users\aleks\Downloads\new_zips\coUnity\co_unity\co_unity\coSample\Assets\co Player\Plugins\avutil-56.dll:avutil-56.dll (00007FFEA9260000), size: 1413120 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 56.31.100.0
C:\Users\aleks\Downloads\new_zips\coUnity\co_unity\co_unity\coSample\Assets\co Player\Plugins\avformat-58.dll:avformat-58.dll (00007FFE90CF0000), size: 10694656 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 58.29.100.0
C:\Windows\SYSTEM32\MFPlat.DLL:MFPlat.DLL (00007FFEADA40000), size: 1814528 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\SYSTEM32\MFReadWrite.dll:MFReadWrite.dll (00007FFEA9020000), size: 1089536 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.153
C:\Users\aleks\Downloads\new_zips\coUnity\co_unity\co_unity\coSample\Assets\co Player\Plugins\avcodec-58.dll:avcodec-58.dll (00007FFE7D5F0000), size: 40280064 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 58.54.100.0
C:\Users\aleks\Downloads\new_zips\coUnity\co_unity\co_unity\coSample\Assets\co Player\Plugins\swresample-3.dll:swresample-3.dll (00007FFEBDB90000), size: 684032 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 3.5.100.0
C:\Windows\SYSTEM32\ncrypt.dll:ncrypt.dll (00007FFECFC60000), size: 159744 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.662
C:\Windows\SYSTEM32\NTASN1.dll:NTASN1.dll (00007FFECFC20000), size: 241664 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\SYSTEM32\RTWorkQ.DLL:RTWorkQ.DLL (00007FFEADA10000), size: 196608 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:\Windows\SYSTEM32\d3d9.dll:d3d9.dll (00007FFE8E6A0000), size: 1896448 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.662
C:\Windows\SYSTEM32\dxva2.dll:dxva2.dll (00007FFECBFF0000), size: 147456 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.1
C:\Windows\SYSTEM32\dbghelp.dll:dbghelp.dll (00007FFEBF4E0000), size: 1982464 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.488

========== OUTPUTTING STACK TRACE ==================

0x00007FFEC5A0504B (co_DecoderEngine) stream_set_textures_YUV420_targets
0x00007FFEC5A04518 (co_DecoderEngine) stream_set_textures_YUV420_targets
0x00007FFEC5A06FF2 (co_DecoderEngine) stream_set_textures_YUV420_targets
0x00007FFEC5A03539 (co_DecoderEngine) stream_set_textures_YUV420_targets
0x00007FFED08914C2 (ucrtbase) configthreadlocale
0x00007FFED0C67034 (KERNEL32) BaseThreadInitThunk
0x00007FFED2B5D0D1 (ntdll) RtlUserThreadStart

========== END OF STACKTRACE ===========

A crash has been intercepted by the crash handler. For call stack and other details, see the latest crash report generated in:
 * C:/Users/aleks/AppData/Local/Temp/Unity/Editor/Crashes

如您所见,这是崩溃开始的那一行:

...
=================================================================
Got a SIGFPE while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

Crash!!!
...

据我了解,问题在于 VM 可能没有用于 h264 解码的硬件加速。我不确定 FFMPEG 解码器在没有硬件加速的情况下是否总是会失败,或者当我在 YUV 上中继时只有硬件加速输出时才会失败。

问题是,如果硬件加速确实存在问题,这是否意味着我不能使用 Hyper-V VM 来运行我的 Unity 项目?有什么解决办法吗?

【问题讨论】:

如果我查看您的日志,会发现在最终崩溃之前已经发生了很多错误......通常情况下,与声音和图形相关的事情似乎是个问题? @derHugo 您看到的关于声音的输出不相关,因为我尝试运行的具体模型没有声音,这是一个原因或这个输出,但它不应该导致崩溃。无论如何,正如我所说的那样,它可以在两台不同的机器上运行,而不能在 VM 上运行 VM 是否安装了 GPU?这很可能是一个问题 @derHugo GPU 安装了吗?在我的情况下,VM 正在我的 PC 上运行(是的)有一个 GPU,所以我希望我的 PC(有点)与 VM 共享它的 gpu,不是吗? 他使用的是 HyperV,因此 Ubuntu 指南不适用。 HyperV 有两种方法来进行 GPU 虚拟化 RemoveFX vGPU 和 DDA。出于安全考虑,RemoteFX vGPU 默认处于禁用状态。 “出于安全考虑,从 2020 年 7 月 14 日安全更新开始,所有 Windows 版本默认禁用 RemoteFX vGPU。要了解更多信息,请参阅 KB 4570006。” docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/… 如果您是这种情况,那么您必须配置 DDA。 【参考方案1】:

尝试启用或访问专用显卡/驱动程序时执行失败:

Dedicated video D3D11 device creation failed (error: 0x887a0004).
[h264 @ 00000126dd07d5c0] Failed setup for format dxva2_vld: hwaccel initialisation returned error. Failed to get HW surface format.

出于安全考虑,RemoteFX vGPU 自 2020 年 7 月 14 日起被禁用。 不过,如果您只使用受信任的软件和来源,您可以使用微软特别提供的指南 here 重新启用它。如果需要,可以在此处了解有关适配器的更多信息:here 如果您不想启用此功能,则必须配置 DDA - 正如 Grizzle 建议的那样。

如果您真的想使用 GPU 直通,我可以向您推荐 this 指南,了解在 Linux 主机系统上运行 Windows GPU 直通。

如果 Linux 主机确实不适合您,请go with this guide for DDA by microsoft。尽管请注意:它存在一些错误(例如 this 一个带有 WinServer v2019 的错误)。

微软团队甚至有一个完整的指南,找到了here。但我强烈建议使用 LinuxKVM 来处理这些东西——这取决于你。

警告:afaik GPU 在主机上被禁用,从现在开始由 VM 使用。因此,您需要忍受它,使用 noGUI(linux-server build f.e.)环境。用于主机或有 2 个 GPU(专用和 APU 样式 f.e.)。

TL;DR:您没有在 HyperV 中启用显卡,或者显卡无法正常工作。确保 D3D11 (DirectX 11) 在 VM 内部和传递的 GPU 中可用。

【讨论】:

我只是想告诉你现在没有启用适配器的选项,因为 Hyper-V UI 中不再支持此功能,无论如何我通过 PowerShell social.technet.microsoft.com/Forums/en-US/… 找到了一个解决方法的帖子,但看起来这个选项现在也被禁用了:( @Aleksey 您现在可以启用适配器。它的 EOL 是在 2021 年 2 月。在那之前,我确实已经在我的答案中发布了使用 PowerShell 的解决方法。微软表示“尽管用户可以在 2021 年 2 月之前重新启用 RemoteFX vGPU,但我们强烈建议用户寻求替代 vGPU 选项。” hm,这很奇怪,因为当我尝试通过 PowerShell 启用它时,我收到了这条消息PS C:\Users\myuser&gt; Add-VMRemoteFx3dVideoAdapter -VMName [VMUnity] WARNING: We no longer support the RemoteFX 3D video adapter. If you are still using this adapter, you may become vulnerable to security risks. Learn more (https://go.microsoft.com/fwlink/?linkid=2131976) Add-VMRemoteFx3dVideoAdapter : You do not have the required permission to complete this task. Contact the administrator of the authorization policy for the computer 'PER-ALEKSEY'.,你确定它应该有效吗? 您是否以管理员身份运行 PowerShell?

以上是关于Unity VM 崩溃(看起来像加速问题)的主要内容,如果未能解决你的问题,请参考以下文章

Azure VM的加速网络

Azure VM加速网络

计算加速度给定速度

在 Oracle virtual Box 中创建 VM 时出现“加速部分中启用了硬件虚拟化”错误

角色移动、加速 C# Unity

当prinln加速度计事件值时应用程序崩溃