question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Pentium CPU models just show as digit

See original GitHub issue

I have an old Pentium 4 laptop. The CPU shows up in BpyTOP currently as just “4”.

cpu_pentium_bug

cat /proc/cpuinfo

Result: model name : Intel(R) Pentium(R) 4 CPU 2.80GHz

Secondary issue is if the CPU temp is not available, the CPU info box is too small to display more than seven characters for the CPU name. So if I force it to display “BlahBlahBlah” as the model name, BpyTOP will only show “BlahBla”. Which leaves off the actual model number such as “III”, “3” or “4”.

So my suggested patch for this uses a shortened version of “Pentium” to deal with the possibility of having no CPU temps being displayed. To show the full “Pentium 4” name would need some logic to check that the length of the CPU info box is sufficient to display all characters extracted from the model name.

The patch is very simple. Add this just below the test for “Xeon”:

	elif "Pentium" in name:
		name = "Pent-" + nlist[nlist.index("CPU")-1]

After patch:

	if "Xeon" in name and "CPU" in name:
		name = nlist[nlist.index("CPU")+1]
	elif "Pentium" in name:
		name = "Pent-" + nlist[nlist.index("CPU")-1]
	elif "Ryzen" in name:
		name = " ".join(nlist[nlist.index("Ryzen"):nlist.index("Ryzen")+3])
	elif "Duo" in name and "@" in name:
		name = " ".join(nlist[:nlist.index("@")])
	elif "CPU" in name and not nlist[0] == "CPU":
		name = nlist[nlist.index("CPU")-1]

	name = " ".join(name.split())
	return name.replace("Processor ", "").replace("CPU ", "").replace("(R)", "").replace("(TM)", "").replace("Intel ", "")

This produces “Pent-4” for the model name on my machine. More than adequate, unless you really want to spend the extra 15 minutes to figure out how to calculate the length of the CPU info box and display “Pentium 4” if there is enough room and compact it to “Pent-4” if there isn’t.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
aristocratoscommented, Sep 20, 2020

Added in v1.0.34

1reaction
aristocratoscommented, Sep 16, 2020

@RedBearAK This is the regex I added \d?\.?\d+GHz will change it so the full replace block after the search will be:

name = name.replace("Processor", "").replace("CPU", "").replace("(R)", "").replace("(TM)", "").replace("Intel", "")
name = re.sub(r"\d?\.?\d+[mMgG][hH][zZ]", "", name)
name = " ".join(name.split())
Read more comments on GitHub >

github_iconTop Results From Across the Web

Pentium FDIV bug - Wikipedia
The Pentium FDIV bug is a hardware bug affecting the floating-point unit (FPU) of the early Intel Pentium processors. Because of the bug,...
Read more >
Pentium FDIV Bug | Encyclopedia MDPI
The Pentium FDIV bug is a hardware bug affecting the floating point unit ... This problem occurs only on some models of the...
Read more >
Bug Inside: A Tiny Chance of a Huge Error on Pentium
It appears that there is a bug in the floating point unit (numeric coprocessor) of many, and perhaps all, Pentium processors.
Read more >
The Pentium FDIV Bug | SciHi Blog
Because of the bug, the processor can return incorrect decimal results, an issue troublesome for the precise calculations needed in fields like ...
Read more >
CPU Bugs - OSDev Wiki
The Pentium FDIV bug is a bug in the Intel P5 Pentium floating point unit (FPU). Because of the bug, the processor can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found