Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
227 views
in Technique[技术] by (71.8m points)

c# - Unity VM crash (looks like acceleration issue)

There is a problem with run Unity project on Hyper-V virtual machine. To make a long story short, my Unity project is working on my PC, but doesn't work on a VM. I described this in detail here:

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

I found a crash log where Unity wrote everything. Because there is a restriction on number of chars that I can post on stack overflow I uploaded the full file here: https://drive.google.com/file/d/1xAtTUytNGH7WFSSIr8WGotCDrvQKW9f-/view, and here I just posted the last part of this file:


 ...


    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:UsersaleksDownloads
ew_zipscoUnityco_unityco_unitycoSample;C:Program FilesUnityHubEditor2020.2.1f1Editor;C:Windows;C:Windowssystem32;SRV*C:websymbols*http://msdl.microsoft.com/download/symbols;', symOptions: 534, UserName: 'aleks'
OS-Version: 10.0.0
C:Program FilesUnityHubEditor2020.2.1f1EditorUnity.exe:Unity.exe (00007FF6E23C0000), size: 134111232 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2020.2.1.3544
C:WindowsSYSTEM32
tdll.dll:ntdll.dll (00007FFED2B10000), size: 2056192 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.662
C:WindowsSystem32KERNEL32.DLL:KERNEL32.DLL (00007FFED0C50000), size: 774144 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.662
C:WindowsSystem32KERNELBASE.dll:KERNELBASE.dll (00007FFED0570000), size: 2920448 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.662
C:WindowsSystem32CRYPT32.dll:CRYPT32.dll (00007FFED0410000), size: 1429504 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:WindowsSystem32ucrtbase.dll:ucrtbase.dll (00007FFED0870000), size: 1048576 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:WindowsSystem32USER32.dll:USER32.dll (00007FFED1870000), size: 1703936 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.685
C:WindowsSystem32win32u.dll:win32u.dll (00007FFED0840000), size: 139264 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.662
C:WindowsSystem32GDI32.dll:GDI32.dll (00007FFED1840000), size: 172032 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.685
C:WindowsSystem32gdi32full.dll:gdi32full.dll (00007FFED02A0000), size: 1085440 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.685
C:WindowsSystem32msvcp_win.dll:msvcp_win.dll (00007FFED0AD0000), size: 643072 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:WindowsSystem32ADVAPI32.dll:ADVAPI32.dll (00007FFED2100000), size: 704512 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.610
C:WindowsSystem32msvcrt.dll:msvcrt.dll (00007FFED22B0000), size: 647168 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 7.0.19041.546
C:Program FilesUnityHubEditor2020.2.1f1Editorlibfbxsdk.dll:libfbxsdk.dll (00007FFE84120000), size: 8974336 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2020.0.0.0
C:WindowsSystem32sechost.dll:sechost.dll (00007FFED21B0000), size: 638976 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.662
C:Program FilesUnityHubEditor2020.2.1f1Editoroptix.6.0.0.dll:optix.6.0.0.dll (00007FFEA1480000), size: 208896 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 6.0.0.0
C:WindowsSystem32RPCRT4.dll:RPCRT4.dll (00007FFED1AA0000), size: 1224704 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.662
C:WindowsSystem32SHELL32.dll:SHELL32.dll (00007FFED0F40000), size: 7610368 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.662
C:WindowsSystem32SHLWAPI.dll:SHLWAPI.dll (00007FFED2540000), size: 348160 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:WindowsSystem32ole32.dll:ole32.dll (00007FFED2400000), size: 1220608 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:WindowsSystem32combase.dll:combase.dll (00007FFED1D00000), size: 3497984 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.662
C:WindowsSystem32IMM32.dll:IMM32.dll (00007FFED2350000), size: 196608 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:Program FilesUnityHubEditor2020.2.1f1Editorumbraoptimizer64.dll:umbraoptimizer64.dll (00007FFE9E130000), size: 1306624 (result: 0), SymType: '-deferred-', PDB: ''
C:WindowsSystem32SETUPAPI.dll:SETUPAPI.dll (00007FFED2660000), size: 4616192 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.19041.546
C:Wind

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The execution fails when it tries to enable or access a dedicated graphics card/driver:

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.

As of July 14, 2020 RemoteFX vGPU is disabled due to security concerns. Though, if you are only using trusted software and sources, you can re-enable it with the guide microsoft is giving especially here. If you want, you can learn more about the adapter here: here If you don't want to enable this, you have to configure DDA - just as Grizzle suggested.

If you really want to use GPU passthrough, I can recommend you this guide on running a Windows GPU passthrough with a Linux host system.

If a Linux host really isn't an option for you, go with this guide for DDA by microsoft. Though be aware: There are some bugs with it (like this one with WinServer v2019).

Theres even a whole guide on this by the microsoft-team found here. But I strongly recommend to use LinuxKVM for that stuff - it's up to you.

Caveat: afaik the GPU gets disabled on the host and is used by the VM from now on. So you need to either live with that, use a noGUI (linux-server build f.e.) env. for the host or have 2 GPU's (dedicated and APU style f.e.).

TL;DR: You don't have a graphics card enabled in HyperV or it's not functioning. Ensure D3D11 (DirectX 11) is usable inside the VM and by the passed GPU.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...