Skip to content

Normalization of AMD brand string with "with Radeon Graphics"#389

Open
johnthacker wants to merge 1 commit into
pytorch:mainfrom
johnthacker:amd_with
Open

Normalization of AMD brand string with "with Radeon Graphics"#389
johnthacker wants to merge 1 commit into
pytorch:mainfrom
johnthacker:amd_with

Conversation

@johnthacker
Copy link
Copy Markdown

Some AMD processors with integrated graphics have "with Radeon Graphics" in the cpuid brand string without being preceded by other tokens like "SOC" or "APU" that are already used to erase the string. With the current logic, everything starting with "Radeon" is erased, leading to less than ideal results. Add a check for a "with" token and erase everything starting with that.

Running cpu-info before:

Packages:
0: AMD Ryzen 5 PRO 6650U with

and after:

Packages:
0: AMD Ryzen 5 PRO 6650U

There are plenty of other examples at
https://github.com/InstLatx64/InstLatx64/tree/master/AuthenticAMD

Some AMD processors with integrated graphics have "with Radeon Graphics"
in the cpuid brand string without being preceded by other tokens like
"SOC" or "APU" that are already used to erase the string. With the
current logic, everything starting with "Radeon" is erased, leading to
less than ideal results. Add a check for a "with" token and erase
everything starting with that.

Running cpu-info before:

Packages:
        0: AMD Ryzen 5 PRO 6650U with

and after:

Packages:
        0: AMD Ryzen 5 PRO 6650U

There are plenty of other examples at
https://github.com/InstLatx64/InstLatx64/tree/master/AuthenticAMD

Signed-off-by: John Thacker <johnthacker@gmail.com>
@meta-cla meta-cla Bot added the cla signed label May 16, 2026
@fbarchard
Copy link
Copy Markdown
Collaborator

I dont know the erase function(), so I had antigravity review this change

Yes, this PR makes complete sense.

• The Problem: AMD APUs (processors with integrated graphics) include graphics information in their CPUID brand string, typically starting with "with Radeon Graphics" .
• Existing Logic: cpuinfo aims to extract only the CPU model (e.g., "Ryzen 5 PRO 6650U" ). For older models, it encountered tokens like "APU" or "SOC" first, which triggered truncation, discarding "with Radeon Graphics" . However, newer
AMD processors (like the Ryzen 5 PRO 6650U) do not have "APU" or "SOC" in their brand string.
• The Bug: Without "APU" or "SOC" , the parser continued until it hit "Radeon" , which it stripped along with everything after it. This left the trailing word "with" in the normalized string, resulting in "AMD Ryzen 5 PRO 6650U with" .
• The Fix: The PR adds "with" as a truncating token. When "with" is encountered, it is erased, and the parser truncates the string immediately, effectively discarding the graphics information and leaving only the correct CPU model.

2. Coding Conventions

The implementation perfectly aligns with cpuinfo 's existing brand string normalization design in name.c:

• It integrates into the transform_token function under case 4: (since "with" has 4 characters).
• It utilizes the helper erase_matching to replace "with" with spaces and returns false to signal the caller to truncate the string.
• It includes a test case in brand-string.cc to verify the fix against the real-world brand string: "AMD Ryzen 5 PRO 6650U with Radeon Graphics" .

3. Brand Strings with "with"

• In x86 CPUID brand strings, "with" is almost exclusively used by AMD to denote integrated graphics (e.g., "with Radeon Graphics" , "with Radeon(TM) R7 Graphics" ).
• Intel brand strings do not typically use "with" in their CPUID model names.
• Therefore, treating "with" as a truncation trigger is a safe and robust way to strip integrated graphics marketing suffixes from AMD processors without risking accidental truncation of important model information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants