Ashark
Ashark

Reputation: 843

How can I determine the generation/codename of an AMD GPU in Linux?

I want to detect the AMD GPU generation in Python code. My case is that to run specific application (DaVinci Resolve), it is required to use AMDGPU-PRO drivers for GPU cards before Vega. And AMDGPU-PRO drivers are not required when the AMD GPU is Vega or a newer generation. See the list of AMD GPUs on Wikipedia. I am writing a script (davinci-resolve-checker) that tells the user if he/she needs to use that driver.

The question is, how do I differentiate between GPU generations/chip codenames of a GPU? I am using pylspci to get information of the presented GPUs. Is there a list of generations that I can check with?

Upvotes: 1

Views: 755

Answers (1)

Ashark
Ashark

Reputation: 843

There is a pci id list published here: https://pci-ids.ucw.cz/v2.2/pci.ids

In that list for Advanced Micro Devices, Inc. [AMD/ATI] (1002 vendor id) you can see their devices. For example, for AMD Radeon PRO W6600 GPU there is 73e3 Navi 23 WKS-XL [Radeon PRO W6600] line.

There you can see if the device name contains the codename substring. In this case it is Navi.

For the specified question, the codenames that currently describes vega and above are: Vega, Navi. So if the device name does not contain that substring, I consider it as "older than vega".

For programming that, you do not actually need the list, as you can just take the device name from VerboseParser device.device.name. But just in case, this list is located in /usr/share/hwdata/pci.ids in the system.

Probably, it is not a very reliable way. But I did not yet found a better way. Any suggestions are welcome.

Upvotes: 0

Related Questions