Skip to content

Commit 500ccfa

Browse files
committed
Stable version 0.7 heavily tested in many different CPUs
1 parent 877833d commit 500ccfa

File tree

3 files changed

+64
-48
lines changed

3 files changed

+64
-48
lines changed

README.md

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
11
# cpufetch
22

33
Prints a fancy summary of the CPU with some advanced information
4+
![Example](i9.png)
45

56
### Platforms
6-
This tool works on both 64 only and under Linux because of its [implementation details](#implementation). AMD support is not guaranteed so information may not be correct
7+
cpufetch currently supports x86 CPUs (both Intel and AMD CPUs)
8+
9+
| Platform | Intel | AMD | Notes |
10+
|:---------:|:-------------------------:|:------------------------:|:-----------------:|
11+
| Linux | :heavy_check_mark: | :heavy_check_mark: | Prefered platform |
12+
| Windows | :heavy_check_mark: | :heavy_check_mark: | Some information may be missing. No colors and worse CPU art |
13+
| macOS | :heavy_exclamation_mark: | :heavy_exclamation_mark: | Untested |
14+
715

816
### Usage and installation
17+
#### Linux
18+
There is a cpufetch package available in Arch Linux ([cpufetch-git](https://aur.archlinux.org/packages/cpufetch-git)).
19+
20+
If you are in other distro, you can build `cpufetch` from source (see below)
21+
22+
#### Windows
23+
In the [releases](https://github.com/Dr-Noob/cpufetch/releases) section you will find some cpufetch executables compiled for Windows. Just download and run it from Windows CMD.
924

25+
#### Building from source
1026
Just clone the repo and use `make` to compile it
1127

1228
```
@@ -16,41 +32,34 @@ make
1632
./cpufetch
1733
```
1834

35+
The Makefile is designed to work on both Linux and Windows.
36+
1937
### Example
2038

21-
This is the output of `cpufetch` in a i7-4790K
39+
Here are more examples of how `cpufetch` looks on different CPUs.
2240

23-
![Example](/preview.png)
41+
![Example](epyc.png)
2442

25-
### Output
43+
![Example](cascade_lake.png)
2644

27-
Output is detailed as follows:
45+
### Colors and style
46+
By default, `cpufetch` will print the CPU art with the system colorscheme. However, you can always set a custom color scheme, either
47+
specifying Intel or AMD, or specifying the colors in RGB format:
2848

29-
| Field | Description | Possible Values |
30-
|:----------:|:-----------------------:|:-----------------:|
31-
| Name | Name of the CPU | Any valid CPU name |
32-
| Frequency | Max frequency of the CPU(in GHz) | X.XX(GHz or MHz)
33-
| N.Cores | Number of cores the CPU has. If CPU supports `Hyperthreading` or similar, this will show cores and threads separately | X(cores)X(threads)
34-
| AVX | Type of AVX supported by the CPU or None. AVX instructions allows the CPU to vectorize the code with a witdh of 256 bits in single precision(or 512bits if AVX512 is supported) | AVX,AVX2,AVX512,None
35-
| SSE | Same as AVX, but SSE family are 128bits witdh | SSE, SSE2, SSE3, SSSE3, SSE4a, SSE4_1, SSE4_2,None |
36-
| FMA | Does this CPU support FMA(Fused Multiply Add)?This instruction allows the CPU to multiply and add a value on the same clock cycle | FMA3,FMA4,None |
37-
| AES | Does this CPU support AES? This instruction is allows the CPU to make AES cypher efficiently | Yes or No |
38-
| SHA | Does this CPU support SHA? This instruction is allows the CPU to make SHA hashing efficiently | Yes or No |
39-
| L1 Size | Size(in bytes) of the L1 cache, separated in data and instructions | XXB(Data)XXB(instructions) |
40-
| L2 Size | Size(in bytes) of the L2 cache(both are unified) | XXXKB or None |
41-
| L3 Size | Same as L3 | XXXXKB or None |
42-
| Peak FLOPS | Max FLOPS(Floating Point Operation Per Second) this CPU could theoretical achieve. This is calculated by: `N.Cores*Freq*2(Because 2 functional units)*2(If has FMA)*VectorWidth` | XXX.XX (G/T)FLOPs |
49+
```
50+
./cpufetch --color intel (default color for Intel)
51+
./cpufetch --color amd (default color for AND)
52+
./cpufetch --color 239,90,45:210,200,200:100,200,45:0,200,200 (example)
53+
```
4354

44-
`cpufetch` also prints a simple ascii art of the manufacturer logo.
55+
In the case of setting the colors using RGB, 4 colors must be given in with the format: ``[R,G,B:R,G,B:R,G,B:R,G,B]``. These colors correspond to CPU art color (2 colors) and for the text colors (following 2). Thus, you can customize all the colors.
4556

4657
### Implementation
4758

48-
`cpufetch` makes use of two techniques to fetch data:
49-
* __cpuid__: CPU name, number of threads per core and instructions features are fetched via _cpuid_. See [this](http://www.sandpile.org/x86/cpuid.htm) and [Intel Processor Identification and the CPUID Instruction](https://www.scss.tcd.ie/~jones/CS4021/processor-identification-cpuid-instruction-note.pdf) for more information.
50-
* __udev__: Cache and frequency are fetched via _udev_, by looking at specific files from `/sys/devices/system/cpu`
59+
`cpufetch` fetches all of the information using the `CPUID` x86 instruction. There are, however, some cases where the CPU does not support fetching some needed information. In this case, `cpufetch` will use `/sys/devices/system/cpu` in Linux as a fallback. If `cpufetch` is running on Windows and `CPUID` does not give all the data, `cpufetch` won't be able to show it. [I hope this can be fixed in the future](https://github.com/Dr-Noob/cpufetch/issues/30)
5160

5261
### Bugs or improvements
53-
Feel free to open a issue on the repo to report a issue or propose any improvement in the tool
62+
There are many open issues in github (see [issues](https://github.com/Dr-Noob/cpufetch/issues)). Feel free to open a new one report a issue or propose any improvement in `cpufetch`
5463

55-
### Important note
56-
Current status of development of cpufetch is incomplete (there are lots of bugs at the moment). I will fix them, add some other features and update the Arch Linux package when I have time.
64+
### Testers
65+
I would like to thank [Gonzalocl](https://github.com/Gonzalocl) and [OdnetninI](https://github.com/OdnetninI) for their help, running `cpufeth` in many different CPUs they have access to, which makes it easier to debug and check the correctness of `cpufetch`.

cpufetch.8

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,57 @@
1-
.TH man 8 "12 Jul 2020" "0.6" "cpufetch man page"
1+
.TH man 8 "1 Sep 2020" "0.7" "cpufetch man page"
22
.SH NAME
33
cpufetch \- Prints a fancy summary of the CPU with some advanced information
44
.SH SYNOPSIS
5-
cpufetch [--version] [--help] [--levels] [--style fancy|retro|legacy] [--color 'R,G,B:R,G,B:R,G,B:R,G,B']
5+
cpufetch [--version] [--help] [--levels] [--style fancy|retro|legacy] [--color intel|amd|'R,G,B:R,G,B:R,G,B:R,G,B']
66
.SH DESCRIPTION
7-
cpufetch will print CPU information, for which will query CPUID instructions and udev directories on Linux as a fallback method. It will display:
7+
cpufetch will print CPU information, for which will query CPUID instructions and udev directories on Linux as a fallback method. Some of this features are:
88
.IP \[bu] 2
99
Name
1010
.IP \[bu]
1111
Frequency
1212
.IP \[bu]
1313
Number of cores (Physical and Logical)
1414
.IP \[bu]
15-
AVX,SSE,FMA,AES,SHA instructions support
16-
.IP \[bu]
1715
Cache sizes
1816
.IP \[bu]
19-
Theoretical peak flops (computed using the max frequency. This is only an approximation, please see https://github.com/Dr-Noob/FLOPS if you are interested in peak performance)
17+
Theoretical peak performance in floating point operations per second (FLOP/s)
2018
.SH OPTIONS
2119
.TP
22-
\fB\-\-style\fR \f[I][R,G,B:R,G,B:R,G,B:R,G,B]\f[]
23-
Set a custom color scheme. 4 colors must be specified in RGB with the format R,G,B:R,G,B:...
24-
Suggested custom color schemes:
20+
\fB\-\-style\fR \f[I][intel|amd|R,G,B:R,G,B:R,G,B:R,G,B]\f[]
21+
Set the color scheme. By default, cpufetch uses the system color scheme. This option lets the user use different colors to print the CPU art:
22+
.IP \[bu]
23+
\fB"intel"\fR: Use intel color scheme
2524
.IP \[bu]
26-
\fBIntel\fR: --color 15,125,194:230,230,230:40,150,220:230,230,230
25+
\fB"amd"\fR: Use amd color scheme
2726
.IP \[bu]
28-
\fBAMD\fR: --color 250,250,250:0,154,102:250,250,250:0,154,102
27+
\fBcustom\fR: If color do not match "intel" or "amd", a custom scheme can be specified: 4 colors must be given in RGB with the format: R,G,B:R,G,B:...
28+
These colors correspond to CPU art color (2 colors) and for the text colors (following 2)
2929
.TP
3030
\fB\-\-style\fR \f[I]STYLE\f[]
3131
Specify the style of ascii logo:
3232
.IP \[bu]
33-
\fBfancy\fR: Default style
33+
\fB"fancy"\fR: Default style
3434
.IP \[bu]
35-
\fBretro\fR: Old cpufetch style
35+
\fB"retro"\fR: Old cpufetch style
3636
.IP \[bu]
37-
\fBlegacy\fR: Fallback style for terminals that does not support colors
38-
.TP
39-
\fB\-\-help\fR
40-
Prints help
37+
\fB"legacy"\fR: Fallback style for terminals that does not support colors
4138
.TP
4239
\fB\-\-levels\fR
4340
Prints CPUID levels and CPU name
4441
.TP
42+
\fB\-\-verbose\fR
43+
Prints extra information (if available) about how cpufetch tried fetching information
44+
.TP
45+
\fB\-\-help\fR
46+
Prints help
47+
.TP
4548
\fB\-\-version\fR
4649
Prints cpufetch version
4750
.SH BUGS
4851
Bugs should be posted on: https://github.com/Dr-Noob/cpufetch/issues
52+
.SH NOTES
53+
Peak performance information is NOT accurate. cpufetch computes peak performance using the max
54+
frequency. However, to properly compute peak performance, you need to know the frequency of the
55+
CPU running AVX code, which is not be fetched by cpufetch since it depends on each specific CPU.
4956
.SH AUTHOR
5057
Dr-Noob (https://github.com/Dr-Noob)

src/main.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@
66
#include "cpuid.h"
77
#include "global.h"
88

9-
static const char* VERSION = "0.67";
9+
static const char* VERSION = "0.7";
1010

1111
void print_help(char *argv[]) {
1212
printf("Usage: %s [--version] [--help] [--levels] [--style \"fancy\"|\"retro\"|\"legacy\"] [--color \"intel\"|\"amd\"|'R,G,B:R,G,B:R,G,B:R,G,B']\n\n\
1313
Options: \n\
1414
--color Set the color scheme. By default, cpufetch uses the system color scheme. This option \n\
1515
lets the user use different colors to print the CPU art: \n\
16-
* \"intel\": Use to intel color scheme \n\
16+
* \"intel\": Use intel default color scheme \n\
1717
* \"amd\": Use amd default color scheme \n\
1818
* custom: If color do not match \"intel\" or \"amd\", a custom scheme can be specified: \n\
1919
4 colors must be given in RGB with the format: R,G,B:R,G,B:... \n\
2020
These colors correspond to CPU art color (2 colors) and for the text colors (following 2) \n\
2121
For example: --color 239,90,45:210,200,200:100,200,45:0,200,200 \n\n\
2222
--style Set the style of CPU art: \n\
23-
* \"fancy\" (default style) \n\
24-
* \"retro\" (old cpufetch style) \n\
25-
* \"legacy\" \n\n\
23+
* \"fancy\": Default style \n\
24+
* \"retro\": Old cpufetch style \n\
25+
* \"legacy\": Fallback style for terminals that does not support colors \n\n\
2626
--levels Prints CPU model and cpuid levels (debug purposes)\n\n\
2727
--verbose Prints extra information (if available) about how cpufetch tried fetching information\n\n\
2828
--help Prints this help and exit\n\n\

0 commit comments

Comments
 (0)