Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot find vulkan_intel.h for Ubuntu #46

Open
edgecase14 opened this issue Jan 29, 2021 · 4 comments
Open

cannot find vulkan_intel.h for Ubuntu #46

edgecase14 opened this issue Jan 29, 2021 · 4 comments

Comments

@edgecase14
Copy link

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

@llandwerlin-intel
Copy link
Contributor

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

I guess we should also replace glslc by glslang.

@djdeath
Copy link
Collaborator

djdeath commented Feb 3, 2021

See #47 for glslang.

@rsms
Copy link

rsms commented Mar 29, 2023

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:

vkcube/main.c

Lines 674 to 678 in 8261e90

static int
init_kms(struct vkcube *vc)
{
return -1;
}

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: #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:

vkcube/main.c

Lines 29 to 35 in 8261e90

* Compile and run this with minigbm:
*
* https://chromium.googlesource.com/chromiumos/platform/minigbm
*
* Edit the minigbm Makefile to add -DGBM_I915 to CPPFLAGS, then compile and
* install with make DESTDIR=<some path>. Then pass --with-minigbm=<some path>
* to configure when configuring vkcube

rsms added a commit to rsms/vkcube that referenced this issue Mar 29, 2023
init_kms fails without explanation if vkcube is build without the presence of vulkan_intel.h, leading to confusing error message "failed to initialize kms". Temporary remedy for krh#46
@lumag
Copy link

lumag commented Nov 16, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants