Jump to content

0.9.4 fails to initialize


Recommended Posts

I have recently upgraded to Unity 2019.4.16f1 and Vive Hand Tracking SDK 0.9.4.  I noticed that the hand tracking has stopped initializing properly, even on the prepackaged demo scenes.

From a blank Unity project, I did a fresh import of the hand tracking SDK, and turned on VR support and the OpenVR SDK in Player Settings, then I ran the UISample scene from the SDK's samples.  Unfortunately, no hands get shown, and the editor log does not show any problems.



OpenVR initialized! 
(Filename: C:\buildslave\unity\build\Modules/VR/OpenVR/OpenVR.cpp Line: 839)

Created eye textures with a "separate" layout.  The "multi-pass" stereo mode will be used.

[VRDevice] Successfully created device OpenVR.
Reloading assemblies for play mode.
Begin MonoManager ReloadAssembly
Native extension for iOS target not found
Native extension for Android target not found
Native extension for WindowsStandalone target not found
Refreshing native plugins compatible for Editor in 0.58 ms, found 3 plugins.
Preloading 0 native plugins for Editor in 0.00 ms.
[MODES] Loading mode Default (0) for mode-current-id-amdg3
Mono: successfully reloaded assembly
- Completed reload, in  1.652 seconds
Platform modules already initialized, skipping
Loaded scene 'Temp/__Backupscenes/0.backup'
    Deserialize:            9.539 ms
    Integration:            54.287 ms
    Integration of assets:  0.007 ms
    Thread Wait Time:       18.192 ms
    Total Operation Time:   82.025 ms
Using OpenCL device: Intel(R) OpenCL  Intel(R) HD Graphics 630  OpenCL C 2.0  
Selected ViveHandTrackingEngine
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
ViveHandTracking.<Start>d__31:MoveNext() (at Assets\ViveHandTracking\Scripts\GestureProvider.cs:147)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
(Filename: Assets/ViveHandTracking/Scripts/GestureProvider.cs Line: 147)

Unloading 7 Unused Serialized files (Serialized files now loaded: 0)
Loaded scene 'Temp/__Backupscenes/0.backup'
    Deserialize:            10.637 ms
    Integration:            31.868 ms
    Integration of assets:  0.008 ms
    Thread Wait Time:       17.707 ms
    Total Operation Time:   60.219 ms
System memory in use before: 110.7 MB.
System memory in use after: 110.9 MB.

Unloading 239 unused Assets to reduce memory usage. Loaded Objects now: 2960.
Total: 9.091400 ms (FindLiveObjects: 0.307200 ms CreateObjectMapping: 0.057100 ms MarkObjects: 8.529400 ms  DeleteObjects: 0.197100 ms)

OpenVR Shutdown 
(Filename: C:\buildslave\unity\build\Modules/VR/OpenVR/OpenVR.cpp Line: 1533)


I have verified that I am getting camera input by using a Vive controller to go to the Steam settings menu and verifying the camera feed.

Now here's the quirky part: Occasionally, when I press Home on the Vive controller, the hand suddenly gets initialized and the rest of the scene actually runs okay.  This has happened VERY few times however, and I have been unable to track a log file of when this happened.

I have also noticed that whenever the plugin is not initializing, OpenVR shutdown is taking longer than expected.  I suspect that it is waiting for unfinished calls to the Hand Tracking DLL.

I tried this with both SteamVR regular version 1.15.12 and SteamVR beta 1.15.13.



Link to comment
Share on other sites

Hi @ericvids

Indeed, thre is no error message from unity log. So I assume the hand tracking is running (or still initializing).

To run on Windows, our SDK will neeed to compile OpenCL kernels at runtime, which can be quite time consuming for the first run. This might take a few minutes before the hands can be detected. Please make sure you let the program run for a few minutes and check if hands are detected or not.

There also can be other reasons which caused detection failure. I would suggest to upgrade GPU driver to latest version from NVIDIA/AMD official site.

Link to comment
Share on other sites

Hi @zzy, you're right... I just discovered that when I let my headset sit for 5 minutes and pick it up again, the hand gestures would just start working.

It's really weird that I didn't experience this long a delay before when using the older version (or maybe I did, but it somehow got cached so subsequent startups just work... in which case, I don't know why it's not caching now).

I also noticed from my own log above that "Intel(R) OpenCL  Intel(R) HD Graphics 630" was being used for OpenCL. I'm guessing this is not normal, and that it should be using the NVIDIA driver instead?

Is it possible to include additional logging in the Unity editor to indicate the GestureProvider state switching from Starting to Running (not just on error)? This way developers can diagnose where the problem is whenever the startup time is unusually long, e.g., in my case, to alert me of the fact that my OpenCL is not working correctly.

Link to comment
Share on other sites

Hi @ericvids

Yes, it's not normal why the program picked up Intel graphics but not NVIDIA one. I would suggest to check if your NVIDIA driver and OpenCL function is installed correctly. I recommend to download the latest driver from https://www.nvidia.com/Download/index.aspx?lang=en-us

Also, thanks for your suggestion for the log. I'll add it in the next version. For now, you can modify `AssetsViveHandTracking\Scripts\Engine\ViveHandTrackingEngine.cs` (about line 127) and add the log:

if (index <= lastIndex)
if (index > 0 && lastIndex == 0) Debug.Log("Detection initialization completed");
lastIndex = index;


Link to comment
Share on other sites

Thanks for this!  I tried this just now, however I noticed that once I got the NVIDIA OpenCL driver working correctly, the "Detection initialization completed" message never shows because GetGestureResult returns a nonzero index immediately.  (Unlike with the Intel driver.)  Maybe the line should be something like this instead? (to also allow transitioning from the initial lastIndex value of -1)

if (index > 0 && lastIndex <= 0) Debug.Log("Detection initialization completed");


Edited by ericvids
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...