Read the FAQ first
Description
Codec (Vulkan): build failure on Vulkan headers 1.3.275 due to unguarded AV1 codec operation macros
Environment
- OS: Ubuntu 24.04 LTS (WSL2)
- Fastfetch branch:
dev
- Fastfetch commit:
8aeb7c2f
- Vulkan development package:
libvulkan-dev 1.3.275.0-1build1
Description
Fastfetch fails to compile on Ubuntu 24.04 with Vulkan headers 1.3.275.
The Vulkan headers provide:
VK_KHR_video_decode_queue
VK_KHR_video_encode_queue
However, they do not provide:
VK_VIDEO_CODEC_OPERATION_DECODE_AV1_BIT_KHR
VK_VIDEO_CODEC_OPERATION_ENCODE_AV1_BIT_KHR
codec_vulkan.c enters the Vulkan codec implementation block because the queue extension macros are present, but later references the AV1 codec operation macros without guarding them.
As a result, compilation fails.
Steps to Reproduce
Clone Fastfetch and switch to the current dev branch:
git clone https://github.com/fastfetch-cli/fastfetch.git
cd fastfetch
git checkout dev
Create a clean build directory:
rm -rf build
mkdir build
cd build
Configure and build:
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
make -j$(nproc)
Actual Result
Compilation fails with:
/home/user/fastfetch/src/detection/codec/codec_vulkan.c:23:22: error:
‘VK_VIDEO_CODEC_OPERATION_DECODE_AV1_BIT_KHR’ undeclared
/home/user/fastfetch/src/detection/codec/codec_vulkan.c:42:22: error:
‘VK_VIDEO_CODEC_OPERATION_ENCODE_AV1_BIT_KHR’ undeclared
Verification
The AV1 codec operation macros are not present in the installed Vulkan headers:
grep -R "VK_VIDEO_CODEC_OPERATION_DECODE_AV1_BIT_KHR" /usr/include/vulkan
grep -R "VK_VIDEO_CODEC_OPERATION_ENCODE_AV1_BIT_KHR" /usr/include/vulkan
Both commands return no results.
The queue extension macros are present:
grep -R "VK_KHR_video_decode_queue" /usr/include/vulkan
grep -R "VK_KHR_video_encode_queue" /usr/include/vulkan
These return multiple matches, including:
#define VK_KHR_video_decode_queue 1
Relevant Source
Current code:
#if VK_KHR_video_decode_queue && VK_KHR_video_encode_queue
Later references:
VK_VIDEO_CODEC_OPERATION_DECODE_AV1_BIT_KHR
VK_VIDEO_CODEC_OPERATION_ENCODE_AV1_BIT_KHR
without checking whether those AV1-specific macros exist.
Expected Result
Either:
- Guard AV1-specific code with preprocessor checks such as:
#ifdef VK_VIDEO_CODEC_OPERATION_DECODE_AV1_BIT_KHR
...
#endif
and
#ifdef VK_VIDEO_CODEC_OPERATION_ENCODE_AV1_BIT_KHR
...
#endif
or
- Expand the Vulkan header version/feature checks so that the implementation is not compiled when those symbols are unavailable.
Additional Notes
This does not appear to be a local configuration issue.
The installed Vulkan headers are internally consistent and expose the video queue extensions, but not the AV1 codec operation macros referenced by Fastfetch.
The issue seems to be a compatibility problem between the current Vulkan codec implementation and Vulkan headers 1.3.275.
Version used
Built from source (dev branch) Commit: 8aeb7c2 Attempted build from current dev branch. Compilation fails before a binary can be produced due to: VK_VIDEO_CODEC_OPERATION_DECODE_AV1_BIT_KHR undeclared VK_VIDEO_CODEC_OPERATION_ENCODE_AV1_BIT_KHR undeclared
Bug prevalence
Always
Regression
Not sure
Installation
Built from source
Package manager
No response
Screenshots
No response
Configuration
System information
Features built-in
lilnynho in fastfetch on dev
✦5 ❯fastfetch --list-features
threads
vulkan
wayland
xcb-randr
xrandr
drm
drm_amdgpu
dbus
zlib
sqlite3
egl
glx
opencl
libddcutil
libelf
libzfs
linux/videodev2
Read the FAQ first
Description
Codec (Vulkan): build failure on Vulkan headers 1.3.275 due to unguarded AV1 codec operation macros
Environment
dev8aeb7c2flibvulkan-dev 1.3.275.0-1build1Description
Fastfetch fails to compile on Ubuntu 24.04 with Vulkan headers 1.3.275.
The Vulkan headers provide:
VK_KHR_video_decode_queueVK_KHR_video_encode_queueHowever, they do not provide:
VK_VIDEO_CODEC_OPERATION_DECODE_AV1_BIT_KHRVK_VIDEO_CODEC_OPERATION_ENCODE_AV1_BIT_KHRcodec_vulkan.centers the Vulkan codec implementation block because the queue extension macros are present, but later references the AV1 codec operation macros without guarding them.As a result, compilation fails.
Steps to Reproduce
Clone Fastfetch and switch to the current dev branch:
git clone https://github.com/fastfetch-cli/fastfetch.git cd fastfetch git checkout devCreate a clean build directory:
rm -rf build mkdir build cd buildConfigure and build:
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo make -j$(nproc)Actual Result
Compilation fails with:
Verification
The AV1 codec operation macros are not present in the installed Vulkan headers:
Both commands return no results.
The queue extension macros are present:
These return multiple matches, including:
Relevant Source
Current code:
Later references:
without checking whether those AV1-specific macros exist.
Expected Result
Either:
and
or
Additional Notes
This does not appear to be a local configuration issue.
The installed Vulkan headers are internally consistent and expose the video queue extensions, but not the AV1 codec operation macros referenced by Fastfetch.
The issue seems to be a compatibility problem between the current Vulkan codec implementation and Vulkan headers 1.3.275.
Version used
Built from source (dev branch) Commit: 8aeb7c2 Attempted build from current dev branch. Compilation fails before a binary can be produced due to: VK_VIDEO_CODEC_OPERATION_DECODE_AV1_BIT_KHR undeclared VK_VIDEO_CODEC_OPERATION_ENCODE_AV1_BIT_KHR undeclared
Bug prevalence
Always
Regression
Not sure
Installation
Built from source
Package manager
No response
Screenshots
No response
Configuration
System information
Features built-in