Access violation exception Oculus VR DK2


This python code raises vioaltion access error(last line):

import time
from ovrsdk import *

hmd = ovrHmd_Create(0)
hmdDesc = ovrHmdDesc()
ovrHmd_GetDesc(hmd, byref(hmdDesc))


  File "D:\Georgy2\mypyscripts\", line 12, in <module>
    ovrHmd_GetDesc(hmd, byref(hmdDesc))
WindowsError: exception: access violation reading 0x00001148

I've installed last version of

Technical info:

Display Driver Version:
Positional Tracker Driver Version:
Intel(R) HD Graphics
        Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz
HMD Firmware: 2.12
Connected to OVRService server.

Code is from the

I am new to python and (analogously to C case) I checked the values of hmd and hmdDesc. They are not zero:

< object at 0x02098210>
< object at 0x020983F0>

How to solve this problem? (I need simple scene to do some math with image in VR.)

p.s. I have to ask here because of Oculus Forums are not working for me. (the page does not look correct)

asked on Stack Overflow Jul 20, 2016 by ged

2 Answers


What Oculus runtime version do you have installed? The import statement and the calls you're making make it look as if you're using this library, but that hasn't been updated in two years. I'm not sure it will even work with a DK2 compatible runtime.

If you're on Windows (and only targeting windows) you should be using the 1.3 runtime at least. If you're targeting Linux and Mac, you should be using the 0.8 runtime, with the understanding that it won't work with any Windows machine running the 1.3 runtime.

In order to use those versions with Python you need to be using the cmbruns python bindings, which include a number of examples along with the bindings.

answered on Stack Overflow Jul 20, 2016 by Jherico

Like @Jherico mentioned, your code

# Where the heck did you get this, Dunaev? Not from
from ovrsdk import *

is NOT using the API from

Look at the examples over there, and do something like

import ovr
answered on Stack Overflow Nov 4, 2016 by Christopher Bruns

User contributions licensed under CC BY-SA 3.0