How to uniquely identify GPUs (of the same model) on Linux?

3

I have multiple AMD Radeon GPUs (of the same model) on Linux. I'd like to be able to uniquely identify them, so that if I swap them between PCIe slots, or even between machines, I'll know which one is which without tracking them physically.

Is it possible to get a unique ID (e.g. the serial number) of a GPU on Linux? lspci, dmidecode and /sys/bus/pci/devices/0000:nn:00.0/ don't seem to give anything useful for this purpose. I could also insert an unique ID into the empty space of the BIOS image, but doing so will likely void the warranty.

I'm aware of the similar question "Is it possible to get the serial number of a GPU without opening the case?", but mine is on Linux and I can use any unique IDs, not just the serial number.

netvope

Posted 2014-01-05T03:23:06.563

Reputation: 4 505

Answers

0

Dell has a document that describes how to identify devices by slot on linux.

Run dmidecode –t slot and match Bus Address and Designation for populated PCI slots
then
Run lspci –s to get info about device at the Bus Address for a given PCI slot.

Or use their bash script

Edit. Testing this further shows that this can identify the model of video cards, but can't distinguish between identical cards.

spuder

Posted 2014-01-05T03:23:06.563

Reputation: 8 755

2The OP already mentioned that neither lspci nor dmidecode help. If you know how to use these tools to get the info, please edit your answer to explain how. – terdon – 2014-01-05T11:25:01.160

spuder has a fine answer, @terdon. Both the bash script and Dell's document address the OP, no reason to disparage this answer. +1 for me. – MariusMatutiae – 2014-01-05T17:17:46.940

@MariusMatutiae I was not disparaging as such, but: 1) Link answers are discouraged, it is better to copy the relevant info into the answer (especially for such a small document) 2) the OP mentions both tools and specifically states that they did not help. I also tried this on my Dell laptop and couldn't figure out how to link dmidecode output to lspci's. Therefore, this answer just suggests the OP do what (s)he has already done without explaining how to do it or giving any extra information at all. How is it a fine answer?

– terdon – 2014-01-05T17:23:10.430

1@terdon He provides a new document, a new bash script, info on how to use two instruments in a novel way. Whether they work or not is a subject for discussion, not for terse dismissal. – MariusMatutiae – 2014-01-05T17:45:39.237

1@MariusMatutiae I was not terse. I politely (note the please) asked that spuder edit the answer to explain how to use the tools suggested. I did not downvote nor leave a disparaging comment, let alone a terse dismissal. That the proposed solution does not work IS a problem, how could it not be? The bash script is neither useful nor new because it also uses the dmidecode command whose output does not seem to contain the necessary info. That's why we test our answers before posting them. This is simply a direct copy/paste of a post on Dell's forum, has not been tested and does not work. – terdon – 2014-01-05T17:54:02.307

@terdon Fine, this is constructive criticism, let us leave it at this. – MariusMatutiae – 2014-01-05T17:58:44.520