Until yesterday (feb 2nd) I was able to build yuzu-mainline from source. I saw that vulkan was merged today, and now I'm unable to build.
I tried Qt 5.12 and Qt 5.14 and both gives the same errors:
yuzu-mainline/src/yuzu/configuration/configure_graphics.cpp:8:10: fatal error: QVulkanInstance: No such file or directory
#include <QVulkanInstance>
^~~~~~~~~~~~~~~~~
compilation terminated.
src/yuzu/CMakeFiles/yuzu.dir/build.make:374: recipe for target 'src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_graphics.cpp.o' failed
make[2]: *** [src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_graphics.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
yuzu-mainline/src/yuzu/bootmanager.cpp:18:10: fatal error: QVulkanWindow: No such file or directory
#include <QVulkanWindow>
^~~~~~~~~~~~~~~
compilation terminated.
src/yuzu/CMakeFiles/yuzu.dir/build.make:182: recipe for target 'src/yuzu/CMakeFiles/yuzu.dir/bootmanager.cpp.o' failed
make[2]: *** [src/yuzu/CMakeFiles/yuzu.dir/bootmanager.cpp.o] Error 1
I'm running Linux Mint 19.3 based on Ubuntu 18.04. To access newer versions of Qt I installed in a different path, I use the following commands to build:
LD_LIBRARY_PATH="/opt/qt514/libH" cmake .. -DCMAKE_BUILD_TYPE=Release
LD_LIBRARY_PATH="/opt/qt514/lib:$LD_LIBRARY_PATH" make -j16
Do I need to install anything else not in the documentation for it to build?
My computer specs:
AMD Ryzen 1800X,
32GB of RAM,
Nvidia GTX 1070, Driver: 440.48.02
Thanks!
@Gustav0ar Currently Qt on Ubuntu 18.04 LTS doesn't support Vulkan, so currently we do not have support for Vulkan in the shipped Linux binaries.
@Morph1984 I know, this is why I installed newer versions and pointed to it. Read what I wrote and the commands I run to build. Previously there was already some vulkan stuff merged that was causing build issues. It was resolved pointing to newer versions that I installed, but since today it doesn't work anymore.
The Vulkan frontend PR is the one that needs a Qt version with vulkan support.
The previous VK PRs didnt have any build issues with the CI. It's only when the frontend was implemented where we have problems on the older 18.04 LTS release
If it can't find QVulkanWindow, then that version of Qt that was shipped does not support Vulkan.
Which version of Qt does it need? I tried with 5.14, there is only 5.15 that was released a few days ago.
The Vulkan frontend PR is the one that needs a Qt version with vulkan support.
The previous VK PRs didnt have any build issues with the CI. It's only when the frontend was implemented where we have problems on the older 18.04 LTS release
At least in mainline it most certainly contained vulkan stuff. Previously I was also getting build errors which were resolved installing newer Qt versions. Look at the error I was getting previously:
src/video_core/CMakeFiles/video_core.dir/build.make:2414: recipe for target 'src/video_core/CMakeFiles/video_core.dir/renderer_vulkan/vk_shader_decompiler.cpp.o' failed
make[2]: [src/video_core/CMakeFiles/video_core.dir/renderer_vulkan/vk_shader_decompiler.cpp.o] Error 1
CMakeFiles/Makefile2:2428: recipe for target 'src/video_core/CMakeFiles/video_core.dir/all' failed
make[1]: [src/video_core/CMakeFiles/video_core.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Qt builds based on Ubuntu 18.04 (like Mint) don't ship with Vulkan support, regardless of version.
I'm not using the default Ubuntu Qt builds. I built it from source and pointed to it. Like I said, it worked before to resolve issues with vulkan when building yuzu-mainline. Since today, it doesn't work anymore.
Are you sure you enabled the Vulkan flag on those Qt builds? It wasn't previously used until today.
I'm pretty sure look at this comment:
The Vulkan frontend PR is the one that needs a Qt version with vulkan support.
The previous VK PRs didnt have any build issues with the CI. It's only when the frontend was implemented where we have problems on the older 18.04 LTS releaseAt least in mainline it most certainly contained vulkan stuff. Previously I was also getting build errors which were resolved installing newer Qt versions. Look at the error I was getting previously:
src/video_core/CMakeFiles/video_core.dir/build.make:2414: recipe for target 'src/video_core/CMakeFiles/video_core.dir/renderer_vulkan/vk_shader_decompiler.cpp.o' failed make[2]: [src/video_core/CMakeFiles/video_core.dir/renderer_vulkan/vk_shader_decompiler.cpp.o] Error 1 CMakeFiles/Makefile2:2428: recipe for target 'src/video_core/CMakeFiles/video_core.dir/all' failed make[1]: [src/video_core/CMakeFiles/video_core.dir/all] Error 2 Makefile:140: recipe for target 'all' failed make: *** [all] Error 2
This error I was getting like 2 weeks ago, and installing newer versions of Qt resolved the issue.
Maybe half baked Vulkan support?
It works on any distro that doesn't use Ubuntu 18.04 as its base.
Maybe there are other Qt packages that need that flag.
I can't wait for 20.04 to release so all of this is in the past.
I can't wait for 20.04 to release so all of this is in the past.
You can just use Manjaro
To get around this you have to build QT from source and point cmake to your local version. This is not a trivial task but it does work.
If you want to know if your distro version of QT supports vulkan you can check the following file:
/usr/include/qt5/QtGui/qtgui-config.h
If you open it and search for QT_FEATURE_vulkan it will tell you if it is compiled or not.
Note: (-1) means that it is not supported.
Facing the same issue here, also with Linux Mint 19.3. I tried installing qt5.14 from the official repo here but for some reason vulkan support is not compiled in according to @7oxicshadow's check process. That's not likely to change with any future distro updates given that the repo maintainer apparently doesn't seem to think vulkan support is important.
Compiling from source is certainly an option, but there must be a more user-friendly way than that, especially considering how wide a userbase Ubuntu-derivatives are, at least among linux users.
I am not sure about Ubuntu derivatives but for Redhat I raised a bug a few weeks ago about this and it has been acknowledged but how long it takes before it actually gets pushed through is anyone's guess.
Thanks @7oxicshadow. Is it a bug or simply the fact that the repo maintainer didn't compile vulkan support in? I assumed the latter. Not sure if changes to the RH repo would somehow trickle down to the Ubuntu repo but that would be nice.
Meanwhile, in the process of compiling qt now. Is there anything specific needed to compile in vulkan support? It didn't specify here
I don't think its a bug. I am wondering if its "too new" to be considered stable maybe so most package maintainers leave it out.
It was a couple of weeks ago when I built it so I can't remember the steps. I had major problems at the time getting it to find the vulkan build dependencies and it kept compiling without it.
When you run configure it should give you a report at the end that tells you if what modules will be compiled in if I remember rightly.
Once you have successfully built QT you don't have to install it if you don't want to. When building Yuzu you can use the following command to point to the new QT cmake files:
cmake -DCMAKE_BUILD_TYPE=release -DCMAKE_PREFIX_PATH=<path to new qt build>/lib/cmake ..
Interesting. Let's hope the Ubuntu repo gets the same treatment as RH might get soon.
You are right about the report, btw. Check this out, from the last part of the configure report:
OpenGL:
Desktop OpenGL ....................... yes
OpenGL ES 2.0 ........................ no
OpenGL ES 3.0 ........................ no
OpenGL ES 3.1 ........................ no
OpenGL ES 3.2 ........................ no
Vulkan ................................. yes
I believe that's the part you're referring to? In that case it seems this test system is in good shape at least - fingers crossed.
Thanks @7oxicshadow. Is it a bug or simply the fact that the repo maintainer didn't compile vulkan support in? I assumed the latter. Not sure if changes to the RH repo would somehow trickle down to the Ubuntu repo but that would be nice.
Meanwhile, in the process of compiling qt now. Is there anything specific needed to compile in vulkan support? It didn't specify here
Looks like I'm having the same issue, I was using the PPA you mentioned but I also found out that it doesn't have the vulkan stuff. I tried compiling but I didn't find any documentation on how to enable the feature. The best thing to help that I found was: here but manually specifying where vulkan include and libs didn't work for me. I still get when doing configure: _ERROR: Feature 'vulkan' was enabled, but the pre-condition 'features.vkgen && libs.vulkan' failed._
I mainly gave up on building, I'll wait when I update the OS, and play with an old version that I got in meantime. Unless someone posts a better tutorial for building
Here is a basic guide to build QT from source. It is not comprehensive and assumes that you already know how to build projects from source and more importantly you know how to solve dependency issues.
Please do not spam this bug with qt build support questions as I do not want to annoy the yuzu developers with alerts that are not related to the actual bug
open terminal in the home directory
mkdir my_local_qt
cd my_local_qt
mkdir build
git clone https://code.qt.io/qt/qt5.git
cd qt5
./init-repository
cd ../build
../qt5/configure -developer-build -opensource -nomake examples -nomake tests
(type 'y' to accept the license when prompted)
When the configure finishes, scroll up to confirm that vulkan reports "yes".
If it reports as "no" then you are missing the vulkan dev (ubuntu) / devel (fedora) libraries and
you will need to install them and restart this guide at the ../qt5/configure
section again. I am guessing that it will be libvulkan-dev on ubuntu and vulkan-devel on fedora.
make -j4
(Depedning on your processor. The build process could take upto 15 mins or more)
Assuming the build completes without errors you are interested in pointing the yuzu
cmake command to the build/qtbase/lib/cmake folder. This is done using the following
command when building yuzu:
cmake -DCMAKE_BUILD_TYPE=release -DCMAKE_PREFIX_PATH=<path to new qt build folder>/qtbase/lib/cmake ..
Here is a basic guide to build QT from source. It is not comprehensive and assumes that you already know how to build projects from source and more importantly you know how to solve dependency issues.
Please do not spam this bug with qt build support questions as I do not want to annoy the yuzu developers with alerts that are not related to the actual bug
open terminal in the home directory mkdir my_local_qt cd my_local_qt mkdir build git clone https://code.qt.io/qt/qt5.git cd qt5 ./init-repository cd ../build ../qt5/configure -developer-build -opensource -nomake examples -nomake tests (type 'y' to accept the license when prompted)When the configure finishes, scroll up to confirm that vulkan reports "yes".
If it reports as "no" then you are missing the vulkan dev (ubuntu) / devel (fedora) libraries and
you will need to install them and restart this guide at the ../qt5/configure
section again. I am guessing that it will be libvulkan-dev on ubuntu and vulkan-devel on fedora.
make -j4(Depedning on your processor. The build process could take upto 15 mins or more)
Assuming the build completes without errors you are interested in pointing the yuzu
cmake command to the build/qtbase/lib/cmake folder. This is done using the following
command when building yuzu:
cmake -DCMAKE_BUILD_TYPE=release -DCMAKE_PREFIX_PATH=<path to new qt build folder>/qtbase/lib/cmake ..
Thanks, but I already have done that. My problem is that Qt configure isn't recognizing vulkan automatically nor when I specify with: configure -I $VULKAN_SDK/include -L $VULKAN_SDK/lib
I'm really out of ideas
@Gustav0ar assuming you have the vulkan development libraries installed it should automatically enable it without needing anything special.
On ubuntu variants i am guessing it would be "sudo apt-get install libvulkan-dev"
On redhat variants it will be "sudo dnf install vulkan-devel"
I am guessing you should be able to manually point to the locations but it should not be needed.
@7oxicshadow I already tried that, but it doesn't work. I get this error when running configure:
ERROR: Feature 'vulkan' was enabled, but the pre-condition 'features.vkgen && libs.vulkan' failed.
@Gustav0ar All i can suggest is adding -v to the configure command as it will give you more information. Based on what I have read on the net it is almost certainly going to be missing vulkan/vulkan.h.
I am assuming you are running ubuntu. I would suggest "sudo apt-get install --reinstall libvulkan-dev".
After doing this i would also delete the contents of your build folder (not the qt source files) and re-running configuration again so it generates all new files.
Other than that, I am not sure of an easy solution to that one.
I was able to get Qt 5.15 to compile with vulkan support thanks to @7oxicshadow. I did it without the -developer-build option so I could install it as normal. When I installed it though, I noticed that qtdocgallery failed to install. I assume that's due to me not specifying the LLVM install directory as indicated here but I haven't yet found where it is on this Linux Mint distro.
My main question: Before compiling various projects I use the following command to import Qt environment variables, using my older 5.11 install from the PPA:
$ source /opt/qt511/bin/qt511-env.sh
However, I couldn't see such a shell script in this newly-compiled 5.15 instance. I know that in Yuzu I can always specify:
-DCMAKE_PREFIX_PATH=/usr/local/Qt-5.15.0/lib/cmake ..
However I'd prefer the shell script method (or perhaps better, have the system default to the new Qt). @7oxicshadow do you know how this can be done?
A few updates to the above:
Apparently the LLVM path in Mint is /usr/lib/llvm-6.0 for anyone curious, however I've found that this isn't needed if you compile withinit-repository rather than git submodule update --init --recursive as I had initially been doing (both are accepted per these steps as officailly documented
I solved the issue with the shell script by simply writing one of my own which references the latest (self-compiled) Qt. I'll just run that from now on.
It would be nice to use the self-compiled Qt as default (i.e. typing qmake --version returns the new version by default). There should be a way to do this with update-alternatives but I'm not entirely sure, any suggestions are welcome though.
Other than that though, Yuzu is compiling and running with Vulkan now. Big thanks to @7oxicshadow again for his help.
After many hours lost trying to compile Qt and Yuzu with vulkan in Linux Mint without success, I finally was able to compile both. Thanks for the tips @7oxicshadow
But now I'm having an issue when opening yuzu:
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc.
Apparently I'm missing some plugins.
I compiled Qt with the command:
configure -release -opensource -confirm-license -nomake examples -nomake tests -v -feature-vulkan
make -j16
and yuzu:
cmake .. -DCMAKE_BUILD_TYPE=release -DCMAKE_PREFIX_PATH=/opt/qt515/qtbase/lib/cmake
make -j16
@Shoegzer how did you manage to compile with the plugins?
@Gustav0ar that sounds like you're missing some xcb-related development libraries. Check the xcb section of this website. For example, assuming you're running Mint 19.3 as you stated above, you'll need to run the following command to install them:
apt-get install libx11-xcb-dev libxcb-composite0-dev libxcb-cursor-dev libxcb-damage0-dev libxcb-dpms0-dev libxcb-dri2-0-dev libxcb-dri3-dev libxcb-glx0-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-present-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-render0-dev libxcb-shape0-dev libxcb-shm0-dev libxcb-sync-dev libxcb-util-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-xkb-dev libxcb-xtest0-dev libxcb1-dev
Rebuild Qt and then Yuzu after that's done and you should hopefully be good to go.
@Shoegzer I already gone through that link before building, I installed all the packages mentioned there for Ubuntu or Mint. Very weird
Hmm... This page might help as someone else encountered something similar. Be sure the libqxcb library compiled properly, it will be in your ./plugins/platforms subdirectory of your qt build if it did. If not, then I'd follow @7oxicshadow's example a little more closely to build qt and ensure the library was also built first before compiling yuzu again.
Other than that, not sure what other help I can give.
I just compiled yuzu on KDE NEON and everything worked.
As a small update, I'm currently developing a work around for this problem so that you don't need to use Qt with Vulkan support in order to use Vulkan on yuzu. No ETA for when I'll be finished, but I hope to have that out sooner than later. With this change, yuzu should load Vulkan directly instead of having Qt manage that, which means we don't need QVulkanWindow as well.
Since no one has mentioned it in this thread, you can always just pass -DENABLE_VULKAN=No in the cmake step to disable vulkan until this is resolved.
Shouldn't this be closed as #3594 is merged? At least it compiles fine with Vulkan support on NixOS now
I'm unable to compile mainline with Vulkan support on Mint 19.3 with or without @7oxicshadow's suggestion of building qt from source. I get a different Vulkan-related error (VulkanSurface seems to be the problem instead of QVulkanWindow). Compiling with -DENABLE_VULKAN=No works as expected. Not sure whether this is a related problem, a separate problem, or simply an error on my part.
The error I get:
FAILED: src/yuzu/CMakeFiles/yuzu.dir/bootmanager.cpp.o
/usr/bin/c++ -DARCHITECTURE_x86_64=1 -DBOOST_DATE_TIME_NO_LIB -DBOOST_ERROR_CODE_HEADER_ONLY -DBOOST_REGEX_NO_LIB -DBOOST_SYSTEM_NO_LIB -DHAS_VULKAN -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_PROCESS_COMBINED_ARGUMENT_START -DQT_NO_URL_CAST_FROM_STRING -DQT_OPENGL_LIB -DQT_USE_QSTRINGBUILDER -DQT_WIDGETS_LIB -DYUZU_ENABLE_BOXCAT -D_FILE_OFFSET_BITS=64 -Isrc/yuzu -I../src/yuzu -Isrc/yuzu/yuzu_autogen/include -I../src/. -I/usr/include/x86_64-linux-gnu/qt5/QtGui/5.9.5 -I/usr/include/x86_64-linux-gnu/qt5/QtGui/5.9.5/QtGui -I/usr/include/x86_64-linux-gnu/qt5/QtCore/5.9.5 -I/usr/include/x86_64-linux-gnu/qt5/QtCore/5.9.5/QtCore -I../src/yuzu/../../externals/Vulkan-Headers/include -I../externals/fmt/include -I../externals/./microprofile -I../externals/glad/include -isystem /usr/include/SDL2 -isystem ../externals/boost -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtOpenGL -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -isystem /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -O3 -DNDEBUG -Wall -Werror=implicit-fallthrough -Werror=missing-declarations -Werror=reorder -Wextra -Wmissing-declarations -Wno-attributes -Wno-unused-parameter -fPIC -pthread -std=gnu++1z -MD -MT src/yuzu/CMakeFiles/yuzu.dir/bootmanager.cpp.o -MF src/yuzu/CMakeFiles/yuzu.dir/bootmanager.cpp.o.d -o src/yuzu/CMakeFiles/yuzu.dir/bootmanager.cpp.o -c ../src/yuzu/bootmanager.cpp
../src/yuzu/bootmanager.cpp: In constructor ‘VulkanRenderWidget::VulkanRenderWidget(GRenderWindow*)’:
../src/yuzu/bootmanager.cpp:242:49: error: ‘VulkanSurface’ is not a member of ‘QWindow’
windowHandle()->setSurfaceType(QWindow::VulkanSurface);
^~~~~~~~~~~~~
This is dependency issue with Ubuntu 18.04 based distros. I had no issues with KDE Neon and Ubuntu 20.04. Unfortunately there is no way to upgrade Qt version in those distros, you have to manually compile Qt with support by yourself which is not an easy task to do including all extensions needed. I'm going to close this since this kind of support should go to the Discord linux channel, it's not an issue with Yuzu itself.
Most helpful comment
As a small update, I'm currently developing a work around for this problem so that you don't need to use Qt with Vulkan support in order to use Vulkan on yuzu. No ETA for when I'll be finished, but I hope to have that out sooner than later. With this change, yuzu should load Vulkan directly instead of having Qt manage that, which means we don't need QVulkanWindow as well.
Since no one has mentioned it in this thread, you can always just pass
-DENABLE_VULKAN=Noin the cmake step to disable vulkan until this is resolved.