diff --git a/CHANGELOG.md b/CHANGELOG.md index da8cc207c..17c804770 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ Features: * Support display name, display type and decimal refresh rate detection (Display, macOS / Windows) * Support `--display-compact-type` to display multiple resolutions in one line (Display) * Support flatpak-user (Packages, Linux, #436) +* Support `--gpu-force-vulkan` to force using vulkan to detect GPUs, which support video memory usage detection with `--allow-slow-operations` (GPU) Bugfixes: * Fix date time format diff --git a/completions/bash b/completions/bash index a395009f1..25b02a0f3 100644 --- a/completions/bash +++ b/completions/bash @@ -201,6 +201,7 @@ __fastfetch_completion() "--disk-show-subvolumes" "--gpu-hide-integrated" "--gpu-hide-discrete" + "--gpu-force-vulkan" "--disk-show-unknown" "--bluetooth-show-disconnected" ) diff --git a/src/common/init.c b/src/common/init.c index 014211af4..b2fc6a447 100644 --- a/src/common/init.c +++ b/src/common/init.c @@ -144,6 +144,7 @@ static void defaultConfig(FFinstance* instance) instance->config.cpuTemp = false; instance->config.gpuTemp = false; + instance->config.gpuForceVulkan = false; instance->config.batteryTemp = false; instance->config.gpuHideIntegrated = false; diff --git a/src/data/config_user.txt b/src/data/config_user.txt index 9437ca845..2b80f9885 100644 --- a/src/data/config_user.txt +++ b/src/data/config_user.txt @@ -219,6 +219,13 @@ #--gpu-hide-integrated #--gpu-hide-discrete +# GPU detection options +# Forces using vulkan to detect GPUs +# which support video memory usage detection with `--allow-slow-operations` +# Must be either true or false +# Default is false. +#--gpu-force-vulkan + # Shell option # Sets if shell version should be detected and printed # Must be either true or false diff --git a/src/data/help.txt b/src/data/help.txt index b30b19d92..379865814 100644 --- a/src/data/help.txt +++ b/src/data/help.txt @@ -120,6 +120,7 @@ Module specific options: --battery-dir : The directory where the battery folders are. Standard: /sys/class/power_supply/ --cpu-temp : Detect and display CPU temperature if supported. Default is false --gpu-temp : Detect and display GPU temperature if supported. Default is false + --gpu-force-vulkan : Force using vulkan to detect GPUs, which support video memory usage detection with `--allow-slow-operations`. Default is false --gpu-hide-integrated : Hide integrated GPU if supported. Default is false --gpu-hide-discrete : Hide discrete GPU if supported. Default is false --battery-temp : Detect and display Battery temperature if supported. Default is false diff --git a/src/detection/gpu/gpu.c b/src/detection/gpu/gpu.c index 61951e32d..b50560dfe 100644 --- a/src/detection/gpu/gpu.c +++ b/src/detection/gpu/gpu.c @@ -36,7 +36,7 @@ const FFlist* ffDetectGPU(const FFinstance* instance) { FF_DETECTION_INTERNAL_GUARD(FFlist, ffListInit(&result, sizeof(FFGPUResult)); - if(ffDetectGPUImpl(&result, instance) != NULL) + if(instance->config.gpuForceVulkan || ffDetectGPUImpl(&result, instance) != NULL) { const FFVulkanResult* vulkan = ffDetectVulkan(instance); result = vulkan->gpus; diff --git a/src/fastfetch.c b/src/fastfetch.c index 31e0f61e9..355051aa6 100644 --- a/src/fastfetch.c +++ b/src/fastfetch.c @@ -1247,6 +1247,8 @@ static void parseOption(FFinstance* instance, FFdata* data, const char* key, con instance->config.cpuTemp = optionParseBoolean(value); else if(strcasecmp(key, "--gpu-temp") == 0) instance->config.gpuTemp = optionParseBoolean(value); + else if(strcasecmp(key, "--gpu-force-vulkan") == 0) + instance->config.gpuForceVulkan = optionParseBoolean(value); else if(strcasecmp(key, "--battery-temp") == 0) instance->config.batteryTemp = optionParseBoolean(value); else if(strcasecmp(key, "--gpu-hide-integrated") == 0) diff --git a/src/fastfetch.h b/src/fastfetch.h index 831e2d163..0d25d31a8 100644 --- a/src/fastfetch.h +++ b/src/fastfetch.h @@ -192,6 +192,7 @@ typedef struct FFconfig bool cpuTemp; bool gpuTemp; + bool gpuForceVulkan; bool batteryTemp; bool gpuHideIntegrated;