Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Add OpenXRRemoting external project #2

Merged
merged 27 commits into from
Aug 28, 2023

Conversation

jcfr
Copy link
Contributor

@jcfr jcfr commented Apr 7, 2023

Download v2.9.1 of Microsoft.Holographic.Remoting.OpenXR

References:

@jcfr jcfr linked an issue Apr 7, 2023 that may be closed by this pull request
5 tasks
@jcfr jcfr force-pushed the integrate-microsoft-holographic-remoting branch 5 times, most recently from 648006e to 43c3a46 Compare April 10, 2023 04:03
@jcfr
Copy link
Contributor Author

jcfr commented Apr 28, 2023

Running the emulator requires special permission:

@jcfr
Copy link
Contributor Author

jcfr commented Apr 28, 2023

Notes on installing Visual Studio components to support building the "player" application referenced in the VTK - OpenXR Holographic Remoting documentation1.

See https://discourse.slicer.org/t/windows-preview-build-delayed-visual-studio-2022-updates/29045

Footnotes

  1. https://docs.vtk.org/en/latest/vtk_modules/vtk-modules/Rendering/OpenXRRemoting/README.html

@jcfr
Copy link
Contributor Author

jcfr commented Apr 28, 2023

Step by step

  1. Starts the emulator

  2. Open the solution associate with the player application. After it has been built (see below), it reports the following in the Visual Studio output tab.

    ConfigurationParser/Constructor/EnumerateEmulators: START
        NumberOfDevicesFound = 1
        ConfigurationParser/Constructor/EnumerateEmulators/Emulator
    	    Id = 32b69331-0d59-2dec-951b-9b4e72ae9a2a
    	    Name = HoloLens 2 Emulator 10.0.20348.1535
    	    Type = Emulator
    	    Version = 10.0.20348.1535
    	    UwpVersion = 10.0.20348.1535
    ConfigurationParser/Constructor/EnumerateEmulators: END (Success, 0:00:00.146)
    ConfigurationParser/Constructor: END (Success, 0:00:00.218)
    IsEmulatorSupported: START
        Is64BitOperatingSystem = True
    DetectSlat: START
        isHyperVRunning = True
    DetectSlat: END (Success, 0:00:00.105)
        SlatState = SlatAndHWVEnabled
        IsEmulatorSupported = True
    IsEmulatorSupported: END (Success, 0:00:00.109)
    
  3. After attempting to start debugging session to run the player app on the emulator, we only see the option Download New emulators

Building the player app

References

Prerequisites

Update Visual Studio 2022 installation (Tools -> Get Tools and Features):

  • MSVC v143 - VS 2022 C++ ARM64 build tools (Latest)
  • MSVC v143 - VS 2022 C++ ARM64 Spectre-mitigated libs (Latest)
  • C++ Universal Windows Platform support for v143 build tools (ARM64)

To address the error message "Sorry, something went wrong"`, see these instructions.

Building

On Windows, build the "player application"

git clone https://github.com/microsoft/MixedReality-HolographicRemoting-Samples

Open player/sample/SamplePlayer.sln with right-click and select Open With -> Visual Studio 2022

On first use, right-click the solution and select Restore NuGet Packages

Select Release

@jcfr jcfr force-pushed the integrate-microsoft-holographic-remoting branch from 071a631 to 30541a4 Compare May 19, 2023 10:41
Fixes:
```
Exception thrown: read access violation.
this was nullptr.
Call stack: vtkRendering-9.1.dll!vtkRenderer::SetActiveCamera(vtkCamera * cam) Line 770	C++
```
When using remoting, the OpenXR loader must be built dynamically to allow
the remoting package to override this loader at runtime.
(see RemotingXR.json)

Fixes:
```
ERROR [GENERAL | xrGetInstanceProcAddr | OpenXR-Loader]:
  No active xrInstance handle.
```
Fixes:
Unable to open openXR action file :
  [...]/externals/vtkRenderingOpenXRvtk_openxr_actions.json
Ensure that the "openxr_loader.dll" library is found when loading
the MixedReality module from a build tree using the
"SlicerWithSlicerMixedReality.exe" launcher.
@jcfr
Copy link
Contributor Author

jcfr commented Aug 25, 2023

Pull request implementing useful changes:

VTK_INSTALL_RUNTIME_DIR or VTK_INSTALL_LIBRARY_DIR CMake variables
were completely removed in VTK 9.1.
List of changes:

$ git shortlog 10d08094..b03e854a4 --no-merges
Jean-Christophe Fillion-Robin (3):
      Add SuperBuild support
      Remove redundant BUILD_TESTING option
      COMP: Support configuring install directories
Adapted from KitwareMedical/SlicerVirtualReality@a4d465b73

Remove the "externals" sub-directory that was specific to
branch Slicer/VTK@slicer-v9.1.20220125-efbe2afc2 integrating
commit Slicer/VTK@0ba7af630 ([Backport MR-8123] vtk_module_build: Ensure
external modules build directory are not overwritten)

Since the approach originally proposed in VTK MR-8123 was superseded by
MR-9097 there is no need to specify the "externals" sub-directory.
@jcfr
Copy link
Contributor Author

jcfr commented Aug 26, 2023

Pull request implementing required changed:

Especially the backport of MR-10452: OpenXR: Consistently name manifest install sub-directory

@jcfr jcfr force-pushed the integrate-microsoft-holographic-remoting branch 8 times, most recently from fa3d863 to ac01e64 Compare August 28, 2023 01:47
Note that the vtkMixedRealityViewInteractorStyle still derives
from vtkOpenXRInteractorStyle whereas the VirtualReality counterpart
derives from vtkMRMLViewInteractorStyle.
@jcfr jcfr force-pushed the integrate-microsoft-holographic-remoting branch 4 times, most recently from 290c64c to 45a8513 Compare August 28, 2023 03:30
@jcfr jcfr force-pushed the integrate-microsoft-holographic-remoting branch from a4685f5 to c8cdf68 Compare August 28, 2023 05:05
@jcfr jcfr merged commit 3ae5ff3 into main Aug 28, 2023
@jcfr jcfr deleted the integrate-microsoft-holographic-remoting branch August 28, 2023 05:08
@jcfr
Copy link
Contributor Author

jcfr commented Aug 28, 2023

The extension can now be built on Windows (and even packaged & installed) without requiring the developer to copy files and libraries.

Next step we will need to refactor SlicerVirtualReality extension so that relevant functionalities can be reused while minimizing duplication:

We will also have to improve the OpenXR integration so that we can retrieve the position of each controllers & trackers:

cc: @LucasGandel @lassoan @cpinter @adamrankin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add external project to build vtkRenderingOpenXRRemoting
2 participants