Dr-Noob / cpufetch

Simple yet fancy CPU architecture fetching tool
GNU General Public License v2.0
1.83k stars 100 forks source link

[ERROR]: print_ascii_riscv: Unable to find the extension to print (VisionFive 2 / JH7110) #192

Closed JamiKettunen closed 9 months ago

JamiKettunen commented 10 months ago

I see the titled error when running ./cpufetch after build on my VisionFive 2 (JH7110 SoC) with https://chimera-linux.org/:

                          #######                 SoC:                 StarFive VisionFive 2
                     ################.            Technology:          28nm
                ############   ###########        Microarchitecture:   U74
            ############           ##########.    Cores:               4 cores
       ############           #         ######    Max Frequency:       1.500 GHz
    ###########               #####         ##    Extensions:          rv64imafdc_zicntr_zicsr_zifencei_zihpm_zba_zbb
   #######.                   ##########           - (I) Integer Instruction Set
  ######            ###         *###########       - (M) Integer Multiplication and Division
  ######            #######.         ##########    - (A) Atomic Instructions
   #########        ############         ######    - (F) Single-Precision Floating-Point
     ###########.        ###########*         #    - (D) Double-Precision Floating-Point
         ############        ############          - (C) Compressed Instructions
   #         ############.       .###########      - (B) Double-Precision Floating-Point
   ######         ###########         #########    - (T) Transactional Memory
   ##########         .######,            #####    - (P) Packed-SIMD Instructions
      ############         ##.            #####.   - (N) User-Level Interrupts
           #########                   ########    - (H) Hypervisor
    ##         #####               ##########.     - (S) Supervisor-level Instructions
[ERROR]: print_ascii_riscv: Unable to find the extension to print
[VERSION]: cpufetch v1.04-8-g7d81 (Linux RISC-V build)
    #######        #          ############         - Snapdragon 
    ###########           ###########.             - Exynos 
        ###########. ############                  - Broadcom BCM
            ################                      Peak Performance:    6.00 GFLOP/s

The command still appears to mostly work and exists with code 0, and it doesn't appear to be present if I try ./cpufetch --logo-short instead:

                                 SoC:                 StarFive VisionFive 2
                                 Technology:          28nm
                   #             Microarchitecture:   U74
               ##########        Cores:               4 cores
          ########   ########    Max Frequency:       1.500 GHz
     ########              ####  Extensions:          rv64imafdc_zicntr_zicsr_zifencei_zihpm_zba_zbb
  #######           ####          - (I) Integer Instruction Set
 ####                #######      - (M) Integer Multiplication and Division
 ####        #####       #######  - (A) Atomic Instructions
  #######      ########      .##  - (F) Single-Precision Floating-Point
      ########      ########      - (D) Double-Precision Floating-Point
 ###      ########.     #######   - (C) Compressed Instructions
 #######       #####        ####  - (B) Double-Precision Floating-Point
     ########      #.       ####  - (T) Transactional Memory
  #      ####           #######   - (P) Packed-SIMD Instructions
  #####             #######       - (N) User-Level Interrupts
    ########   ########           - (H) Hypervisor

My theory is it tries to address the hypervisor core in the --logo-long mode as it also prints Supervisor-level Instructions under extensions before erroring; my kernel is v6.5 from https://github.com/esmil/linux/tree/jh7110/ with mainline U-Boot & OpenSBI as well

Dr-Noob commented 9 months ago

Hello, can you please download and compile the last fix in bugfix4 branch and report the output of ./cpufetch -v?

JamiKettunen commented 9 months ago
$ ./cpufetch -v
[WARNING]: Not parsed multi-letter extension: zicntr
[WARNING]: Not parsed multi-letter extension: zicsr
[WARNING]: Not parsed multi-letter extension: zifencei
[WARNING]: Not parsed multi-letter extension: zihpm
[WARNING]: Not parsed multi-letter extension: zba
[WARNING]: Not parsed multi-letter extension: zbb

                          #######                 
                     ################.            
                ############   ###########        
            ############           ##########.    
       ############           #         ######    SoC:                 StarFive VisionFive 2
    ###########               #####         ##    Technology:          28nm
   #######.                   ##########          Microarchitecture:   U74
  ######            ###         *###########      Cores:               4 cores
  ######            #######.         ##########   Max Frequency:       1.500 GHz
   #########        ############         ######   Extensions:          rv64imafdc_zicntr_zicsr_zifencei_zihpm_zba_zbb
     ###########.        ###########*         #    - (I) Integer Instruction Set
         ############        ############          - (M) Integer Multiplication and Division
   #         ############.       .###########      - (A) Atomic Instructions
   ######         ###########         #########    - (F) Single-Precision Floating-Point
   ##########         .######,            #####    - (D) Double-Precision Floating-Point
      ############         ##.            #####.   - (C) Compressed Instructions
           #########                   ########   Peak Performance:    6.00 GFLOP/s
    ##         #####               ##########.    
    #######        #          ############        
    ###########           ###########.            
        ###########. ############                 
            ################  
JamiKettunen commented 9 months ago

The fix appears to work, did you have something more in mind to do with the multi-letter extensions still?

Dr-Noob commented 9 months ago

Hello, I have added a few more patches and now it should work properly. Can you please confirm in your end?

JamiKettunen commented 9 months ago

Looks about right

                          #######                 
                     ################.            SoC:                 StarFive VisionFive 2
                ############   ###########        Technology:          28nm
            ############           ##########.    Microarchitecture:   U74
       ############           #         ######    Cores:               4 cores
    ###########               #####         ##    Max Frequency:       1.500 GHz
   #######.                   ##########          Extensions:          rv64imafdc_zicntr_zicsr_zifencei_zihpm_zba_zbb
  ######            ###         *###########       - (I) Integer Instruction Set
  ######            #######.         ##########    - (M) Integer Multiplication and Division
   #########        ############         ######    - (A) Atomic Instructions
     ###########.        ###########*         #    - (F) Single-Precision Floating-Point
         ############        ############          - (D) Double-Precision Floating-Point
   #         ############.       .###########      - (C) Compressed Instructions
   ######         ###########         #########    - (Zbb) Basic bit-manipulation
   ##########         .######,            #####    - (Zba) Address Generation
      ############         ##.            #####.   - (Zicntr) Base Counters and Timers
           #########                   ########    - (Zicsr) Control and Status Register
    ##         #####               ##########.     - (Zifencei) Instruction-Fetch Fence
    #######        #          ############         - (Zihpm) Hardware Performance Counters
    ###########           ###########.            Peak Performance:    6.00 GFLOP/s
        ###########. ############                 
            ################
Dr-Noob commented 9 months ago

LGTM. I'll merge this into main, thanks for reporting the issue!