34

Is there a tool to print the power supply information, such as brand/model name and maximum (supported) output voltage? I need to add a second GPU and I would like to make sure it does support the extra voltage.

P.s: I already installed a secondary GPU when I had the access and I rushed outside the server room. When I later checked, the second GPU was not recognized (now that I don't have the access anymore!! :P) I wanted to make sure if the problem was the lack of power voltage as the GPU was working on another machine and is not faulty.

Currently, I don't have physical access to the PC currently (ssh only).

I have tried to see other posts, also the other exisiting tools, i.e., sudo dmidecode -t 39, sensors, and ipmitool, but none of them show the information I'm looking for.

Zanna
  • 72,312
Amir
  • 1,111

6 Answers6

30

You can't. The plug between the power supply and the mainboard follows the ATX specification, which regulates which signals and which voltages shall be present.

ATX Signals

Com is common, or ground. The rest of the pins are used for voltages, or simple binary signals, like PS_ON and PWR_OK. There is no bus data transfer pins. The operating system simply has no way of knowing anything about the power supply.

Some server systems come with sensors in the power supply. Such sensors should show up in lmsensors. For instance it's quite common that they will report power consumption, fan speed and temperature. But in this case, you should specify which system you have - as this is typically not seen in normal PC's.

Other power supplies may include a monitoring interface over USB. What data they will provide will differ from power supply to power supply. To check if the PSU in question provides this, run lsusb and look for something that resembles a power supply. This may include model, or simply be generic for an entire class of different power supplies.

vidarlo
  • 23,497
28

To find the power supply information, use following command:

sudo dmidecode --type 39

The below command outputs a lot status and statistical information about the battery. The /org/... path can be found with the command upower -e (--enumerate).

upower -i /org/freedesktop/UPower/devices/battery_BAT0

The one I use mostly is this one :

sudo apt-get install lm-sensors
sudo sensors-detect 

Choose YES to all.

sudo service kmod start

Use :

sensors

or

watch sensors
An0n
  • 2,225
8

Software interface to Power Supply

As mentioned in the top voted answer a special communication channel to the Power Supply is required. On my laptop there is a USB 3 self powered hub connected to the UPS (Interruptible Power Supply). Although you don't have this type of power supply the communication concept would be similar:

$ sudo pwrstat -status

The UPS information shows as following:

    Properties:
        Model Name................... CP550HGa
        Firmware Number.............. BFBB104#BI1.g
        Rating Voltage............... 120 V
        Rating Power................. 330 Watt

    Current UPS status:
        State........................ Normal
        Power Supply by.............. Utility Power
        Utility Voltage.............. 121 V
        Output Voltage............... 121 V
        Battery Capacity............. 100 %
        Remaining Runtime............ 33 min.
        Load......................... 72 Watt(22 %)
        Test Result.................. Unknown
        Last Power Event............. None

The current load is 72 Watts and the maximum load is 330 watts.

Installing pwrstat

To install pwrstat go to the Cyber Power Systems website Linux Software page. You will find 32-bit and 64-bit downloads available for all Linux distro's but make sure you select the one for Debian (.deb) which Ubuntu is based on.

After downloading install it using:

sudo dpkg -i powerpanel_132_amd64.deb

To learn more about using pwrstat use:

man pwrstat   # to learn more about the terminal interface
man pwrstatd  # to learn about background daemon with alarms, auto shutdown, etc.

What to do when there is no software

The old tried and true method is to look at the safety label on your power supply. By law in most countries this label must exist. For my old laptop it is as easy as looking at the power brick. For your desktop PC it may be on the back or you might have to open it up and look inside:

Dell Inspiron Power Supply

The label shows:

  • Output 130 Watts (Watt=Volt x Amp)
  • Input 100-240 VAC ~ 2.5 Amps, 50-60 HZ
  • Output 19.5 Volts ~ 6.7 Amps

What to do when you can't look at the hardware

You could get someone who is on site to take the picture for you. If that isn't viable get the make and model of the computer and google the power supply specs. From this article the generic specs for PCs are:

  • Small Form Factor - 15A (250W)
  • Mini-Tower - 25A (300-350W)
  • Mid-Tower - 35A (400-500W)
  • Full Tower - 40A (600-650W)
  • Dual Video Card (SLI) - 50A (750W+)

Note the amperage is specified for 12 Volt rail output. So 15A = 180 watts and 50A (For dual video cards) = 600 watts. Wattage = Amperage * Voltage.

7

The one I know is lshw, the class you're interested in is most certainly power. On my system it outputs the battery's specs only though:

$ sudo lshw -c power
  *-battery               
       product: 45N1111
       vendor: SONY
       physical id: 1
       slot: Front
       capacity: 23200mWh
       configuration: voltage=11.1V

As the answer to Get information about my PSU suggests mains units usually don't have a data bus to deliver such information, so sadly this may very well be the best one can do. To my knowledge, /sys/class/power_supply/AC contains all information about your mains unit that is available to the system.

Further reading:

dessert
  • 40,956
2

As indicated by the other good answers here, your issue is situation dependant. You would need more information than you appear to have. At the very least I would think you would need a picture of the existing power supply specification label (or some other reliable reference to make and model. The only way I have ever been able to successfully upgrade a PSU required the following:

1) Physical access to the system in question.

2) A screwdriver

3) A qualified replacement power supply. (A decent Power Supply calculater is useful in determining requirements.)

Edit: if this comment accurately reflects your problem, then Step 3 and the output from sudo lshw should be all you need to determine if your PSU meets specifications (Assuming you know exactly what you installed and have or can obtain it's specifications). Of course you could also manually add up the power draw of the individual components, but I think using the PS calculator will be easier. As a rule of thumb I like my power supplies output to exceed requirements by 10% or better in order to allow for the possibility of a component drawing more than specified, but erring on the side of caution is a personal choice.

Elder Geek
  • 36,752
0

Use acpi command. It can show you information if computer is powered from a battery or from a wall socket ("on-line"), battery details, thermal details and some other. I'm surprised no one mentioned this already!

Some examples: https://www.geeksforgeeks.org/acpi-command-in-linux-with-examples/