Skip to main content
Formatted the PowerShell script as code, clarified the GPU name replacement using backticks instead of quotes (The quotes shouldn't be replaced). Added section on how to run the script using an administrator terminal, because without that, the script may fail.
Source Link
zx485
  • 2.3k
  • 12
  • 19
  • 24

You can probably get a toggle off/on going though a powershell script like so.

  • Open Windows Powershell ISE and copy paste the following code into it
  {
     
    #Disable the GPU
    
    Get-PnpDevice -FriendlyName "GPU NAME" | Disable-PnpDevice
    
    #Adjust wait time to any amount you want
      
    
    Sleep -Seconds 5
    
    #Enable the GPU
    
    Get-PnpDevice -FriendlyName "GPU NAME" | Enable-PnpDevice
    
 } 

  • Replace GPU NAME with the exact name of your GPU as seen inside device manager. This is the "Friendly Name". Not all commands work with friendly name though so you might need to use the -Deviceid argument instead of -FriendlyName and retrieve the Deviceid by right clicking > properties on the GPU inside device manager.

  • Save the script to your desktop and right click > run with powershell

If you get a Disable-PnpDevice : Generic failure error, you might have to run the script using administrator privileges.

  • Right click the Windows menu > Windows PowerShell (Admin).
  • Copy the full file path of the script and run & "[File Path]" in the Admin PowerShell terminal.
  • You might have to confirm the actions by entering Y.

This should now toggle your GPU off/on. For other ways to clear the ram cache you'll have to check out the NVIDIA development forum. There are some things you can script with NVIDIA GPU's. A few sample scripts should be available for you to check out here on your local C Drive:

C:\Program Files\NVIDIA Corporation\NVIDIA WMI Provider\Samples

C:\Program Files\NVIDIA Corporation\NVIDIA WMI Provider\Samples

You can probably get a toggle off/on going though a powershell script like so.

  • Open Windows Powershell ISE and copy paste the following code into it
{
     
    #Disable the GPU
    
    Get-PnpDevice -FriendlyName "GPU NAME" | Disable-PnpDevice
    
    #Adjust wait time to any amount you want
      
    
    Sleep -Seconds 5
    
    #Enable the GPU
    
    Get-PnpDevice -FriendlyName "GPU NAME" | Enable-PnpDevice
    
 }
  • Replace GPU NAME with the exact name of your GPU as seen inside device manager. This is the "Friendly Name". Not all commands work with friendly name though so you might need to use the -Deviceid argument instead of -FriendlyName and retrieve the Deviceid by right clicking > properties on the GPU inside device manager.

  • Save the script to your desktop and right click > run with powershell

If you get a Disable-PnpDevice : Generic failure error, you might have to run the script using administrator privileges.

  • Right click the Windows menu > Windows PowerShell (Admin).
  • Copy the full file path of the script and run & "[File Path]" in the Admin PowerShell terminal.
  • You might have to confirm the actions by entering Y.

This should now toggle your GPU off/on. For other ways to clear the ram cache you'll have to check out the NVIDIA development forum. There are some things you can script with NVIDIA GPU's. A few sample scripts should be available for you to check out here on your local C Drive:

C:\Program Files\NVIDIA Corporation\NVIDIA WMI Provider\Samples

You can probably get a toggle off/on going though a powershell script like so.

  • Open Windows Powershell ISE and copy paste the following code into it
  {    
    #Disable the GPU   
    Get-PnpDevice -FriendlyName "GPU NAME" | Disable-PnpDevice
    
    #Adjust wait time to any amount you want
    Sleep -Seconds 5
    
    #Enable the GPU
    Get-PnpDevice -FriendlyName "GPU NAME" | Enable-PnpDevice
  } 

  • Replace GPU NAME with the exact name of your GPU as seen inside device manager. This is the "Friendly Name". Not all commands work with friendly name though so you might need to use the -Deviceid argument instead of -FriendlyName and retrieve the Deviceid by right clicking > properties on the GPU inside device manager.

  • Save the script to your desktop and right click > run with powershell

If you get a Disable-PnpDevice : Generic failure error, you might have to run the script using administrator privileges.

  • Right click the Windows menu > Windows PowerShell (Admin).
  • Copy the full file path of the script and run & "[File Path]" in the Admin PowerShell terminal.
  • You might have to confirm the actions by entering Y.

This should now toggle your GPU off/on. For other ways to clear the ram cache you'll have to check out the NVIDIA development forum. There are some things you can script with NVIDIA GPU's. A few sample scripts should be available for you to check out here on your local C Drive:

C:\Program Files\NVIDIA Corporation\NVIDIA WMI Provider\Samples
Formatted the PowerShell script as code, clarified the GPU name replacement using backticks instead of quotes (The quotes shouldn't be replaced). Added section on how to run the script using an administrator terminal, because without that, the script may fail.
Source Link

You can probably get a toggle off/on going though a powershell script like so.

  • Open Windows Powershell ISE and copy paste the following code into it

    {

    #Disable the GPU

    Get-PnpDevice -FriendlyName "GPU NAME" | Disable-PnpDevice

    #Adjust wait time to any amount you want

    Sleep -Seconds 5

    #Enable the GPU

    Get-PnpDevice -FriendlyName "GPU NAME" | Enable-PnpDevice

    }

    Open Windows Powershell ISE and copy paste the following code into it
{
    
    #Disable the GPU
    
    Get-PnpDevice -FriendlyName "GPU NAME" | Disable-PnpDevice
    
    #Adjust wait time to any amount you want
      
    
    Sleep -Seconds 5
    
    #Enable the GPU
    
    Get-PnpDevice -FriendlyName "GPU NAME" | Enable-PnpDevice
    
}
  • Replace "GPU NAME"GPU NAME with the exact name of your GPU as seen inside device manager. This is the "Friendly Name". Not all commands work with friendly name though so you might need to use the -Deviceid argument instead of -FriendlyName and retrieve the Deviceid by right clicking > properties on the GPU inside device manager.

  • Save the script to your desktop and right click > run with powershell

If you get a Disable-PnpDevice : Generic failure error, you might have to run the script using administrator privileges.

  • Right click the Windows menu > Windows PowerShell (Admin).
  • Copy the full file path of the script and run & "[File Path]" in the Admin PowerShell terminal.
  • You might have to confirm the actions by entering Y.

This should now toggle your GPU off/on. For other ways to clear the ram cache you'll have to check out the NVIDIA development forum. There are some things you can script with NVIDIA GPU's. A few sample scripts should be available for you to check out here on your local C Drive:

C:\Program Files\NVIDIA Corporation\NVIDIA WMI Provider\Samples

You can probably get a toggle off/on going though a powershell script like so.

  • Open Windows Powershell ISE and copy paste the following code into it

    {

    #Disable the GPU

    Get-PnpDevice -FriendlyName "GPU NAME" | Disable-PnpDevice

    #Adjust wait time to any amount you want

    Sleep -Seconds 5

    #Enable the GPU

    Get-PnpDevice -FriendlyName "GPU NAME" | Enable-PnpDevice

    }

  • Replace "GPU NAME" with the exact name of your GPU as seen inside device manager. This is the "Friendly Name". Not all commands work with friendly name though so you might need to use the -Deviceid argument instead of -FriendlyName and retrieve the Deviceid by right clicking > properties on the GPU inside device manager.

  • Save the script to your desktop and right click > run with powershell

This should now toggle your GPU off/on. For other ways to clear the ram cache you'll have to check out the NVIDIA development forum. There are some things you can script with NVIDIA GPU's. A few sample scripts should be available for you to check out here on your local C Drive:

C:\Program Files\NVIDIA Corporation\NVIDIA WMI Provider\Samples

You can probably get a toggle off/on going though a powershell script like so.

  • Open Windows Powershell ISE and copy paste the following code into it
{
    
    #Disable the GPU
    
    Get-PnpDevice -FriendlyName "GPU NAME" | Disable-PnpDevice
    
    #Adjust wait time to any amount you want
      
    
    Sleep -Seconds 5
    
    #Enable the GPU
    
    Get-PnpDevice -FriendlyName "GPU NAME" | Enable-PnpDevice
    
}
  • Replace GPU NAME with the exact name of your GPU as seen inside device manager. This is the "Friendly Name". Not all commands work with friendly name though so you might need to use the -Deviceid argument instead of -FriendlyName and retrieve the Deviceid by right clicking > properties on the GPU inside device manager.

  • Save the script to your desktop and right click > run with powershell

If you get a Disable-PnpDevice : Generic failure error, you might have to run the script using administrator privileges.

  • Right click the Windows menu > Windows PowerShell (Admin).
  • Copy the full file path of the script and run & "[File Path]" in the Admin PowerShell terminal.
  • You might have to confirm the actions by entering Y.

This should now toggle your GPU off/on. For other ways to clear the ram cache you'll have to check out the NVIDIA development forum. There are some things you can script with NVIDIA GPU's. A few sample scripts should be available for you to check out here on your local C Drive:

C:\Program Files\NVIDIA Corporation\NVIDIA WMI Provider\Samples

added 347 characters in body
Source Link
Mastaxx
  • 1.3k
  • 1
  • 10
  • 23

You can probably get a toggle off/on going though a powershell script like so.

  • Open Windows Powershell ISE and copy paste the following code into it

    {

    #Disable the GPU

    Get-PnpDevice -FriendlyName "The Name in Device Manager""GPU NAME" | Disable-PnpDevice

    #Adjust wait time to any amount you want

    Sleep -Seconds 5

    #Enable the GPU

    Get-PnpDevice -FriendlyName "The Name in Device Manager""GPU NAME" | Enable-PnpDevice

    }

  • Replace "GPU NAME" with the exact name of your GPU as seen inside device manager. This is the "Friendly Name". Not all commands work with friendly name though so you might need to use the -Deviceid argument instead of -FriendlyName and retrieve the Deviceid by right clicking > properties on the GPU inside device manager.

  • Save the script to your desktop and right click > run with powershell

This should now toggle your GPU off/on. For other ways to clear the ram cache you'll have to check out the NVIDIA development forum. There are some things you can script with NVIDIA GPU's. A few sample scripts should be available for you to check out here on your local C Drive:

C:\Program Files\NVIDIA Corporation\NVIDIA WMI Provider\Samples

You can probably get a toggle off/on going though a powershell script like so.

  • Open Windows Powershell ISE and copy paste the following code into it

    {

    #Disable the GPU

    Get-PnpDevice -FriendlyName "The Name in Device Manager" | Disable-PnpDevice

    #Adjust wait time to any amount you want

    Sleep -Seconds 5

    Get-PnpDevice -FriendlyName "The Name in Device Manager" | Enable-PnpDevice

    }

  • Save the script to your desktop and right click > run with powershell

This should now toggle your GPU off/on. For other ways to clear the ram cache you'll have to check out the NVIDIA development forum. There are some things you can script with NVIDIA GPU's. A few sample scripts should be available for you to check out here on your local C Drive:

C:\Program Files\NVIDIA Corporation\NVIDIA WMI Provider\Samples

You can probably get a toggle off/on going though a powershell script like so.

  • Open Windows Powershell ISE and copy paste the following code into it

    {

    #Disable the GPU

    Get-PnpDevice -FriendlyName "GPU NAME" | Disable-PnpDevice

    #Adjust wait time to any amount you want

    Sleep -Seconds 5

    #Enable the GPU

    Get-PnpDevice -FriendlyName "GPU NAME" | Enable-PnpDevice

    }

  • Replace "GPU NAME" with the exact name of your GPU as seen inside device manager. This is the "Friendly Name". Not all commands work with friendly name though so you might need to use the -Deviceid argument instead of -FriendlyName and retrieve the Deviceid by right clicking > properties on the GPU inside device manager.

  • Save the script to your desktop and right click > run with powershell

This should now toggle your GPU off/on. For other ways to clear the ram cache you'll have to check out the NVIDIA development forum. There are some things you can script with NVIDIA GPU's. A few sample scripts should be available for you to check out here on your local C Drive:

C:\Program Files\NVIDIA Corporation\NVIDIA WMI Provider\Samples

Source Link
Mastaxx
  • 1.3k
  • 1
  • 10
  • 23
Loading