Closed kojq closed 4 months ago
introduced by https://github.com/fastfetch-cli/fastfetch/commit/e9b535d2776ffed04b069283e6846744ba6a8b8d with detectPci(options, gpus, &buffer, &drmDir, entry->d_name);
I see. The issue is with pPciPath++
.
can be significantly slower
I can't reproduce it on my laptop with RTX 3070 Ti. e9b535d2776ffed04b069283e6846744ba6a8b8d should not make much difference of performance. The major difference introduced in 2.13.0 is https://github.com/fastfetch-cli/fastfetch/blob/dev/src/detection/gpu/gpu_linux.c#L40-L52 which tries to call the DRM driver of nvidia GPU. It is only used to grab a driver name and version but should not affect performance too.
You may try --gpu-detection-method pci
, which effectively avoids calling the DRM driver. Please paste the result of hyperfine 'fastfetch -s gpu -l none' 'fastfetch -s gpu -l none --gpu-detection-method pci'
I don't think hyperfine
output would be useful as you have to wait a couple of seconds and not use fastfetch
in immediate succession for this to occur. The flag to avoid calling the DRM driver does resolve the issue though.
I am using nouveau rather than the proprietary drivers.
How much time does it cost? --stat
should print time usage for individual modules.
What does fastfetch -s gpu --format json --stat
print?
1-2 seconds. I'm currently on mobile with no computer, so can't give output now. Will do later.
Really? Is nouveau that slow?
Anyway, if you can confirm where the problem is, I can cut a hotfix release today.
I can try to get back to you with the output within an hour from now. Otherwise, will be tomorrow.
--stat
`+sso+:-` `.-/+oso: Terminal: foot 1.17.2 2ms
`++:. `-/+/ Terminal Font: monospace (8pt) 0ms
.` `/ CPU: AMD Ryzen 9 5900HS (16) @ 4.68 GHz 1ms
GPU 1: NVIDIA GeForce RTX 3060 Mobile / Max-Q [Discrete]
GPU 2: AMD Radeon Vega Series / Radeon Vega Mobile Series @ 0.40 GHz [Integrated] 1546ms
Memory: 1.85 GiB / 15.03 GiB (12%) 0ms
-s gpu --format json --stat
[
{
"type": "GPU",
"result": [
{
"coreCount": null,
"memory": {
"dedicated": {
"total": null,
"used": null
},
"shared": {
"total": null,
"used": null
}
},
"driver": "nouveau 1.4.0",
"name": "GeForce RTX 3060 Mobile / Max-Q",
"temperature": null,
"type": "Discrete",
"vendor": "NVIDIA",
"platformApi": "DRM (card1)",
"frequency": null
},
{
"coreCount": null,
"memory": {
"dedicated": {
"total": null,
"used": null
},
"shared": {
"total": null,
"used": null
}
},
"driver": "amdgpu 3.57.0",
"name": "Radeon Vega Series / Radeon Vega Mobile Series",
"temperature": null,
"type": "Integrated",
"vendor": "AMD",
"platformApi": "DRM (card2)",
"frequency": 0.4
}
],
"stat": 1544
}
]
Does this patch fix your issue?
diff --git a/src/detection/gpu/gpu_linux.c b/src/detection/gpu/gpu_linux.c
index 9387ce4e..5f6e93dd 100644
--- a/src/detection/gpu/gpu_linux.c
+++ b/src/detection/gpu/gpu_linux.c
@@ -70,7 +70,7 @@ static const char* drmDetectDriver(FFGPUResult* gpu, FFstrbuf* pciDir, FFstrbuf*
static bool pciDetectDriver(FFGPUResult* gpu, FFstrbuf* pciDir, FFstrbuf* buffer, FF_MAYBE_UNUSED const char* drmKey)
{
#if FF_HAVE_DRM_H
- if (drmKey)
+ if (drmKey && !ffStrEquals(drmKey, "card1"))
{
drmDetectDriver(gpu, pciDir, buffer, drmKey);
if (gpu->driver.length > 0) return true;
yep. the patch resolves it.
This suggests that nouveau driver is bad
You could do a workaround or simply a wontfix.
FYI, prior to turing cards using nouveau will probably be the ones affected, as our cards can use NVK with mesa 24.1+ (which I suspect would have better performance). Anyway, gtg. Ciao.
You could do a workaround
The only workaround is that we dont try to call DRM drivers for nouveau.
However we dont know if it is nouveau if we dont ask the driver.
which I suspect would have better performance
We only ask for driver name and version but nothing else. I didnt know it is that hard to tell who and how old the nouveau driver is.
[ALPM] upgraded fastfetch (2.12.0-1 -> 2.13.0-1) [ALPM] upgraded fastfetch (2.13.0-1 -> 2.13.1-1)
Introduced either 2.13.0 or 2.13.1,
fastfetch
can be significantly slower outputting from the GPU line and onward, so I suspect some recent commit regardingGPU (Linux)
(on NVIDIA). It occurs on git as well (https://github.com/fastfetch-cli/fastfetch/commit/59c853fb0172d12a0fe286625fa2bdbbdf7d1e14).