pmav99 / nvsmi

A (user-)friendly wrapper to nvdia-smi
MIT License
28 stars 8 forks source link

Wrong output, should be MiB instead of MB #7

Open vovaf709 opened 1 year ago

vovaf709 commented 1 year ago

nvidia-smi shows MiB-s, but not MB-s, so reprs of corresponding objects should be changed

KwangryeolPark commented 1 year ago

MB means Mega Byte so MiB is MB.

vovaf709 commented 1 year ago

MiB mean mebibyte, see this table https://en.wikipedia.org/wiki/Byte#Multiple-byte_units

KwangryeolPark commented 1 year ago

@vovaf709 According to your reference, MiB and MB are same unit because the MB in nvidia-smi means Memory. See the table

vovaf709 commented 1 year ago

I am confused) nvidia-smi shows MiB-s as it is denoted in the command output

image

But nvsmi shows same numbers with MB-s image

Here nvidia-smi-s 16376 MiB-s vs nvsmi-s 16376 MB-s. Isn't is wrong?

KwangryeolPark commented 1 year ago

I am confused) nvidia-smi shows MiB-s as it is denoted in the command output

image

But nvsmi shows same numbers with MB-s image

Here nvidia-smi-s 16376 MiB-s vs nvsmi-s 16376 MB-s. Isn't is wrong?

Theoretically, MiB and MB is different unit as you mentioned, but in general they work like same unit in computer scient as I know. However, it looks better to use MiB. So, it is better to fork this repository and fix MB to MiB at nvsmi/nvsmi.py line 61, 79, 228. After then, you can install the package with

pip install git+<your repository url>

for example

pip install git+https://github.com/xxxxxx/nvsmi.git