Jump to content

Best fix for Oculus Link Hub not loading on laptops with Discrete AMD or Nvidia GPUs (And Xe just in case those are affected too) (Plus some extras)

FluffzOokami

Hi there!

Please read this fully, even if you already know the fix, because this one's a better version of it.

Context

So here's the thing, two days ago I was pulling my hair out trying to figure why Oculus Link wouldn't load the hub on my Quest 2, I spent all day reinstalling Oculus PC app, and even factory reset my Quest 2 to no avail, until I gave in and tried something I initially suspected.

The Fix

So, some of you may know, most gaming laptops have their GPU in a sort of coprocessor configuration, meaning the Nvidia or AMD GPU really isn't running the screen, but rather, hands off the finished frames to the integrated GPU. This right here is the problem. Oculus Link does not play well with this sort of configuration for some reason or another.

The fix consists of disabling the iGPU of your laptop, be it an AMD CPU, or an Intel one. (Sidenote, disabling it won't make your screen go black, but rather the iGPU enters into some sort of barebones functionality mode, just enough to run the screen).

However, as you may know, this often comes at the detriment of both your battery life, and your laptop's integrated screen's resolution, and you and I know how annoying it is to open device manager every single time you want to play VR. So here's my spin on this solution.

My spin on the fix. A better version of it.

I've been spending the better part of two days trying to figure out a way to automate the whole process of disabling and re-enabling the iGPU everytime I connect and disconnect my Quest 2. I already know how to program, so I figured out a powershell script was right up my ally.

So, to start right off, we're going to need to do a few basic preparations to get the automation up and running.

You're going to want to enable a certain logging feature in EvntVwr so we can use it to detect when a USB device gets plugged in. To do this, follow the following instructions.

  • Right click on the Windows icon and open Event Viewer

r/oculus - Best fix for Oculus Link Hub not loading on laptops with Discrete AMD or Nvidia GPUs. (Plus some extras)

Pictured, the event viewer button.

  • Next thing, on the left side panel explorer you're going to want to navigate to Event Viewer (Local)/Applications and Services Logs/Microsoft/Windows/DriverFrameworks-UserMode/Operational

 

r/oculus - Best fix for Oculus Link Hub not loading on laptops with Discrete AMD or Nvidia GPUs. (Plus some extras)

The correct directory you should be in.

  • You should be seeing a blank event log page, unless it's been enabled previously. If so, you should still make sure it is currently enabled by following the instructions. Following that, once you've clicked on Operational, you need to go to the right hand side of Event Viewer, and click on the Properties button. Once the dialog box opens, make sure Enable logging is toggled on. Once done, click on OK and exit Event Viewer

Once this is done, we proceed to the next requirement.

You're going to want to open PowerShell as administrator, we will do two things from here, firstly, we need to set the execution policy properly so Task Scheduler can run the script we will make.

  • Open PowerShell, included by default in most Windows installations. Make sure to run as administrator. Once PowerShell is open, run the following command.

 

Set-ExecutionPolicy Bypass
r/oculus - Best fix for Oculus Link Hub not loading on laptops with Discrete AMD or Nvidia GPUs. (Plus some extras)

PowerShell's prompt.

PowerShell will prompt you to confirm the change. Please read this carefully. If you feel like this is too much of a risk for you, turn back now. If not, confirm by pressing Y and then pressing enter.

  • Then we will run the following command to see what your integrated GPU is named.

 

Get-PnpDevices -Class Display
r/oculus - Best fix for Oculus Link Hub not loading on laptops with Discrete AMD or Nvidia GPUs. (Plus some extras)

This should list two GPUs, both your integrated GPU and the discrete one. Take note of the iGPU's name. Should something akin to "AMD Radeon(TM) Graphics" or something containing Intel. Set aside this name. It will be useful later.

You can now close PowerShell. We are done with the second set of pre-requisites.

Now, we need to actually make the script. To start, create a new file anywhere, and name it anything you want, but add the ps1 extension to it. For example purposes, I named mine "uwu.ps1"

Now, open PowerShell ISE as administrator, a program pre-included in Windows. This will bring up a PowerShell ISE window, where you will need to open the file you previously made, the ps1 script.

This is the code we will be using.

$owo = Get-PnpDevice -PresentOnly -FriendlyName "Oculus Composite XRSP Interface" | Select FriendlyName | Out-String
if($owo -like "*XRSP*") {
Get-PnpDevice  -FriendlyName "*AMD Radeon*" | Disable-PnpDevice -Confirm:$false
}

if($owo -notlike "*XRSP*") {
Get-PnpDevice  -FriendlyName "*AMD Radeon*" | Enable-PnpDevice -Confirm:$false
}

Look at the end for a line-by-line explanation of what this script does if you are concerned with security.

  • Copy the code onto PowerShell ISE.

  • Remember how I told you to save onto that last bit we searched up for in PowerShell, your iGPU's name? Well, here is where it comes in handy! Look at the previous code we wrote, you will need to replace the following text with your iGPU's name. Replace both "AMD Radeon" text fields in both the 3rd line and the 7th line of the code you copied to PowerShell ISE with your iGPU's name, do mind the caps to be exact as well.

  • Once this is done, connect your VR Headset, and make sure to allow your PC to access the headset's content. Once finished, click on the run button to test the script. If done correctly, this should disable your integrated GPU, noticeable by your screen going black for a moment, and reappearing as a lower resolution version of itself. Disconnect your headset, and run the script again, this should enable your iGPU back again, and your screen should black out for a moment then return back to full resolution.

  • Make sure to save the script before exiting PowerShell ISE.

r/oculus - Best fix for Oculus Link Hub not loading on laptops with Discrete AMD or Nvidia GPUs. (Plus some extras)
  • Once you've verified it fully works, you can open Task Scheduler. On the top bar, click on Action, and then click on Create Task.

r/oculus - Best fix for Oculus Link Hub not loading on laptops with Discrete AMD or Nvidia GPUs. (Plus some extras)

Create Task Option

This will bring up a dialog box from which you will need to create a task that will run everytime we connect a USB device.

  • Give the task a name of your will. For example purposes, I named mine Oculus. Also, make sure the option to only run when user is logged on is highlighted. You will also need to tick the "Run with highest privileges" checkbox, and make sure the "Configure for" list is set to Windows 10.

 

r/oculus - Best fix for Oculus Link Hub not loading on laptops with Discrete AMD or Nvidia GPUs. (Plus some extras)

A properly configured Oculus task.

  • Next thing we want is to go to the Triggers tab where we will create three triggers, start by clicking on the "New" button.

  • For the first task, we want it to be triggered on an event, so use the "Begin the task:" list box to set it to run on an event. From there, you will be shown three option boxes, starting by the "Log:" box. Remember how we enabled that log earlier ago? Well, scroll down till you find it, should be named "Microsoft-Windows-DriverFrameworks-UserMode/Operational". Following that, on the "Source:" list box, select the "DriverFrameworks-UserMode" Source. then set the Event ID to 2101 on the next textbox. Once done, click on OK.

r/oculus - Best fix for Oculus Link Hub not loading on laptops with Discrete AMD or Nvidia GPUs. (Plus some extras)

Properly set up First Trigger.

  • Then, we will create the second trigger, which will trigger when a user logs on, so the script gets run everytime the computer starts, in case someone unplugged or plugged it in while off/sleeping. Click on the new trigger button, and then a dialog box will appear. From there, select the "Begin the task" listbox and select the "At logon" option. There should now be two options, we want it to be done when any user logs on, so select the "Any user" option and click OK.

r/oculus - Best fix for Oculus Link Hub not loading on laptops with Discrete AMD or Nvidia GPUs. (Plus some extras)

2nd trigger properly configured.

  • For the third and final trigger, this will be ran when any USB device gets removed. Create a new trigger and select the "Begin the task:" listbox and set it to "On an event". Following that, navigate to the same log from before, "Microsoft-Windows-Driver-Frameworks-UserMode/Operational". Select the same source as the first trigger, but this time, set the Event ID to 1008.

r/oculus - Best fix for Oculus Link Hub not loading on laptops with Discrete AMD or Nvidia GPUs. (Plus some extras)

3rd trigger properly done.

  • Once all is done, this is what the triggers list should look like.

r/oculus - Best fix for Oculus Link Hub not loading on laptops with Discrete AMD or Nvidia GPUs. (Plus some extras)

Complete triggers list.

  • For the last step, go to the Actions tab where we will create a single Action. Create a new action by clicking on the New button, then for the action, select the "Start a program" on the Action listbox. In the Program/Script textbox, you need to put in the following text.

 

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

Then, in the "Add arguments" textbox, put in the directory to the powershell script you created, in my case, being;

C:\Users\dazzl\Documents\uwu.ps1

 

r/oculus - Best fix for Oculus Link Hub not loading on laptops with Discrete AMD or Nvidia GPUs. (Plus some extras)

Properly configured Actions tab.

  • Once this is done, click on OK for both the action dialog and oculus dialog. Exit Task Scheduler. And pray to whatever deity you believe in in hopes that this works. Then give yourself a pat on the back, because you've finished setting the whole thing up! It should now be fully done!

 

How the script works
$owo = Get-PnpDevice -PresentOnly -FriendlyName "Oculus Composite XRSP Interface" | Select FriendlyName | Out-String

The first line queries your computer for any currently connected device with the name of "Oculus Composite XRSP Interface", of which, I believe applies to other Oculus headsets as well. This is followed by "Select FriendlyName", which basically selects the from the output the name of the headset, we do this because we know if the headset is not connected, this will produce no output, and therefore will be empty. The command then hands the output to "Out-String" which turns the PowerShell Object into a string, basically, human readable text. The output of this gets saved to the variable of "owo"

if($owo -like "*XRSP*") {

What follows in the next line, it tells powershell to do something if the text the variable owo contains has any portion that has the text "XRSP", which, if we have our headset connected, then owo contains "Oculus Composite XRSP Interface", meaning it does contain XRSP. Therefore, if the headset is connected, it will continue onto the next line and run the code within it.

Get-PnpDevice  -FriendlyName "*AMD Radeon*" | Disable-PnpDevice -Confirm:$false

Speaking of the next line, we come onto the 3rd line, where it tells the computer to search for any device named "AMD Radeon", which once it finds it, it then tells the PC to disable it.

}

The 4th line closes the previous statement, and the fifth line is a space added to make the script easier to read.

if($owo -notlike "*XRSP*") {

The 6th line tells it if the variable owo does not contain the text XRSP, to do the action in the line below. Which we know if the headset is not connected, then owo will not contain the text XRSP.

Get-PnpDevice  -FriendlyName "*AMD Radeon*" | Enable-PnpDevice -Confirm:$false
}

The 7th line tells it to look for the iGPU named "AMD Radeon" and passes it onto the next command, which enables it back on, which is ran when the headset is not connected. The 8th line closes this statement.

I've eaten actual RAM before. Fear me. 🦴

Link to comment
Share on other sites

Link to post
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

×