fastfetch-cli / fastfetch

An actively maintained, feature-rich and performance oriented, neofetch like system information tool.
MIT License
10.31k stars 401 forks source link

[BUG] Temperature for both Nvidia GPU and Intel CPU not showing up #1155

Closed justbispo closed 2 months ago

justbispo commented 2 months ago

General description of bug:

Often helpful information:

Screenshot: fastfetch

The content of the configuration file you use (if any):

{
    "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
    "modules": [
        {
            "type": "cpu",
            "format": "{1} | {8}"
        },
        {
            "type": "gpu",
            "format": "{1} {2} | {4}"
        }
    ]
}

Output of fastfetch -c ci.jsonc --format json:

[
  {
    "type": "Title",
    "result": {
      "userName": "test",
      "hostName": "test-Arch",
      "homeDir": "/home/test/",
      "exePath": "/usr/bin/fastfetch",
      "userShell": "nu"
    },
    "stat": 0
  },
  {
    "type": "Separator",
    "error": "Unsupported for JSON format",
    "stat": 0
  },
  {
    "type": "OS",
    "result": {
      "buildID": "rolling",
      "codename": "",
      "id": "arch",
      "idLike": "",
      "name": "Arch Linux",
      "prettyName": "Arch Linux",
      "variant": "",
      "variantID": "",
      "version": "",
      "versionID": ""
    },
    "stat": 1
  },
  {
    "type": "Host",
    "result": {
      "family": "X",
      "name": "test",
      "version": "1.0",
      "sku": "",
      "vendor": "",
      "serial": "",
      "uuid": ""
    },
    "stat": 0
  },
  {
    "type": "Bios",
    "result": {
      "date": "02/19/2019",
      "release": "5.6",
      "vendor": "American Megatrends Inc.",
      "version": "",
      "type": "UEFI"
    },
    "stat": 0
  },
  {
    "type": "Bootmgr",
    "result": {
      "name": "rEFInd Boot Manager",
      "firmware": "\\EFI\\REFIND\\REFIND_X64.EFI",
      "secureBoot": false
    },
    "stat": 0
  },
  {
    "type": "Board",
    "result": {
      "name": "",
      "vendor": "",
      "version": "1.0",
      "serial": ""
    },
    "stat": 0
  },
  {
    "type": "Chassis",
    "result": {
      "type": "Notebook",
      "vendor": "",
      "version": "1.0",
      "serial": ""
    },
    "stat": 0
  },
  {
    "type": "Kernel",
    "result": {
      "architecture": "x86_64",
      "name": "Linux",
      "release": "6.10.2-arch1-1",
      "version": "#1 SMP PREEMPT_DYNAMIC Sat, 27 Jul 2024 16:49:55 +0000",
      "displayVersion": "",
      "pageSize": 4096
    },
    "stat": 0
  },
  {
    "type": "InitSystem",
    "result": {
      "name": "systemd",
      "exe": "/usr/lib/systemd/systemd",
      "version": "256.4-1-arch",
      "pid": 1
    },
    "stat": 5
  },
  {
    "type": "Uptime",
    "result": {
      "uptime": 14175000,
      "bootTime": "2024-08-04T23:20:53.781+0100"
    },
    "stat": 0
  },
  {
    "type": "Loadavg",
    "result": [
      2.24658203125,
      1.611328125,
      1.71875
    ],
    "stat": 0
  },
  {
    "type": "Processes",
    "result": 287,
    "stat": 1
  },
  {
    "type": "Packages",
    "result": {
      "all": 1842,
      "apk": 0,
      "brew": 0,
      "brewCask": 0,
      "choco": 0,
      "dpkg": 0,
      "emerge": 0,
      "eopkg": 0,
      "flatpakSystem": 2,
      "flatpakUser": 0,
      "nixDefault": 0,
      "nixSystem": 0,
      "nixUser": 0,
      "pacman": 1840,
      "paludis": 0,
      "pkg": 0,
      "pkgtool": 0,
      "macports": 0,
      "rpm": 0,
      "scoop": 0,
      "snap": 0,
      "winget": 0,
      "xbps": 0,
      "opkg": 0,
      "am": 0,
      "sorcery": 0,
      "guixSystem": 0,
      "guixUser": 0,
      "guixHome": 0,
      "pacmanBranch": ""
    },
    "stat": 0
  },
  {
    "type": "Shell",
    "result": {
      "exe": "nu",
      "exeName": "nu",
      "exePath": "/usr/bin/nu",
      "pid": 106143,
      "ppid": 106137,
      "processName": "nu",
      "prettyName": "nushell",
      "version": "0.96.1",
      "tty": 10
    },
    "stat": 0
  },
  {
    "type": "Editor",
    "result": {
      "type": "Visual",
      "name": "/usr/bin/micro",
      "path": "/usr/bin/micro",
      "exe": "micro",
      "version": "2.0.13"
    },
    "stat": 5
  },
  {
    "type": "Display",
    "result": [
      {
        "id": 3615617738607510600,
        "name": "",
        "primary": false,
        "output": {
          "width": 1920,
          "height": 1080
        },
        "scaled": {
          "width": 1920,
          "height": 1080
        },
        "physical": {
          "width": 480,
          "height": 270
        },
        "refreshRate": 60.0,
        "rotation": 0,
        "bitDepth": 0,
        "hdrEnabled": false,
        "wcgEnabled": false,
        "type": "External"
      }
    ],
    "stat": 4
  },
  {
    "type": "Brightness",
    "result": [
      {
        "name": "",
        "max": 937.0,
        "min": 0.0,
        "current": 281.0
      }
    ],
    "stat": 0
  },
  {
    "type": "Monitor",
    "result": [
      {
        "hdrCompatible": false,
        "name": "HDMI-A-2",
        "resolution": {
          "width": 1920,
          "height": 1080
        },
        "physical": {
          "height": 270,
          "width": 480
        },
        "refreshRate": 59.962843833185445,
        "manufactureDate": null,
        "serial": null
      }
    ],
    "stat": 2
  },
  {
    "type": "LM",
    "result": {
      "service": "greetd",
      "type": "Wayland",
      "version": ""
    },
    "stat": 0
  },
  {
    "type": "DE",
    "error": "No DE found",
    "stat": 0
  },
  {
    "type": "WM",
    "result": {
      "processName": "sway",
      "prettyName": "Sway",
      "protocolName": "Wayland",
      "pluginName": ""
    },
    "stat": 0
  },
  {
    "type": "WMTheme",
    "error": "Unknown WM: Sway",
    "stat": 0
  },
  {
    "type": "Theme",
    "result": {
      "theme1": "Fusion [Qt]",
      "theme2": "adw-gtk3-dark [GTK2/3/4]"
    },
    "stat": 0
  },
  {
    "type": "Icons",
    "result": {
      "icons1": "Papirus-Dark [Qt]",
      "icons2": "Papirus-Dark [GTK2/3/4]"
    },
    "stat": 0
  },
  {
    "type": "Font",
    "result": {
      "display": "Noto Sans (11pt, Regular) [Qt], Noto Sans Regular (11pt) [GTK2/3/4]",
      "fonts": [
        "Noto Sans (11pt, Regular)",
        "Noto Sans Regular (11pt)",
        "Noto Sans Regular (11pt)",
        "Noto Sans Regular (11pt)"
      ]
    },
    "stat": 0
  },
  {
    "type": "Cursor",
    "result": {
      "theme": "Bibata-Original-Classic",
      "size": ""
    },
    "stat": 0
  },
  {
    "type": "Wallpaper",
    "error": "Failed to detect the current wallpaper path",
    "stat": 0
  },
  {
    "type": "Terminal",
    "result": {
      "processName": "kitty",
      "exe": "kitty",
      "exeName": "kitty",
      "exePath": "/usr/bin/kitty",
      "pid": 106137,
      "ppid": 1,
      "prettyName": "kitty",
      "version": "0.35.2",
      "tty": ""
    },
    "stat": 3
  },
  {
    "type": "TerminalFont",
    "result": {
      "font": {
        "name": "CascadiaCode-Regular",
        "size": "11",
        "styles": [],
        "pretty": "CascadiaCode-Regular (11pt)"
      },
      "fallback": {
        "name": "",
        "size": "",
        "styles": [],
        "pretty": ""
      }
    },
    "stat": 7
  },
  {
    "type": "TerminalSize",
    "result": {
      "columns": 213,
      "rows": 56,
      "width": 1917,
      "height": 1008
    },
    "stat": 7
  },
  {
    "type": "TerminalTheme",
    "result": {
      "fg": {
        "r": 151,
        "g": 158,
        "b": 171,
        "dark": false
      },
      "bg": {
        "r": 40,
        "g": 44,
        "b": 52,
        "dark": true
      }
    },
    "stat": 6
  },
  {
    "type": "CPU",
    "result": {
      "cpu": "Intel(R) Core(TM) i5-5200U",
      "vendor": "GenuineIntel",
      "cores": {
        "physical": 2,
        "logical": 4,
        "online": 4
      },
      "frequency": {
        "base": 2196,
        "max": 2700,
        "biosLimit": 0
      },
      "coreTypes": [
        {
          "count": 4,
          "freq": 2700
        }
      ],
      "temperature": 50.0
    },
    "stat": 4
  },
  {
    "type": "CPUCache",
    "result": {
      "l1": [
        {
          "size": 32768,
          "num": 2,
          "lineSize": 64,
          "type": "data"
        },
        {
          "size": 32768,
          "num": 2,
          "lineSize": 64,
          "type": "instruction"
        }
      ],
      "l2": [
        {
          "size": 262144,
          "num": 2,
          "lineSize": 64,
          "type": "unified"
        }
      ],
      "l3": [
        {
          "size": 3145728,
          "num": 1,
          "lineSize": 64,
          "type": "unified"
        }
      ]
    },
    "stat": 1
  },
  {
    "type": "CPUUsage",
    "result": [
      4.761904761904762,
      0.0,
      0.0,
      0.0
    ],
    "stat": 200
  },
  {
    "type": "GPU",
    "result": [
      {
        "coreCount": null,
        "memory": {
          "dedicated": {
            "total": null,
            "used": null
          },
          "shared": {
            "total": null,
            "used": null
          }
        },
        "driver": "i915",
        "name": "HD Graphics 5500",
        "temperature": null,
        "type": "Integrated",
        "vendor": "Intel",
        "platformApi": "DRM (card1)",
        "frequency": 900.0,
        "deviceId": 22616
      },
      {
        "coreCount": null,
        "memory": {
          "dedicated": {
            "total": null,
            "used": null
          },
          "shared": {
            "total": null,
            "used": null
          }
        },
        "driver": "nvidia 470.256.02",
        "name": "GeForce 920M",
        "temperature": null,
        "type": "Discrete",
        "vendor": "NVIDIA",
        "platformApi": "DRM (card0)",
        "frequency": 0.0,
        "deviceId": 19044
      }
    ],
    "stat": 2
  },
  {
    "type": "Memory",
    "result": {
      "total": 12433375232,
      "used": 7018713088
    },
    "stat": 0
  },
  {
    "type": "PhysicalMemory",
    "error": "Failed to get SMBIOS data",
    "stat": 0
  },
  {
    "type": "Swap",
    "result": {
      "total": 0,
      "used": 0
    },
    "stat": 0
  },
  {
    "type": "Disk",
    "result": [
      {
        "bytes": {
          "available": 84752183296,
          "free": 85854957568,
          "total": 195364388864,
          "used": 109509431296
        },
        "files": {
          "total": null,
          "used": null
        },
        "filesystem": "btrfs",
        "mountpoint": "/",
        "mountFrom": "/dev/sda6",
        "name": "ARCH",
        "volumeType": [
          "Regular"
        ],
        "createTime": "2022-03-27T23:26:36.000+0100"
      },
      {
        "bytes": {
          "available": 180523008,
          "free": 180523008,
          "total": 418557952,
          "used": 238034944
        },
        "files": {
          "total": null,
          "used": null
        },
        "filesystem": "vfat",
        "mountpoint": "/boot",
        "mountFrom": "/dev/sda2",
        "name": "ARCH-boot",
        "volumeType": [
          "Hidden"
        ],
        "createTime": null
      },
      {
        "bytes": {
          "available": 84752183296,
          "free": 85854957568,
          "total": 195364388864,
          "used": 109509431296
        },
        "files": {
          "total": null,
          "used": null
        },
        "filesystem": "btrfs",
        "mountpoint": "/home",
        "mountFrom": "/dev/sda6",
        "name": "ARCH",
        "volumeType": [
          "Subvolume"
        ],
        "createTime": "2023-11-08T17:18:31.542+0000"
      },
      {
        "bytes": {
          "available": 230835802112,
          "free": 230835802112,
          "total": 314572800000,
          "used": 83736997888
        },
        "files": {
          "total": 226048180,
          "used": 503135
        },
        "filesystem": "fuseblk",
        "mountpoint": "/media/WINDOWS-C:",
        "mountFrom": "/dev/sda3",
        "name": "Windows",
        "volumeType": [
          "Subvolume"
        ],
        "createTime": null
      },
      {
        "bytes": {
          "available": 836032376832,
          "free": 839652208640,
          "total": 1000203091968,
          "used": 160550883328
        },
        "files": {
          "total": null,
          "used": null
        },
        "filesystem": "btrfs",
        "mountpoint": "/mnt/MEDIA",
        "mountFrom": "/dev/sdb1",
        "name": "MEDIA",
        "volumeType": [
          "Regular"
        ],
        "createTime": "2022-08-08T23:28:14.000+0100"
      },
      {
        "bytes": {
          "available": 230835802112,
          "free": 230835802112,
          "total": 314572800000,
          "used": 83736997888
        },
        "files": {
          "total": 226048180,
          "used": 503135
        },
        "filesystem": "fuseblk",
        "mountpoint": "/mnt/WINDOWS-C:",
        "mountFrom": "/dev/sda3",
        "name": "Windows",
        "volumeType": [
          "Regular"
        ],
        "createTime": null
      }
    ],
    "stat": 1
  },
  {
    "type": "Battery",
    "result": [
      {
        "capacity": 92.0,
        "manufacturer": "",
        "manufactureDate": "",
        "modelName": "",
        "status": "AC Connected",
        "technology": "Li-ion",
        "serial": "",
        "temperature": null,
        "cycleCount": 112
      }
    ],
    "stat": 1
  },
  {
    "type": "PowerAdapter",
    "result": [],
    "stat": 0
  },
  {
    "type": "Player",
    "result": {
      "player": "",
      "playerId": "",
      "url": ""
    },
    "stat": 2
  },
  {
    "type": "Media",
    "result": {
      "song": "",
      "artist": "",
      "album": "",
      "status": ""
    },
    "stat": 0
  },
  {
    "type": "PublicIp",
    "result": {
      "ip": "",
      "location": ""
    },
    "stat": 0
  },
  {
    "type": "LocalIp",
    "result": [
      {
        "defaultRoute": true,
        "ipv4": "",
        "ipv6": "",
        "mac": "",
        "name": "enp2s0",
        "mtu": 1500
      }
    ],
    "stat": 0
  },
  {
    "type": "DNS",
    "result": [
      "",
      ""
    ],
    "stat": 0
  },
  {
    "type": "Wifi",
    "result": [
      {
        "inf": {
          "description": "wlan0",
          "status": "Unavailable"
        },
        "conn": {
          "status": "",
          "ssid": "",
          "bssid": "",
          "protocol": "",
          "security": "",
          "signalQuality": null,
          "rxRate": null,
          "txRate": null
        }
      }
    ],
    "stat": 22
  },
  {
    "type": "DateTime",
    "result": "2024-08-04T19:24:39.049+0100",
    "stat": 0
  },
  {
    "type": "Locale",
    "result": "en_US.UTF-8",
    "stat": 0
  },
  {
    "type": "Vulkan",
    "result": {
      "apiVersion": "1.3.278",
      "conformanceVersion": "1.3",
      "driver": "NVIDIA [470.256.02]Intel open-source Mesa driver [Mesa 24.1.5-arch1.1]",
      "gpus": [
        {
          "type": "Discrete",
          "vendor": "NVIDIA",
          "name": "NVIDIA GeForce 920M",
          "driver": "470.256.02",
          "platformApi": "Vulkan 1.2.175",
          "deviceId": 4761,
          "memory": {
            "dedicated": {
              "total": 2147483648,
              "used": null
            },
            "shared": {
              "total": 9325031424,
              "used": null
            }
          },
          "deviceId": 4761
        },
        {
          "type": "Integrated",
          "vendor": "Intel",
          "name": "Intel(R) HD Graphics 5500 (BDW GT2)",
          "driver": "Mesa 24.1.5-arch1.1",
          "platformApi": "Vulkan 1.3.278",
          "deviceId": 5654,
          "memory": {
            "dedicated": {
              "total": 0,
              "used": null
            },
            "shared": {
              "total": 6216687616,
              "used": null
            }
          },
          "deviceId": 5654
        }
      ]
    },
    "stat": 49
  },
  {
    "type": "OpenGL",
    "result": {
      "version": "4.6 (Compatibility Profile) Mesa 24.1.5-arch1.1",
      "renderer": "Mesa Intel(R) HD Graphics 5500 (BDW GT2)",
      "vendor": "Intel",
      "slv": "4.60",
      "library": "EGL 1.5"
    },
    "stat": 62
  },
  {
    "type": "OpenCL",
    "result": {
      "version": "3.0 CUDA 11.4.557",
      "name": "NVIDIA CUDA",
      "vendor": "NVIDIA Corporation",
      "gpus": [
        {
          "type": "Discrete",
          "vendor": "NVIDIA",
          "name": "NVIDIA GeForce 920M",
          "driver": "470.256.02",
          "platformApi": "OpenCL 3.0 CUDA",
          "coreCount": 2,
          "frequency": 954.0,
          "memory": {
            "dedicated": {
              "total": 2101739520,
              "used": null
            },
            "shared": {
              "total": null,
              "used": null
            }
          },
          "deviceId": 105832515105744
        }
      ]
    },
    "stat": 19
  },
  {
    "type": "Users",
    "result": [],
    "stat": 0
  },
  {
    "type": "Bluetooth",
    "result": [
      {
        "address": "",
        "battery": 0,
        "connected": false,
        "name": "",
        "type": ""
      }
    ],
    "stat": 1
  },
  {
    "type": "Sound",
    "result": [
      {
        "active": true,
        "main": true,
        "volume": 99,
        "name": "Built-in Audio Analog Stereo",
        "identifier": "alsa_output.pci-0000_00_1b.0.analog-stereo"
      },
      {
        "active": true,
        "main": false,
        "volume": 100,
        "name": "Built-in Audio Digital Stereo (HDMI)",
        "identifier": "alsa_output.pci-0000_00_03.0.hdmi-stereo"
      }
    ],
    "stat": 6
  },
  {
    "type": "Camera",
    "result": [
      {
        "name": "USB Camera: USB Camera",
        "vendor": "",
        "colorSpace": "sRGB",
        "id": "usb-0000:00:14.0-5",
        "width": 640,
        "height": 480
      }
    ],
    "stat": 0
  },
  {
    "type": "Gamepad",
    "result": [],
    "stat": 0
  },
  {
    "type": "Weather",
    "result": "",
    "stat": 0
  },
  {
    "type": "NetIO",
    "result": [
      {
        "name": "enp2s0",
        "defaultRoute": true,
        "txBytes": 1640,
        "rxBytes": 12396,
        "txPackets": 21,
        "rxPackets": 38,
        "rxErrors": 0,
        "txErrors": 0,
        "rxDrops": 0,
        "txDrops": 0
      }
    ],
    "stat": 590
  },
  {
    "type": "DiskIO",
    "result": [
      {
        "name": "ATA ST1000LM024 HN-M",
        "devPath": "/dev/sdb",
        "bytesRead": 0,
        "bytesWritten": 0,
        "readCount": 0,
        "writeCount": 0
      },
      {
        "name": "ATA Vi550 S3 SSD",
        "devPath": "/dev/sda",
        "bytesRead": 0,
        "bytesWritten": 270336,
        "readCount": 0,
        "writeCount": 12
      }
    ],
    "stat": 0
  },
  {
    "type": "PhysicalDisk",
    "result": [
      {
        "name": "ATA ST1000LM024 HN-M",
        "devPath": "/dev/sdb",
        "interconnect": "ATA",
        "kind": "HDD",
        "size": 1000204886016,
        "serial": "",
        "removable": false,
        "readOnly": false,
        "revision": "0001",
        "temperature": null
      },
      {
        "name": "ATA Vi550 S3 SSD",
        "devPath": "/dev/sda",
        "interconnect": "ATA",
        "kind": "SSD",
        "size": 512110190592,
        "serial": "",
        "removable": false,
        "readOnly": false,
        "revision": "117H",
        "temperature": null
      }
    ],
    "stat": 1
  },
  {
    "type": "Version",
    "result": {
      "projectName": "fastfetch",
      "sysName": "Linux",
      "architecture": "x86_64",
      "version": "2.20.0",
      "versionTweak": "",
      "cmakeBuiltType": "RelWithDebInfo",
      "compileTime": "Jul 26 2024, 06:50:11",
      "compiler": "gcc 14.1.1",
      "debugMode": false,
      "libc": "glibc 2.40"
    },
    "stat": 0
  },
  {
    "type": "Break",
    "error": "Unsupported for JSON format",
    "stat": 0
  },
  {
    "type": "Colors",
    "error": "Unsupported for JSON format",
    "stat": 0
  }
]

Output of fastfetch --list-features:

threads
vulkan
wayland
xcb-randr
xcb
xrandr
x11
drm
gio
dconf
dbus
imagemagick7
chafa
zlib
xfconf
egl
glx
osmesa
opencl
libpulse
libnm
libddcutil
Directx Headers
System yyjson
linux/videodev2
linux/wireless

For the GPU, I've checked nvidia-smi and it can see the temperature and also the memory usage:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.256.02   Driver Version: 470.256.02   CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:04:00.0 N/A |                  N/A |
| N/A   50C    P8    N/A /  N/A |      0MiB /  2004MiB |     N/A      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

For the CPU, the command cat /sys/class/hwmon/hwmon*/temp1_input correctly shows the temperature for each core:

52000
50000
52050
54000

Edit: nvidia-smi isn't open source, but nvtop can see the same information as nvidia-smi:

nvtop

CarterLi commented 2 months ago

Try

    "modules": [
        {
            "type": "cpu",
            "format": "{1} | {8}",
            "temp": true
        },
        {
            "type": "gpu",
            "format": "{1} {2} | {4}",
            "temp": true
        }
    ]