Guide for fixing blackscreen and or screen tearing after a reboot of guest


Recommended Posts

This is a guide on how to fix blackscreen and or screen tearing issues regarding to graphics cards when using gpu passthrough after a reboot of the guest.

 

This fix relies on disabling the graphics driver before a shutdown and then enabling it again after a startup.

 

 

Download devcon.exe and place it in System32 (I found a guide on google on how to extract it from a file downloaded from Microsoft).

 

Now find out the id of the graphics card for example "PCI\VEN_1002&DEV_67B0&SUBSYS_20151462&REV_80\3&13C0B0C5&0&28: AMD Radeon R9 390 Series"

by typing "devcon find *" in a cmd window.

We will only be using the "VEN1002" part (from my example, yours may be different).

 

Make a text file in my documents named "gpufix enable.bat" and type:

devcon enable *VEN_1002*

 

Then make another one named "gpufix disable.bat" and type:

devcon disable *VEN_1002*

 

Start gpedit.msc and move to "User Configuration/Windows Settings/Scripts (Logon/Logoff).

Side note: I know it makes more sense to have the script run as Startup/Shutdown but i could not get that to work.

 

Double click Logon on the right side and press "Add..."

Press browse and select the enable file

 

Now we will do the same thing with Logoff except we use disable instead of enable.

 

Now you are done!

 

This is my first guide and i have had this in my notes for a long time, but after having to redo it so many times after fiddling around with unRaid i finally thought that i should share this in case someone else was in need of it (and for my own sake so i can find it on my profile :P ). This bug is briefly talked about on one of Linus tech tips videos and Linus made it sound like it had something to do with the graphics card not being shut down correctly.

Link to comment

If you use HDMI audio and your audio device wont work after a reboot it is most likely because the card did not have enough time to start, to fix this you can change the enable script to look something like this:

devcon enable *VEN_1002*

timeout 20

devcon enable *VEN_1002*

 

This means that whatever device that is affected by *VEN_1002* will get the enable command twice, the second command will be sent 20 seconds after the first one.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.