vkcube icon indicating copy to clipboard operation
vkcube copied to clipboard

cannot find vulkan_intel.h for Ubuntu

Open edgecase14 opened this issue 4 years ago • 4 comments

Is this still needed? Also glslc is a bit of a mystery also.

edgecase14 avatar Jan 29 '21 19:01 edgecase14

We should probably drop the intel extension. Same stuff can be implemented with KHR.

I guess we should also replace glslc by glslang.

llandwerlin-intel avatar Feb 03 '21 09:02 llandwerlin-intel

See https://github.com/krh/vkcube/pull/47 for glslang.

djdeath avatar Feb 03 '21 14:02 djdeath

Having this issue too and it took me a while to realize this as the program appeared to work but failing to initialize KMS (so I went looking in all the wrong places) — turns out that if the vulkan_intel.h header is not found, init_kms is a stub that silently fails:

https://github.com/krh/vkcube/blob/8261e90c8b2584155fa7b993048a4b18eea921ce/main.c#L674-L678

What would have saved me a lot of time with a helpful error message like "KMS not available: vulkan_intel is disabled" [Edit] Suggested temporary remedy: https://github.com/krh/vkcube/pull/60

In addition, the program spits out a broken PNG: (likely from the segfault)

$ sudo ./build/vkcube
failed to initialize kms, falling back to headless
3 physical devices
vendor id 10de, device name NVIDIA GeForce RTX 4070 Ti
writing first frame to ./cube.png
Segmentation fault
$

Image: cube

System: x86_64, Ubuntu 22.04.1, Linux 5.19.0

How I built it:

sudo apt install -y \
  meson \
  libdrm-dev \
  libpng-dev \
  libvulkan-dev \
  glslang-tools \
  ninja-build
git clone https://chromium.googlesource.com/chromiumos/platform/minigbm
cd minigbm
$EDITOR Makefile # add -DGBM_I915 to CPPFLAGS
make DESTDIR=install -j32 install
sed -E -i -e "s@^prefix=.+@prefix=$PWD/install/usr@" \
  install/usr/lib/pkgconfig/gbm.pc
cd ..
git clone https://github.com/krh/vkcube.git
cd vkcube
PKG_CONFIG_PATH="$PWD/../minigbm/install/usr/lib/pkgconfig:$(pkg-config --variable pc_path pkg-config)" \
meson setup ./build
ninja -C build

based on the very brief instructions in main.c:

https://github.com/krh/vkcube/blob/8261e90c8b2584155fa7b993048a4b18eea921ce/main.c#L29-L35

rsms avatar Mar 29 '23 02:03 rsms

JFYI, I have implemented baremetal KMS support, see #61

lumag avatar Nov 16 '23 03:11 lumag