Portable VR Setup


Since DriftVFX are involved in VR development, it became an issue that our desktop station is great for dev, but is a fixed location. The goal for this setup was to utilise a macbook pro to be a portable VR Solution to help us take our demos on the road for client presentation.

macBook -> viDock -> 970GTX -> Oculus Rift

This post is a tutorial by Paul of DriftVFX , for those interested in pursuing the same result.

Hardware

Firstly here is a list of the Hardware used. And Connection order

1) Macbook Pro:
Model A1286 (15 inch Mid2012).
2.6Ghz i7.
8 GbRam
GT650M onboard.

2)Thunderbolt cable

3)Sonnet Echo ExpressCard Pro
www.sonnettech.com/product/echoexpresscard34thunderbolt.html

4) viDock 4++
www.villageinstruments.com/tiki-index.php?page=ViDock

5) Gigabyte 970GTX G1 Gaming 4GD
www.gigabyte.co.nz/products/product-page.aspx?pid=5209#ov
(Note this card was chosen as it has the 6+8pin power configuration. The 980gtx has 8+8pin which is not compatibly with viDock4++)

6) DVI adapter to HDMI

7) Oculus Rift DK2

Powered USB 2 HUB.

 

Preparing the viDock eGPU

The viDock is quite simple to setup. The Gigabyte 970GTX is fairly bulky so it is a very tight fit. I managed to bend the viDock chasis slightly to be more convex to make a litle more room for the 3 fans. At the moment I am also running it upside down,as right way up one of the fans rubs. I think this can be resolved with a little more spacing/bending.
The 970GTX is a very powerful card, so Im happy that it fits and works with very minimal effort.
I removed the 2 Jumpers on the viDock board to all allow the 8 second delay on boot. (Whether this is actually needed IM not sure, but I had read that it helps, and is working for me.
The power requires the 6+6+2 power pins from viDock into the card. Plug the black 6+2 pins into the 8pin port, and the white 6pin into the 6pin port on the GPU

Testing on Windows 7

My goal is to use this on my Macbook,but first I wanted to check it works and windows is the easiest.
This setup installed almost instantly on my win7 desktop (using the village instruments viCard (PCIe to ExpressCard adapter)
www.villageinstruments.com/tiki-index.php?page=Store
All I needed to do was install the viCard (into PCIe and internal USB pins) and the latest nvidia drivers. Very easy!!
It worked and ran monitors and Oculus Rift at 75fps no problem

It also gives me a bonus ability to add this 970GTX as a second CUDA GPU source for running PhotoScan jobs. It makes a great secondary support GPU for my desktops internal 980GTX. Im pleased since it only cost an extra $25 for the viCard for this great additional benefit

 

Onto Mac OSX

This was going to be a bit more tricky. I didnt want to use Windows on my Mac if possible, and there is less information about for OSX macbook eGPU support. I went through much trial and error, but will spare the details and summarise how to make it successful.

First, depending on the GPU you have, will depend on the drivers you need. which in turn can dictate what OSX you need.
If you have below a 9xx Nvidia card you can use the 334 series Nvidia Web Drivers, which can be run on OSX 10.9 Mavericks.
However if you intend to use a 9xx series card like I did (eg my 970GTX) you need the 343 series NVIDIA drivers, which require an upgrade to OSX 10.10 Yosemite.

This tutorial will cover a 9xx card.

Note, perhaps not all the steps are needed, but these are what got me there in the end.
A lot of the steps are technical and I take no responsibility for any issues that arrive (Backup First!!)

 

Yosemite Upgrade

Follow Apples advice, by first backing up your Macbook with TimeMachine. I REALLY recommend this, just in case anything goes wrong (it did for me)
Upgrade to Yosemite via the appStore. Then upgrade a second tome to 10.10.1 (if it hasnt already)

Once successfully updated, and you are happy your OS is running clean, I suggest backing up again, to have a nice clean 10.10.1 restore point. Trust me, I wish I had, as there were a few panic sessions in the following steps until I had ironed out all the bugs

NVIDIA

For the 9xx series we need the latest 343 series drivers. At the time of writing this they are actually in Beta still. Perhaps upon reading this they are in final release state.
This thread has good info on it:
www.tonymacx86.com/graphics/149031-nvidi…0-1-343-01-02-a.html

Here is the version I used us.download.nvidia.com/Rqor80X9RrVcISR7d…ver-343.01.02b02.pkg
Download it to your desktop

Now we get a little technical. If you try to install these on a macbook, NVIDIA believes these drivers are not for you. This is because they assume a 9xx series is not designed for any macbook out yet I guess, and would only be in a MAC PRO desktop. We need to modify the installer to overwrite this.

Move the WebDriver-343.01.02b02.pkg to your desktop (if not already)
Run in a shell:

pkgutil --expand ~/Desktop/WebDriver-343.01.02b02.pkg ~/Desktop/WebDriver

This will create a folder called WebDriver

In it will be a file called Distribution. Right click and open it with an editor (I quite like textWrangler. We need it later on anyway so download textWrangler s3.amazonaws.com/BBSW-download/TextWrangler_4.5.11.dmg)

Not far down there is a line

var found_hardware = 0;

Modify it to

var found_hardware = 1;

This overrides the checks earlier in the script to allow this to be installed on any OSX hardware.
Save the file

Run in a shell:

pkgutil --flatten ~/Desktop/WebDriver ~/Desktop/WebDriver-334.01.02b02_mod.pkg

This will create a new package from the modified files.

You should be able to run the new WebDriver-334.01.02b02_mod.pkg and successfully install the drivers in Yosemite on your MacBook.

Once you have installed the nvidia and are happy it is working ok (you should have NVIDIA options in your system menu and quite likely on your top menu bar) we can move on

 Yosemite, Thunderbolt And Kext

By default the Thunderbolt port is not available for NVIDA in OSX. You have to update a few Kext (Kernal Extension) files. These are basically driver files. We need to allow them to utilise the Thunderbolt port.

I couldnt have done this without this page so I will credit and link it here:
www.journaldulapin.com/2013/08/24/a-thun…gpu-on-a-mac-how-to/

Mavericks was quite simple, but Yosemite made this more dangerous (I lost a day of macbook usage as I couldnt boot).
This is because Yosemite OSX has changed to not allow modified Kext files. This is to make the OSX operating system much more secure, only allowing authorised drivers/kext on boot. However this means if you manually change one, the OSX may fail to boot at all!.

Because we are changing them we have to let Yosemite know to not be so so secure, and let “dev” kext through.
To do this we need to set a boot flag. You can set in in the pram in a terminal using:

sudo nvram boot-args="kext-dev-mode=1"

This is semi permanent each time you reboot. However if your pram gets flushed some how (ie alt-command-P-R on boot) you will lose this boot-flag, and Yosemite may not boot. You can reenter this in single user mode if needed (boot holding command-s)

To make it more permanent you can add it to your boot.plist file
Open in textWrangler: /Library/Preferences/SystemConfiguration/com.apple.Boot.plist
Update the Boot Kernel flags and resave

<key>Kernel Flags</key>
<string>kext-dev-mode=1</string>

Its worth making sure you can boot successfully before next step.

We need to update 3 files, this portion is taken from the linked (many thanks, esp to the blogger as he responds in his comment section)
www.journaldulapin.com/2013/08/24/a-thun…gpu-on-a-mac-how-to/

For NVIDIA graphic cards, there are three files to edit. The first two are related to the display, the third one is dedicated to the support of the sound via HDMI or DisplayPort.

/System/Library/Extensions/NVDAStartup.kext
/System/Library/Extensions/IONDRVSupport.kext
/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAController.kext

You have to get each file, open the package (secondary click -> Show Package Contents) and open the file Info.plist with a text editor that supports editing system files (for example TextWrangler, in its version not from the Mac App Store).

In this file, look for sections beginning with <key>CFBundleIdentifier</key> and add just before </dict>, the two following lines :

<key>IOPCITunnelCompatible</key>
<true/>

Once this is done in the three files (beware, there are several occurrences in IONDRVSupport.kext), just reboot and the card should be activated and operate. In my case, it worked with all the GPU tested.

Be careful, the operation has to be repeated at each minor system update (e.g the move to 10.8.5).

So as it says, add those 2 lines in where appropriate (in each sub <dict> that begins with <key>CFBundleIdentifier</key>)

Once you have edited these files and saved them (it’ll ask you for the admin password during this.)
You will need to rebuild the cache, and reboot
In a terminal run:

sudo touch /System/Library/Extensions
sudo reboot

This is the moment of truth. If all entered correctly hopefully after a reboot you will get back into OSX successfully.
If so, you should be able to reboot again with the thunderbolt connected and it should activate (showing another display on log in).
(Note at this stage I can only get DVI working not he HDMI, Ive read that HDMI 2 is not supported on OSX yet)

Oculus Rift DK2

First download and install the latest OSX SDK for Oculus DK2:
developer.oculus.com/downloads/

For some reason the HDMI port is not working on my 970GTX through viDock on OSX. (Its not hardware as it is in windows)
Fortunately Oculus supplied a DVI to HDMI adapter. So plug that into a 970gtx DVI port, and plug the Oculus HDMI into the the adapter.
Once you have plugged in all the pieces for the DK2 (2USB, hdmi, power, sync to camera cable) boot the mac.

Note. I am plugging the USB into a powered USB hub. Ive read that this is prefered over the internal Macbook USB.
Also, I need more that just the 2 USB ports on the Macbook, so I had to anyway.
Sticking with USB2 for now as Ive also read that USB3 is not supported correctly.

All going well the blue light will illuminate on the DK2 (and not remain orange)

Oculus should now be working!!

Mirroring mode does not work well.
The final trick is a little awkward but has good results.
Leave your displays separated. Using the display system preferences move the DK2 Rift display to the LEFT of the macbook display.
Drag the little white bar do the DK2 display. This means when DK2 is on, it becomes primary display. It sucks a little as its basically unusable as a desktop. You’ll need to do a few clever things like copying aliases onto your macbook display when its in secondary mode so you can still access apps you need.

WHen stuck you can turn off the right (the little power button near its blue/orange light) and you’ll revert back to normal macbook display

However…now when I run the Tuscany demo I get full 75fps (as opposed to the previous 30fps) and no juddering!

I have also tried adding an external monitor to the second DVI outpu on the 970gtx, and setup mirroring on that one, but it caps the app at 60fps instead of 75fps, with occassional dropping. So it does lag it a bit.
Perhaps a 75fps capable monitor may not effect it so much?

Conclusion

The viDock does provide extra eternal GPU power and options, this setup was successful.
Its also great for more displays and it is useful for additional CUDA procs also..for Photoscan or other CUDA powered applications (video editing etc)

For a basic macbook it is much more powerful for Rift and I assume most 3d engine games (Unity, UE4)

I hope this blog is useful for those interested in the same setup.
IMG_2578

IMG_2579
Hope this helps.

Any questions let us know in the comments or contact us pages.

 

-P

Leave a comment