Yes, you can effectively turn off a GPU by disabling its PCIe slot under Linux, but it requires specific steps and care to ensure that your system remains stable. Here is a general approach to achieve this:

Steps to Disable the PCIe Slot of an NVIDIA GPU under Linux

  1. Identify the PCIe Device:
    First, you need to identify the PCIe address of your NVIDIA GPU. You can do this using the lspci command:
    lspci | grep -i nvidia
    
    This command will list all NVIDIA devices connected to your system. Note the PCIe address (e.g., 0000:01:00.0).
  2. Unload the NVIDIA Driver:
    Before disabling the PCIe slot, unload the NVIDIA driver to ensure that the GPU is not in use:
    1
    2
    3
    4
    sudo rmmod nvidia
    sudo rmmod nvidia_uvm
    sudo rmmod nvidia_modeset
    sudo rmmod nvidia_drm
    
  3. Disable the PCIe Slot:
    You can disable the PCIe slot using the echo command to write to the /sys filesystem:
    echo 1 | sudo tee /sys/bus/pci/devices/0000:01:00.0/remove
    
    Replace 0000:01:00.0 with the actual PCIe address of your GPU.
  4. Verify the Device is Disabled:
    You can verify that the device has been disabled by checking the list of PCI devices again:
    lspci | grep -i nvidia
    
    The device should no longer be listed.

Re-enabling the PCIe Slot

If you need to re-enable the PCIe slot, you can rescan the PCI bus:

echo 1 | sudo tee /sys/bus/pci/rescan

After rescanning, reload the NVIDIA drivers:

1
2
3
4
sudo modprobe nvidia
sudo modprobe nvidia_uvm
sudo modprobe nvidia_modeset
sudo modprobe nvidia_drm

Notes and Considerations

  • Ensure that no critical processes or applications are using the GPU before disabling it.
  • Disabling and enabling PCIe devices dynamically can sometimes cause system instability. Proceed with caution and be prepared for a system reboot if necessary.
  • Depending on your system configuration, you might need to adjust the commands or perform additional steps.

By following these steps, you can effectively turn off the GPU by disabling its PCIe slot, reducing its power consumption to zero.

Edit
Pub: 22 Jun 2024 11:28 UTC
Views: 562