workhorsy / py-cpuinfo

A module for getting CPU info with pure Python
MIT License
312 stars 59 forks source link

Add support for CPU ISA `loongarch` #166

Closed willliu closed 1 year ago

willliu commented 3 years ago

Dear community, this PR includes update with support for the loongarch architecture.

All tests passed, and verified on a native machine.

cpuinfo.get_cpu_info()

{'python_version': '3.7.3.final.0 (64 bit)', 'cpuinfo_version': [8, 0, 0], 'cpuinfo_version_string': '8.0.0', 'arch': 'LOONG_64', 'bits': 64, 'count': 4, 'arch_string_raw': 'loongarch64' ...}

p.s. this is intended for a later update for conda to support loongarch, as discussed here conda/conda#10866

workhorsy commented 3 years ago

I don't have a loongarch CPU to test this on. Can you add a test to the test suite that verifies that this works?

willliu commented 3 years ago

@workhorsy New updates and test file provided. The conflicts happened because of the RISC-V support is recently added, now resolved as following:

1) cpuinfo/cpuinfo.py: update the content around line 374, add contents around line 851 2) test_suite.py: add the content around line 61 3) tests/test_invalid_cpu.py: add the content around line 36

If necessary, willing to open a new pull request and modify from the current master branch, but may need some time (to carefully update the current fork).

workhorsy commented 3 years ago

If you want, you can update the current pull request, or make a new one. Thanks.

willliu commented 3 years ago

@workhorsy Good, being new to the git tools, may need some time to start a new pull request.

willliu commented 2 years ago

@jezdez Yes, there seem to be some careful search about Loongson ISA to be done before a new pull request.

cheungxi commented 1 year ago

how is the progress? @willliu @workhorsy

willliu commented 1 year ago

@cheungxi please refer to https://github.com/conda/conda/pull/11956 , the owner of which is not taking over this issue

cheungxi commented 1 year ago

@cheungxi please refer to conda/conda#11956 , the owner of which is not taking over this issue

@willliu Can I be a collaborator for your repository

xen0n commented 1 year ago

Hi, I've cleaned up the code here and submitted #194 (with your author info retained of course). Would you mind reviewing that PR, and if it's okay to you, close this PR or just reset your branch to HEAD of mine? The commit history of this branch is a bit too messy for upstreaming.

workhorsy commented 1 year ago

I'm going to close this PR for now, as #194 solves this problem. Feel free to make more PRs or reopen it. Thanks for your help everyone.

willliu commented 1 year ago

@xen0n Just see the notification of this PR, favoring your way of opening #194 to make this issue solved. @workhorsy Sure, glad to see this issue closed by #194.