Search Issue Tracker

Not Reproducible

Votes

4

Found in

2019.4.12f1

Issue ID

1285479

Regression

No

[UWP] Build created via Visual Studio solution or executable outputs black screen on Immersive Headsets

XR SDK

-

[UWP] Build created via Visual Studio solution or executable outputs black screen on Immersive Headsets.

Universal Windows Platform: Built Visual Studio solution or executable outputs black screen, app fails to display minimal XR Rig scene.

Issue occurs in Unity 2019.4.11f1 (LTS), 2019.4.12f1 (LTS), 2020.1.9f1. Actual results are the same.

Steps to reproduce:
1. Build using current project settings (D3D Project) on Universal Windows Platform.
2. Open built solution in Visual Studio using the version chosen in the build settings.
3. Click on Start Debugging on Local Machine using the same build configuration (Debug and x64 for example). Rebuilding the solution does not affect the result. Changing the build configration does not help.
4. Let Visual Studio compile a build. Process usually takes around 5-10 mins.
5. An empty splash screen will be shown as the Windows Mixed Reality portal loads the build.
6. Look at the output in Visual Studio. Refer to "Bug Report Notes.txt".

Other notes:
- Can build directly to executable, but the result is still the same (and also not desirable as we require implementing a 3D app launcher).
- It seems that UnityEngine initializes and tries to start the XR subsystems but is failing for some reason.
- Out of curiosity, I created an app package for sideloading and it was successful. I then ran the Windows Certification Kit and it passed, even though the built app is broken.
- Maybe I just dont have the right configuration for Visual Studio build tools. I was prompted to install the required build tools the first time I ran Visual Studio after a build, which I did.

Expected result:
- Build should show a simple SampleScene with camera tracking in the default Unity Skybox.

Actual result:
- Black screen. Mixed Reality Motion controllers and gaze reticle are displayed in the headset which usually disappear when UnityEngine and XR systems successfully initialize (which was the case in legacy XR from Unity 2018).

Comments (8)

  1. robson_eng

    Mar 23, 2021 11:36

    In the visual studio I GIVE UP... however build and create package in visual studio, certifiy by kit install in the windows the app generated, in the NVIDIA control panel add this app with high performance....Apply and OK to execute

  2. robson_eng

    Mar 23, 2021 10:39

    I have the same issue 2020.3.0f1 works in the unity but in the visual studio BLACK SCREEN in the Headset, and pass for kit certification

  3. unity_s1c6jJSbuC7EHQ

    Feb 14, 2021 17:28

    Hello,

    Andrew, I tried to fix the black screen problem by following your directions. Unfortunately, I still see the problem.
    On the other hand, thanks to your remarks, I had the idea to customize the graphics settings of my application via the NVidia control panel: I put my application in high performance tuning.

    And in this case, my app starts fine without a black screen.

    Thanks a lot Andrew!

    It remains to be seen how to "force" the UWP application to run in high performance mode ...

    Thanks again Andrew for your directions.

  4. Andrew_S1

    Feb 13, 2021 02:26

    Found the fix:

    Visual Studio was not using the GPU to output using a D3D window.

    If anyone else encounters this, make sure you:
    In Tools > Options > Environment > General:
    - Disable "Automatically adjust visual experience based on client performance"
    - Enable rich client visual experience
    - Enable "Use hardware graphics acceleration when available".

    Also to make sure, go to your NVidia control panel, find devenv.exe and set it to run on the Nvidia GPU. Also add this in Windows Display settings > Graphics settings. Add devenv.exe there and choose high performance.

    Visual Studio will now use the same GPU that Mixed Reality portal is running on and the deployment will be successful.

    I hope this helps because I lost a lot of time trying to understand what's truly causing this. Doing a visual studio repair did not help, reinstalling didn't help. I only figured this out by comparing a log when deploying using debug mode.

    Even the Windows Certification Kit approves builds that have this black screen issue. Please make sure VS2019 is using hardware acceleration!

  5. unity_s1c6jJSbuC7EHQ

    Feb 03, 2021 21:41

    Hello,

    I am reproducing this problem as well.
    As has already been said,
    - I encountered this problem when migrating an existing project to the XR Plugin system.
    - I was also able to reproduce the problem by creating a project from scratch.

    I want to make one point clear : I create an app package for sideloading.
    - On my computer, with a pair of HP Mixed Reality Headset, I have a black screen.
    - On another computer, with a pair of Lenovo Explorer Headset, with the same package installed, no black screen!

    It seems that the problem may be related to a hardware detection ...

    I tried to create a new project using Unity 2020.2.2.f1 and the OpenXR plugin (instead of the Mixed Reality plugin).
    Always a black screen in the final UWP app.

    It's very problematic because we can't even consider upgrading our project.

    This concern is very problematic for my team, our product ... and our startup.

    It is very important for us to know whether or not this bug will be fixed one day, or if there is a workaround.

  6. Andrew_S1

    Jan 13, 2021 10:19

    Hi, I am still waiting on an update about this issue.

    I have since reinstalled Windows 10 on my PC and I am still getting the same issues above in Unity 2019.4.17.

    Would very much like some guidance on this.

  7. reedtk

    Dec 29, 2020 22:48

    I run into this same issue on 2019.4.8f1. I'm able to recreate the bug in an existing project of mine by simply installing Unity's XR Plugin Management system. After uninstalling all XR packages related to the XR Plugin system, Play mode works as expected again. The deprecated Windows Metro XR system still works as expected.

  8. AndrewSpalato

    Dec 08, 2020 01:07

    Replicated this in Unity 2019.4.16f1. Using Visual Studio 2019 with UWP and C++ build tools installed. Here are the steps:

    1. Create a new Unity project, set target platform to Universal Windows Platform.
    2. Install XR Plugin Management Package from Project Settings, enable Windows Mixed Reality plugin provider. Make sure Initialize XR on Startup is enabled.
    3. Configure scene to use XR Rig and add to scenes in build.
    4. Build settings:
    - Architecture: x64
    - Build Type: D3D Project
    - Target SDK version: Latest installed
    - Visual Studio version: Visual Studio 2019
    - Build and Run on: Local Machine
    - Build configuration: Debug
    - Copy references, copy PDB files etc all off.
    5. Build solution.
    6. Open solution in Visual Studio 2019. Make sure the relevant build tools are installed. Select Local Machine for debugging.
    7. Let Visual Studio build and deploy.
    8. See output. Deploy begins and attempts to initialize XR, but fails on initializing Meshing Subsystem and thread exits code 0.

    I have also tried the following:
    - Changing the API Compatibility Level in Unity.
    - Enabling Desktop device family in Publishing Settings.
    - Changing build configurations.

    If there is anything I am missing to create a successful deployment, please let me know.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.