Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Dec 20, 2021
Merged

Conversation

jeffra
Copy link
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
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