From 6778a02ed05cfe8d708774f59ae6261494a3129b Mon Sep 17 00:00:00 2001 From: Stephen Horvath Date: Fri, 28 Jun 2024 21:17:39 +1000 Subject: [PATCH 1/8] Add i915 hwmon power values --- src/extract_gpuinfo_intel.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/extract_gpuinfo_intel.c b/src/extract_gpuinfo_intel.c index a120d9c..5160163 100644 --- a/src/extract_gpuinfo_intel.c +++ b/src/extract_gpuinfo_intel.c @@ -66,6 +66,7 @@ struct gpu_info_intel { struct nvtop_device *card_device; struct nvtop_device *driver_device; + struct nvtop_device *hwmon_device; struct intel_process_info_cache *last_update_process_cache, *current_update_process_cache; // Cached processes info }; @@ -262,6 +263,7 @@ static void add_intel_cards(struct nvtop_device *dev, struct list_head *devices, thisGPU->base.vendor = &gpu_vendor_intel; thisGPU->card_device = nvtop_device_ref(dev); thisGPU->driver_device = nvtop_device_ref(parent); + thisGPU->hwmon_device = nvtop_device_get_hwmon(thisGPU->driver_device); const char *pdev_val; int retval = nvtop_device_get_property_value(thisGPU->driver_device, "PCI_SLOT_NAME", &pdev_val); assert(retval >= 0 && pdev_val != NULL && "Could not retrieve device PCI slot name"); @@ -355,6 +357,10 @@ void gpuinfo_intel_refresh_dynamic_info(struct gpu_info *_gpu_info) { nvtop_device_get_syspath(gpu_info->card_device, &syspath); nvtop_device_new_from_syspath(&card_dev_copy, syspath); + nvtop_device *hwmon_dev_copy; + nvtop_device_get_syspath(gpu_info->hwmon_device, &syspath); + nvtop_device_new_from_syspath(&hwmon_dev_copy, syspath); + // GPU clock const char *gt_cur_freq; if (nvtop_device_get_sysattr_value(card_dev_copy, "gt_cur_freq_mhz", >_cur_freq) >= 0) { @@ -395,6 +401,17 @@ void gpuinfo_intel_refresh_dynamic_info(struct gpu_info *_gpu_info) { // TODO: Attributes such as memory, fan, temperature, power info should be available once the hwmon patch lands + const char *hwmon_power; + if (nvtop_device_get_sysattr_value(hwmon_dev_copy, "power1", &hwmon_power) >= 0) { + unsigned val = strtoul(hwmon_power, NULL, 10); + SET_GPUINFO_DYNAMIC(dynamic_info, power_draw, val/1000); + } + const char *hwmon_power_max; + if (nvtop_device_get_sysattr_value(hwmon_dev_copy, "power1_max", &hwmon_power_max) >= 0) { + unsigned val = strtoul(hwmon_power_max, NULL, 10); + SET_GPUINFO_DYNAMIC(dynamic_info, power_draw_max, val/1000); + } + nvtop_device_unref(card_dev_copy); } From e863a7c6061b1e554c97ffc37a5ceaaacc81ed4e Mon Sep 17 00:00:00 2001 From: Stephen Horvath Date: Fri, 28 Jun 2024 21:19:28 +1000 Subject: [PATCH 2/8] Add Intel Xe driver support --- CMakeLists.txt | 2 +- README.markdown | 4 ++-- src/extract_gpuinfo_intel.c | 14 ++++++++++---- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b0e5679..9dadefa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,7 +91,7 @@ endif() option(NVIDIA_SUPPORT "Build support for NVIDIA GPUs through libnvml" ${NVIDIA_SUPPORT_DEFAULT}) option(AMDGPU_SUPPORT "Build support for AMD GPUs through amdgpu driver" ${AMDGPU_SUPPORT_DEFAULT}) -option(INTEL_SUPPORT "Build support for Intel GPUs through i915 driver" ${INTEL_SUPPORT_DEFAULT}) +option(INTEL_SUPPORT "Build support for Intel GPUs through i915 or xe driver" ${INTEL_SUPPORT_DEFAULT}) option(MSM_SUPPORT "Build support for Adreno GPUs through msm driver" ${MSM_SUPPORT_DEFAULT}) option(APPLE_SUPPORT "Build support for Apple GPUs through Metal" ${APPLE_SUPPORT_DEFAULT}) option(PANFROST_SUPPORT "Build support for Mali GPUs through panfrost driver" ${PANFROST_SUPPORT_DEFAULT}) diff --git a/README.markdown b/README.markdown index 4ecc6f7..5b791c0 100644 --- a/README.markdown +++ b/README.markdown @@ -9,7 +9,7 @@ accelerators. It can handle multiple GPUs and print information about them in a htop-familiar way. Currently supported vendors are AMD (Linux amdgpu driver), Apple (limited M1 & -M2 support), Huawei (Ascend), Intel (Linux i915 driver), NVIDIA (Linux +M2 support), Huawei (Ascend), Intel (Linux i915 or Xe driver), NVIDIA (Linux proprietary divers), Qualcomm Adreno (Linux MSM driver). Because a picture is worth a thousand words: @@ -88,7 +88,7 @@ use a recent-enough kernel for your GPU. ### Intel -NVTOP supports Intel GPUs using the `i915` linux driver. +NVTOP supports Intel GPUs using the `i915` or `xe` linux driver. Intel introduced the fdinfo interface in kernel 5.19 ([browse kernel source](https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/gpu/drm/i915/i915_drm_client.c?h=linux-5.19.y)). diff --git a/src/extract_gpuinfo_intel.c b/src/extract_gpuinfo_intel.c index 5160163..172c2c6 100644 --- a/src/extract_gpuinfo_intel.c +++ b/src/extract_gpuinfo_intel.c @@ -63,6 +63,7 @@ struct intel_process_info_cache { struct gpu_info_intel { struct gpu_info base; + enum { DRIVER_I915, DRIVER_XE } driver; struct nvtop_device *card_device; struct nvtop_device *driver_device; @@ -250,17 +251,18 @@ static void add_intel_cards(struct nvtop_device *dev, struct list_head *devices, struct nvtop_device *parent; if (nvtop_device_get_parent(dev, &parent) < 0) return; - // Consider enabled Intel cards using the i915 driver + // Consider enabled Intel cards using the i915 or xe driver const char *vendor, *driver, *enabled; if (nvtop_device_get_sysattr_value(parent, "vendor", &vendor) < 0 || strcmp(vendor, VENDOR_INTEL_STR)) return; - if (nvtop_device_get_driver(parent, &driver) < 0 || strcmp(driver, "i915")) + if (nvtop_device_get_driver(parent, &driver) < 0 || (strcmp(driver, "i915") && strcmp(driver, "xe"))) return; if (nvtop_device_get_sysattr_value(parent, "enable", &enabled) < 0 || strcmp(enabled, "1")) return; struct gpu_info_intel *thisGPU = &gpu_infos[intel_gpu_count++]; thisGPU->base.vendor = &gpu_vendor_intel; + thisGPU->driver = !strcmp(driver, "xe") ? DRIVER_XE : DRIVER_I915; thisGPU->card_device = nvtop_device_ref(dev); thisGPU->driver_device = nvtop_device_ref(parent); thisGPU->hwmon_device = nvtop_device_get_hwmon(thisGPU->driver_device); @@ -357,18 +359,22 @@ void gpuinfo_intel_refresh_dynamic_info(struct gpu_info *_gpu_info) { nvtop_device_get_syspath(gpu_info->card_device, &syspath); nvtop_device_new_from_syspath(&card_dev_copy, syspath); + nvtop_device *intel_dev_auto = gpu_info->driver == DRIVER_XE ? gpu_info->driver_device : gpu_info->card_device; + nvtop_device *hwmon_dev_copy; nvtop_device_get_syspath(gpu_info->hwmon_device, &syspath); nvtop_device_new_from_syspath(&hwmon_dev_copy, syspath); // GPU clock const char *gt_cur_freq; - if (nvtop_device_get_sysattr_value(card_dev_copy, "gt_cur_freq_mhz", >_cur_freq) >= 0) { + const char *gt_cur_freq_sysattr = gpu_info->driver == DRIVER_XE ? "tile0/gt0/freq0/cur_freq" : "gt_cur_freq_mhz"; + if (nvtop_device_get_sysattr_value(intel_dev_auto, gt_cur_freq_sysattr, >_cur_freq) >= 0) { unsigned val = strtoul(gt_cur_freq, NULL, 10); SET_GPUINFO_DYNAMIC(dynamic_info, gpu_clock_speed, val); } const char *gt_max_freq; - if (nvtop_device_get_sysattr_value(card_dev_copy, "gt_max_freq_mhz", >_max_freq) >= 0) { + const char *gt_max_freq_sysattr = gpu_info->driver == DRIVER_XE ? "tile0/gt0/freq0/max_freq" : "gt_max_freq_mhz"; + if (nvtop_device_get_sysattr_value(intel_dev_auto, gt_max_freq_sysattr, >_max_freq) >= 0) { unsigned val = strtoul(gt_max_freq, NULL, 10); SET_GPUINFO_DYNAMIC(dynamic_info, gpu_clock_speed_max, val); } From 241df77d03c69446f96ea7210ea3675c1a0aadff Mon Sep 17 00:00:00 2001 From: Stephen Horvath Date: Fri, 28 Jun 2024 21:48:47 +1000 Subject: [PATCH 3/8] Not sure these copy devices are needed --- src/extract_gpuinfo_intel.c | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/src/extract_gpuinfo_intel.c b/src/extract_gpuinfo_intel.c index 172c2c6..58746da 100644 --- a/src/extract_gpuinfo_intel.c +++ b/src/extract_gpuinfo_intel.c @@ -354,17 +354,8 @@ void gpuinfo_intel_refresh_dynamic_info(struct gpu_info *_gpu_info) { RESET_ALL(dynamic_info->valid); - nvtop_device *card_dev_copy; - const char *syspath; - nvtop_device_get_syspath(gpu_info->card_device, &syspath); - nvtop_device_new_from_syspath(&card_dev_copy, syspath); - nvtop_device *intel_dev_auto = gpu_info->driver == DRIVER_XE ? gpu_info->driver_device : gpu_info->card_device; - nvtop_device *hwmon_dev_copy; - nvtop_device_get_syspath(gpu_info->hwmon_device, &syspath); - nvtop_device_new_from_syspath(&hwmon_dev_copy, syspath); - // GPU clock const char *gt_cur_freq; const char *gt_cur_freq_sysattr = gpu_info->driver == DRIVER_XE ? "tile0/gt0/freq0/cur_freq" : "gt_cur_freq_mhz"; @@ -382,14 +373,14 @@ void gpuinfo_intel_refresh_dynamic_info(struct gpu_info *_gpu_info) { // Mem clock // TODO: the attribute mem_cur_freq_mhz and mem_max_freq_mhz are speculative (not present on integrated graphics) const char *mem_cur_freq; - if (nvtop_device_get_sysattr_value(card_dev_copy, "mem_cur_freq_mhz", &mem_cur_freq) >= 0) { + if (nvtop_device_get_sysattr_value(gpu_info->card_device, "mem_cur_freq_mhz", &mem_cur_freq) >= 0) { unsigned val = strtoul(mem_cur_freq, NULL, 10); - SET_GPUINFO_DYNAMIC(dynamic_info, gpu_clock_speed, val); + SET_GPUINFO_DYNAMIC(dynamic_info, mem_clock_speed, val); } const char *mem_max_freq; - if (nvtop_device_get_sysattr_value(card_dev_copy, "mem_max_freq_mhz", &mem_max_freq) >= 0) { + if (nvtop_device_get_sysattr_value(gpu_info->card_device, "mem_max_freq_mhz", &mem_max_freq) >= 0) { unsigned val = strtoul(mem_max_freq, NULL, 10); - SET_GPUINFO_DYNAMIC(dynamic_info, gpu_clock_speed, val); + SET_GPUINFO_DYNAMIC(dynamic_info, mem_clock_speed_max, val); } // TODO: find how to extract global utilization @@ -397,7 +388,7 @@ void gpuinfo_intel_refresh_dynamic_info(struct gpu_info *_gpu_info) { if (!static_info->integrated_graphics) { nvtop_pcie_link curr_link_characteristics; - int ret = nvtop_device_current_pcie_link(card_dev_copy, &curr_link_characteristics); + int ret = nvtop_device_current_pcie_link(gpu_info->driver_device, &curr_link_characteristics); if (ret >= 0) { SET_GPUINFO_DYNAMIC(dynamic_info, pcie_link_width, curr_link_characteristics.width); unsigned pcieGen = nvtop_pcie_gen_from_link_speed(curr_link_characteristics.speed); @@ -408,17 +399,15 @@ void gpuinfo_intel_refresh_dynamic_info(struct gpu_info *_gpu_info) { // TODO: Attributes such as memory, fan, temperature, power info should be available once the hwmon patch lands const char *hwmon_power; - if (nvtop_device_get_sysattr_value(hwmon_dev_copy, "power1", &hwmon_power) >= 0) { + if (nvtop_device_get_sysattr_value(gpu_info->hwmon_device, "power1", &hwmon_power) >= 0) { unsigned val = strtoul(hwmon_power, NULL, 10); SET_GPUINFO_DYNAMIC(dynamic_info, power_draw, val/1000); } const char *hwmon_power_max; - if (nvtop_device_get_sysattr_value(hwmon_dev_copy, "power1_max", &hwmon_power_max) >= 0) { + if (nvtop_device_get_sysattr_value(gpu_info->hwmon_device, "power1_max", &hwmon_power_max) >= 0) { unsigned val = strtoul(hwmon_power_max, NULL, 10); SET_GPUINFO_DYNAMIC(dynamic_info, power_draw_max, val/1000); } - - nvtop_device_unref(card_dev_copy); } static void swap_process_cache_for_next_update(struct gpu_info_intel *gpu_info) { From 9faa7e75f1fabde3d15c84de1cbe4f86a1957f9f Mon Sep 17 00:00:00 2001 From: Maxime Schmitt Date: Sun, 28 Jul 2024 14:58:24 +0200 Subject: [PATCH 4/8] Re-introduce non-cached devices --- src/extract_gpuinfo_intel.c | 61 +++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/src/extract_gpuinfo_intel.c b/src/extract_gpuinfo_intel.c index 58746da..c74a66a 100644 --- a/src/extract_gpuinfo_intel.c +++ b/src/extract_gpuinfo_intel.c @@ -354,41 +354,41 @@ void gpuinfo_intel_refresh_dynamic_info(struct gpu_info *_gpu_info) { RESET_ALL(dynamic_info->valid); - nvtop_device *intel_dev_auto = gpu_info->driver == DRIVER_XE ? gpu_info->driver_device : gpu_info->card_device; + // We are creating new devices because the device_get_sysattr_value caches its querries + const char *syspath; + nvtop_device *card_dev_noncached = NULL; + if (nvtop_device_get_syspath(gpu_info->card_device, &syspath) >= 0) + nvtop_device_new_from_syspath(&card_dev_noncached, syspath); + nvtop_device *driver_dev_noncached = NULL; + if (nvtop_device_get_syspath(gpu_info->driver_device, &syspath) >= 0) + nvtop_device_new_from_syspath(&driver_dev_noncached, syspath); + nvtop_device *hwmon_dev_noncached = NULL; + if (gpu_info->hwmon_device) { + if (nvtop_device_get_syspath(gpu_info->hwmon_device, &syspath) >= 0) + nvtop_device_new_from_syspath(&hwmon_dev_noncached, syspath); + } + nvtop_device *clock_device = gpu_info->driver == DRIVER_XE ? driver_dev_noncached : card_dev_noncached; // GPU clock const char *gt_cur_freq; const char *gt_cur_freq_sysattr = gpu_info->driver == DRIVER_XE ? "tile0/gt0/freq0/cur_freq" : "gt_cur_freq_mhz"; - if (nvtop_device_get_sysattr_value(intel_dev_auto, gt_cur_freq_sysattr, >_cur_freq) >= 0) { + if (nvtop_device_get_sysattr_value(clock_device, gt_cur_freq_sysattr, >_cur_freq) >= 0) { unsigned val = strtoul(gt_cur_freq, NULL, 10); SET_GPUINFO_DYNAMIC(dynamic_info, gpu_clock_speed, val); } const char *gt_max_freq; const char *gt_max_freq_sysattr = gpu_info->driver == DRIVER_XE ? "tile0/gt0/freq0/max_freq" : "gt_max_freq_mhz"; - if (nvtop_device_get_sysattr_value(intel_dev_auto, gt_max_freq_sysattr, >_max_freq) >= 0) { + if (nvtop_device_get_sysattr_value(clock_device, gt_max_freq_sysattr, >_max_freq) >= 0) { unsigned val = strtoul(gt_max_freq, NULL, 10); SET_GPUINFO_DYNAMIC(dynamic_info, gpu_clock_speed_max, val); } - // Mem clock - // TODO: the attribute mem_cur_freq_mhz and mem_max_freq_mhz are speculative (not present on integrated graphics) - const char *mem_cur_freq; - if (nvtop_device_get_sysattr_value(gpu_info->card_device, "mem_cur_freq_mhz", &mem_cur_freq) >= 0) { - unsigned val = strtoul(mem_cur_freq, NULL, 10); - SET_GPUINFO_DYNAMIC(dynamic_info, mem_clock_speed, val); - } - const char *mem_max_freq; - if (nvtop_device_get_sysattr_value(gpu_info->card_device, "mem_max_freq_mhz", &mem_max_freq) >= 0) { - unsigned val = strtoul(mem_max_freq, NULL, 10); - SET_GPUINFO_DYNAMIC(dynamic_info, mem_clock_speed_max, val); - } - // TODO: find how to extract global utilization // gpu util will be computed as the sum of all the processes utilization for now if (!static_info->integrated_graphics) { nvtop_pcie_link curr_link_characteristics; - int ret = nvtop_device_current_pcie_link(gpu_info->driver_device, &curr_link_characteristics); + int ret = nvtop_device_current_pcie_link(card_dev_noncached, &curr_link_characteristics); if (ret >= 0) { SET_GPUINFO_DYNAMIC(dynamic_info, pcie_link_width, curr_link_characteristics.width); unsigned pcieGen = nvtop_pcie_gen_from_link_speed(curr_link_characteristics.speed); @@ -397,17 +397,24 @@ void gpuinfo_intel_refresh_dynamic_info(struct gpu_info *_gpu_info) { } // TODO: Attributes such as memory, fan, temperature, power info should be available once the hwmon patch lands + if (hwmon_dev_noncached) { + const char *hwmon_power; + if (nvtop_device_get_sysattr_value(hwmon_dev_noncached, "power1", &hwmon_power) >= 0) { + unsigned val = strtoul(hwmon_power, NULL, 10); + SET_GPUINFO_DYNAMIC(dynamic_info, power_draw, val / 1000); + } + const char *hwmon_power_max; + if (nvtop_device_get_sysattr_value(hwmon_dev_noncached, "power1_max", &hwmon_power_max) >= 0) { + unsigned val = strtoul(hwmon_power_max, NULL, 10); + SET_GPUINFO_DYNAMIC(dynamic_info, power_draw_max, val / 1000); + } + } - const char *hwmon_power; - if (nvtop_device_get_sysattr_value(gpu_info->hwmon_device, "power1", &hwmon_power) >= 0) { - unsigned val = strtoul(hwmon_power, NULL, 10); - SET_GPUINFO_DYNAMIC(dynamic_info, power_draw, val/1000); - } - const char *hwmon_power_max; - if (nvtop_device_get_sysattr_value(gpu_info->hwmon_device, "power1_max", &hwmon_power_max) >= 0) { - unsigned val = strtoul(hwmon_power_max, NULL, 10); - SET_GPUINFO_DYNAMIC(dynamic_info, power_draw_max, val/1000); - } + // Let the temporary devices be garbage collected + nvtop_device_unref(card_dev_noncached); + nvtop_device_unref(driver_dev_noncached); + if (hwmon_dev_noncached) + nvtop_device_unref(hwmon_dev_noncached); } static void swap_process_cache_for_next_update(struct gpu_info_intel *gpu_info) { From 3232b5815142858e8b34b2c746042f7791fe6aad Mon Sep 17 00:00:00 2001 From: Stephen Horvath Date: Sun, 4 Aug 2024 19:28:30 +1000 Subject: [PATCH 5/8] Get per-process memory from fdinfo for Xe It seems only memory usage is supported by the Xe driver. ``` drm-driver: xe drm-client-id: 67 drm-pdev: 0000:03:00.0 drm-total-system: 0 drm-shared-system: 0 drm-active-system: 0 drm-resident-system: 0 drm-purgeable-system: 0 drm-total-gtt: 20608 KiB drm-shared-gtt: 0 drm-active-gtt: 0 drm-resident-gtt: 20608 KiB drm-total-vram0: 407556 KiB drm-shared-vram0: 56 MiB drm-active-vram0: 0 drm-resident-vram0: 407556 KiB drm-total-stolen: 0 drm-shared-stolen: 0 drm-active-stolen: 0 drm-resident-stolen: 0 ``` --- src/extract_gpuinfo_intel.c | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/src/extract_gpuinfo_intel.c b/src/extract_gpuinfo_intel.c index c74a66a..5949777 100644 --- a/src/extract_gpuinfo_intel.c +++ b/src/extract_gpuinfo_intel.c @@ -115,10 +115,12 @@ void gpuinfo_intel_shutdown(void) { const char *gpuinfo_intel_last_error_string(void) { return "Err"; } -static const char drm_intel_render[] = "drm-engine-render"; -static const char drm_intel_copy[] = "drm-engine-copy"; -static const char drm_intel_video[] = "drm-engine-video"; -static const char drm_intel_video_enhance[] = "drm-engine-video-enhance"; +static const char i915_drm_intel_render[] = "drm-engine-render"; +static const char i915_drm_intel_copy[] = "drm-engine-copy"; +static const char i915_drm_intel_video[] = "drm-engine-video"; +static const char i915_drm_intel_video_enhance[] = "drm-engine-video-enhance"; + +static const char xe_drm_intel_vram[] = "drm-total-vram0"; static bool parse_drm_fdinfo_intel(struct gpu_info *info, FILE *fdinfo_file, struct gpu_process *process_info) { struct gpu_info_intel *gpu_info = container_of(info, struct gpu_info_intel, base); @@ -152,12 +154,22 @@ static bool parse_drm_fdinfo_intel(struct gpu_info *info, FILE *fdinfo_file, str continue; client_id_set = true; } else { - bool is_render = !strcmp(key, drm_intel_render); - bool is_copy = !strcmp(key, drm_intel_copy); - bool is_video = !strcmp(key, drm_intel_video); - bool is_video_enhance = !strcmp(key, drm_intel_video_enhance); + bool is_render = !strcmp(key, i915_drm_intel_render); + bool is_copy = !strcmp(key, i915_drm_intel_copy); + bool is_video = !strcmp(key, i915_drm_intel_video); + bool is_video_enhance = !strcmp(key, i915_drm_intel_video_enhance); + + if (strcmp(key, xe_drm_intel_vram)) { + // TODO: do we count "gtt mem" too? + unsigned long mem_int; + char *endptr; - if (is_render || is_copy || is_video || is_video_enhance) { + mem_int = strtoul(val, &endptr, 10); + if (endptr == val || (strcmp(endptr, " kB") && strcmp(endptr, " KiB"))) + continue; + + SET_GPUINFO_PROCESS(process_info, gpu_memory_usage, mem_int * 1024); + } else if (is_render || is_copy || is_video || is_video_enhance) { char *endptr; uint64_t time_spent = strtoull(val, &endptr, 10); if (endptr == val || strcmp(endptr, " ns")) From a5db51a48b85128e7a8eff1374b44fd6403f82e8 Mon Sep 17 00:00:00 2001 From: Stephen Horvath Date: Sun, 4 Aug 2024 19:46:48 +1000 Subject: [PATCH 6/8] Revert back to the Xe driver device for the PCIe link --- src/extract_gpuinfo_intel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extract_gpuinfo_intel.c b/src/extract_gpuinfo_intel.c index 5949777..5591a71 100644 --- a/src/extract_gpuinfo_intel.c +++ b/src/extract_gpuinfo_intel.c @@ -400,7 +400,7 @@ void gpuinfo_intel_refresh_dynamic_info(struct gpu_info *_gpu_info) { if (!static_info->integrated_graphics) { nvtop_pcie_link curr_link_characteristics; - int ret = nvtop_device_current_pcie_link(card_dev_noncached, &curr_link_characteristics); + int ret = nvtop_device_current_pcie_link(driver_dev_noncached, &curr_link_characteristics); if (ret >= 0) { SET_GPUINFO_DYNAMIC(dynamic_info, pcie_link_width, curr_link_characteristics.width); unsigned pcieGen = nvtop_pcie_gen_from_link_speed(curr_link_characteristics.speed); From a662e8450a189695ccb66b5591903ed02cf79bc2 Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Wed, 7 Aug 2024 18:03:10 -0500 Subject: [PATCH 7/8] docs: Add conda-forge feedstock to install instructions * Note the existence of the conda-forge feedstock in the README and add install instructions for the conda family of package managers as well as for pixi. - c.f. https://github.com/conda-forge/nvtop-feedstock --- README.markdown | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.markdown b/README.markdown index 4ecc6f7..be2cc9d 100644 --- a/README.markdown +++ b/README.markdown @@ -39,6 +39,7 @@ Table of Contents - [Arch Linux](#arch-linux) - [AppImage](#appimage) - [Snap](#snap) + - [Conda-forge](#conda-forge) - [Docker](#docker) - [NVTOP Build](#nvtop-build) - [Troubleshoot](#troubleshoot) @@ -300,6 +301,22 @@ If you are curious how that works, please visit the [AppImage website](https://a Notice: The connect commands allow +### Conda-forge + +A [conda-forge feedstock for `nvtop`](https://github.com/conda-forge/nvtop-feedstock) is available. + +#### conda / mamba / miniforge + +```bash +conda install --channel conda-forge nvtop +``` + +#### pixi + +```bash +pixi global install nvtop +``` + ### Docker - NVIDIA drivers (same as above) From 7da23bc6518dbd4e2c0fbde8e788bb553fb0f07d Mon Sep 17 00:00:00 2001 From: Ozora Ogino <63685461+ozora-ogino@users.noreply.github.com> Date: Fri, 23 Aug 2024 11:36:03 +0900 Subject: [PATCH 8/8] Add missed '&&" --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 857ddbb..3a72986 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ RUN apt-get update && \ # Get a recent-enough CMake RUN python3 -m venv /.venv && \ . /.venv/bin/activate && \ - pip install --upgrade pip \ + pip install --upgrade pip && \ pip install cmake COPY . /nvtop