1

To keep my story short, I have HP Pavillion laptop 64-bit, and it was shipped with Windows 10 Home edition, last year I upgraded it using Windows update to Windows 11. I start facing this issue, if the laptop is turn on from shutdown, restart or hibernate, the screen keeps flickering (going to full blank for a second and then show content for a second, as so on). Now I read a lot about this issue, and someone mentioned to turn off "fast startup", which I did:

enter image description here

This fixed the issue for shutdown and restart, but still the flickering will happen in case I do a hibernate. Currently to fix this, I need to go to Device Manager, then disable and reenable this drive "Intel (R) Iris (R) Plus Graphics ":

enter image description here

But it is a challenging task to do those steps while the screen flickers. Also, I can disable this drive before doing the hibernate, but sometimes I forget. So, is there a way to write a batch file that runs when my laptop comes from hibernate, to disable this drive and reenable it in the background?

I already updated all the drivers and my Windows 11 is up to date. In addition to that, last month I format my laptop and reinstall a fresh version of Windows 11. but still facing the exact same issue. Here is the system specification:-

Device name ***
Processor   Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz   1.50 GHz
Installed RAM   16.0 GB (15.8 GB usable)
System type 64-bit operating system, x64-based processor
Pen and touch   No pen or touch input is available for this display

Windows Specification:-

Edition Windows 11 Home
Version 24H2
Installed on    ‎19/‎10/‎2024
OS build    26100.2033
Experience  Windows Feature Experience Pack 1000.26100.23.0

2 Answers2

2
@echo off

set "_wmic_bin=%SystemRoot%\System32\wbem\wmic.exe"
set "_DevCon=D:\Full\Path\To\Your\Installed\DevCon.exe"
set "_wmic_cmd=Path Win32_VideoController Where "Name Like '%%%%Intel%%%%'" Get PNPDeviceID"

for /f ^usebackq^ ^tokens^=^4^ ^delims^=^<^> %%G in =;(` call "%_wmic_bin%" %_wmic_cmd% /format:xml ^| find "VALUE&g"
    `);= do set "_VGA_DEV=%%~G" && for /f ^tokens^=^1^-^4^ ^delims^=^"^& %%i in =;(' call echo/"%%_VGA_DEV:&amp;=&%%"
       ');= do call set "_VGA_PCI=%%~i&%%~j&%%~k"

>nul "%_DevCon%" enable "%_VGA_PCI%" || >nul "%_DevCon%" disable "%_VGA_PCI%"

Your homework...

1. Executing the command:

>@Wmic Path Win32_VideoController Get Name, PNPDeviceID /Value

It returns:

Name=Intel(R) HD Graphics 630
PNPDeviceID=PCI\VEN_8086&amp;DEV_5912&amp;SUBSYS_07A31028&amp;REV_04\3&amp;11583659&amp;0&amp;10

2. With some "crops" done by defining a delimiter in a double for /f loop, I get the "conversion" from, crop to:

:: From: PCI\VEN_8086&amp;DEV_5912&amp;SUBSYS_07A31028&amp;REV_04\3&amp;11583659&amp;0&amp;10
:: Crop: PCI\VEN_8086&amp;DEV_5912&amp;SUBSYS_07A31028&amp;REV_04\3&amp;11583659&amp;0&amp;10
:: Crop: PCI\VEN_8086&    DEV_5912&    SUBSYS_07A31028
::   To: PCI\VEN_8086&DEV_5912&SUBSYS_07A31028


With this string, I can now check the status of the VGA card with:

DevCon.exe status "PCI\VEN_8086&DEV_5912&SUBSYS_07A31028"

It returns:

PCI\VEN_8086&DEV_5912&SUBSYS_07A31028&REV_04\3&11583659&0&10
    Name: Intel(R) HD Graphics 630
    Driver is running.
1 matching device(s) found.

I really don't know if this helps to disable and/or enable if the action is dependent on what results in:

    Driver is running.

To avoid any anomalies when basing actions on the result of obtaining the current status, I prefer to apply the command to enable the card in your case:

devcon enable "PCI\VEN_8086&DEV_5912&SUBSYS_07A31028"

Which can return if it is disabled

PCI\VEN_8086&DEV_5912&SUBSYS_07A31028&REV_04\3&11583659&0&10: Enable failed
1 matching device(s) found.

To automate actions based on the identification of the enabled/disabled status, you can apply Conditional Execution using the following logic:

>nul devcon enable "PCI\VEN_8086&DEV_5912&SUBSYS_07A31028" && (
    :: If the command returns an exit code of 0 
    :: The device was disabled, no further action is 
    :: necessary; it has been enabled successfully.
) || (
    :: In this condition, the opposite applies, 
    :: because it returned a non-zero exit code, indicating that 
    :: the device is enabled, so the next command will disable it.
    >nul devcon disable "PCI\VEN_8086&DEV_5912&SUBSYS_07A31028"
)

Note 1. Unfortunately, I don't have dual graphics cards to be able to test and confirm that it "works", but at least I have one card. d;)

My card: Intel(R) HD Graphics 630


Note 2. For obvious reasons and limitations, I cannot provide you with a "ready-to-execute" code. You will have your homework to follow the described steps and adapt the specific strings for your card in the code, as well as download DevCon.exe and set the path to the variable.


Note 3. To obtain DevCon, I recommend using the available installer, which will guide you to the appropriate version for your systems.


Note 4. During the installation, be sure to copy the path and assign this value to the variable:

Set "_DevCon=D:\Full\Path\To\Your\Installed\DevCon.exe"

Note 5.: Some attention may be necessary when using an asterisk, although I cannot specify where since I do not have multiple graphics cards. Therefore, I recommend consulting the question Running the devcon.exe properly (enabling/disabling the device from command line in Windows 10), which addresses:

devcon.exe disable "PCI\VEN_1002&DEV_687F*"
devcon.exe enable "PCI\VEN_1002&DEV_687F*"

Io-oI
  • 9,237
1

For completeness: these dual-GPU switching systems are only completely supported by the system vendor, HP in your case. A dual-GPU setup isn't usually a problem when both run in parallel.

For proper switching - battery/mains, high/low load etc - you need a driver specifically by the manufacturer. If that isn't available any more you should ask them (little chance for success but nonetheless). If you need to resort to generic GPU chip drivers (Intel and Nvidia here), then effects like your reported ones are to be expected.

Zac67
  • 5,130
  • 1
  • 13
  • 22