Skip to content

add backup cpu-arch detection if py-cpuinfo fails#1652

Merged
jeffra merged 2 commits into
masterfrom
fix-cpu-info
Dec 20, 2021
Merged

add backup cpu-arch detection if py-cpuinfo fails#1652
jeffra merged 2 commits into
masterfrom
fix-cpu-info

Conversation

@jeffra
Copy link
Copy Markdown
Collaborator

@jeffra jeffra commented Dec 20, 2021

Follow-up to #1616. For some reason on A100-80GB machines we are seeing py-cpuinfo crash with the below stack trace. We are still debugging to see if we can identify a better fix on our side or propose a fix on py-cpuinfo side. This PR detects this error case and reverts to the old lscpu method if it works on that machine type.

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<string>", line 2, in <module>
  File "/opt/conda/lib/python3.8/site-packages/cpuinfo/cpuinfo.py", line 2743, in get_cpu_info
    output = json.loads(output, object_hook = _utf_to_str)
  File "/opt/conda/lib/python3.8/json/__init__.py", line 370, in loads
    return cls(**kw).decode(s)
  File "/opt/conda/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/opt/conda/lib/python3.8/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Copy link
Copy Markdown
Contributor

@RezaYazdaniAminabadi RezaYazdaniAminabadi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! thanks @jeffra

@jeffra jeffra merged commit cbd68dc into master Dec 20, 2021
@jeffra jeffra deleted the fix-cpu-info branch December 20, 2021 23:13
jeffra added a commit that referenced this pull request Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants