Reinitialize devices and drivers without complete system reinstall?

Discussion in 'Operating Systems' started by Espionage724, Nov 22, 2021.

  1. Espionage724

    Espionage724 Master Guru

    Messages:
    311
    Likes Received:
    151
    GPU:
    RTX 3060 XC BLACK
    Sometimes after messing with drivers, Windows will eventually take 2-3 times longer to load, as it appears it's re-loading USB or PCI-E controllers more than once (keyboard will cut off and back on twice).

    I noticed that removing a crucial Windows device from Device Manager and rebooting would fix this perfectly. Can't recall which one specifically, but it's either "ACPI x64-based PC", "Microsoft ACPI-Compliant System", or "Pci Bus". I believe this causes Windows to reinitialize all devices and their drivers, as:
    • Windows boots faster
    • Any disabled devices in Device Manager get re-enabled after reboot
    • Any devices with customized settings (like Transmit buffers from Ethernet devices) get reset to factory-default settings
    But the few times I've done this, sometimes Windows fails to (I assume) re-initialize the NVMe controller, and Windows fails to boot (BSOD about inaccessible boot volume). I'm not sure why this seems to only happen sometimes, and I'm unsure how to recover the system from this state (auto repair fails; never tried system restore). I'm using the standard NVMe controller driver (NVMe in AHCI/non-RAID mode, no special driver).

    I'd like to figure out a consistent way to reset all device drivers without breaking Windows boot.


    Edit: Removing "Microsoft ACPI-Compliant System" and rebooting seemingly accomplishes this consistently without problem.
     
    Last edited: Dec 5, 2021
  2. rflair

    rflair Coleus Staff Member

    Messages:
    4,252
    Likes Received:
    647
    GPU:
    5700XT
    It has nothing do to with resetting all device drives, Windows keeps a record of all devices ever attached/added and switching back and forth between drivers makes Windows have to check which one is properly enumerated.

    Easiest way to 'fix' this is to use, GhostBuster, download the portable version, you have to run it as Admin.
    Just go over every section and 'right click' then choose 'Add Class'

    https://wvd-vegt.bitbucket.io/ghostbuster.html

    Edit, If you are ducking with key system components then system Restore is your friend.
     
    386SX and Ohmer like this.
  3. Astyanax

    Astyanax Ancient Guru

    Messages:
    12,425
    Likes Received:
    4,752
    GPU:
    GTX 1080ti
    Thats, definitely, NOT how anything works.

    The active device states are retained once within the system, ghosted devices are those which have a parent that has had it driver version change and don't get initialized alongside the current drivers.

    make sure you're not installing third party usb3 drivers into win10 unless the device is unstable otherwise on the xhci driver, and definitely don't enable msi's on ehci controllers.
     
    386SX likes this.
  4. mbk1969

    mbk1969 Ancient Guru

    Messages:
    11,673
    Likes Received:
    9,657
    GPU:
    GF RTX 2070 Super
    When you delete device in Device Manager you delete information (from registry) about device instance. On next boot Windows finds device and creates device instance registry entries.
    Also Windows stores device drivers in its special folders (component store). You can view (and manage) drivers in store with the help of https://github.com/lostindark/DriverStoreExplorer/releases

    Also you can extend behavior of Device Manager - menu "show hidden devices" - by creating system environment variable "DEVMGR_SHOW_NONPRESENT_DEVICES" with value "1" (and reboot). Non present devices will be shown with greyed icons (after you check mentioned menu item). You will see all USB devices you ever plugged in, for example. Windows stores device instance each time it is detected for the first time, and at each boot it has to check whether stored device instances are "online", so cleaning such non present devices should speed boot a bit.
     
    Last edited: Nov 23, 2021

  5. Astyanax

    Astyanax Ancient Guru

    Messages:
    12,425
    Likes Received:
    4,752
    GPU:
    GTX 1080ti
    there is also https://www.softpedia.com/get/System/System-Miscellaneous/Device-Cleanup-Tool.shtml

    [​IMG]

    There are some things you absolutely should not remove that the non present devices variable doesn't hide, this cleanup tool does.
     
    Maddness, 386SX, Ohmer and 2 others like this.
  6. 386SX

    386SX Maha Guru

    Messages:
    1,267
    Likes Received:
    1,397
    GPU:
    AMD Vega64 RedDevil
    Crazy stuff, thanks!
     

Share This Page