protonscr

Compilation fatal error: d3d11on12.h: No such file or directory

dxvkclosed buildcan't reproduce
doitsujin/dxvk#3328 · opened 2023-04-02 by dmitryr117 · updated 2024-10-05 · 25 comments · github
Ddmitryr117 2023-04-02 github

When compiling on Ubuntu 22.04 using the following command:
$ ./package-release.sh master ../dlls/ --no-package

I get the following error:

Run-time dependency threads found: YES
Dependency threads found: YES unknown (cached)
Build targets in project: 14

dxvk v2.1

  Subprojects
    libdisplay-info: YES

  User defined options
    Cross files    : /home/dmitryr117/dev/dxvk/dxvk/build-win64.txt
    bindir         : x64
    buildtype      : release
    libdir         : x64
    prefix         : /home/dmitryr117/dev/dxvk/dlls/dxvk-master
    strip          : True
    build_id       : false

Found ninja-1.10.1 at /usr/bin/ninja
[168/289] Compiling C++ object src/d3d11/d3d11.dll.p/d3d11_class_linkage.cpp.obj
FAILED: src/d3d11/d3d11.dll.p/d3d11_class_linkage.cpp.obj 
x86_64-w64-mingw32-g++ -Isrc/d3d11/d3d11.dll.p -Isrc/d3d11 -I../../../dxvk/src/d3d11 -I../../../dxvk/include -I../../../dxvk/include/vulkan/include -I../../../dxvk/include/spirv/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=c++17 -O3 -msse -msse2 -msse3 -mfpmath=sse -Wimplicit-fallthrough -Wno-missing-field-initializers -Wno-unused-parameter -Wno-cast-function-type -Wno-unused-const-variable -Wno-missing-braces -DNOMINMAX -D_WIN32_WINNT=0xa00 -DDXVK_WSI_WIN32 -MD -MQ src/d3d11/d3d11.dll.p/d3d11_class_linkage.cpp.obj -MF src/d3d11/d3d11.dll.p/d3d11_class_linkage.cpp.obj.d -o src/d3d11/d3d11.dll.p/d3d11_class_linkage.cpp.obj -c ../../../dxvk/src/d3d11/d3d11_class_linkage.cpp
In file included from ../../../dxvk/src/d3d11/d3d11_on_12.h:3,
                 from ../../../dxvk/src/d3d11/d3d11_buffer.h:10,
                 from ../../../dxvk/src/d3d11/d3d11_context.h:16,
                 from ../../../dxvk/src/d3d11/d3d11_cmdlist.h:5,
                 from ../../../dxvk/src/d3d11/d3d11_device.h:17,
                 from ../../../dxvk/src/d3d11/d3d11_class_linkage.cpp:2:
../../../dxvk/src/d3d11/d3d11_on_12_interfaces.h:5:10: fatal error: d3d11on12.h: No such file or directory
    5 | #include <d3d11on12.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
[170/289] Compiling C++ object src/d3d11/d3d11.dll.p/d3d11_annotation.cpp.obj

System information

  • GPU: RTX3070
  • Driver: 525 propietary
  • Wine version: 8.0
  • DXVK version: 2.1
  • mingw-w64 10.0.0-2
  • Ubuntu 22.04
Ddoitsujin maintainer 2023-04-02 github

Not sure why Ubuntu wouldn't package that paticular header, it's part of the mingw-headers package on Arch and that's the same version.

Ddmitryr117 2023-04-02 github

I originally started with mingw-w64 8.0.0 which is default to Ubuntu 22.04. But it failed then as well. I wonder if this has something to do with the issue.

Ddmitryr117 2023-04-02 github

So I updated to Ubuntu 22.10. And it compiled. The configuration is now as follows:

  • CPU AMD FX-8350
  • OS Ubuntu 22.10
  • wine-7.3 (Ubuntu 7.3~repack-1)
  • ninja-1.11.0
  • GPU: RTX3070. nvidia-driver-525 (proprietary, tested)
  • mingw-w64 10.0.0-2
BBlisto91 2023-04-12 github

@dmitryr117 Am i understanding correctly that you solved the issue when updating your distro?

Ddpieve 2023-05-04 github

I had the same error in Ubuntu 22.04.
As suggested, I updated to 22.10.

Now it fails here:

Found ninja-1.11.0 at /usr/bin/ninja
[193/289] Compiling C++ object src/d3d11/d3d11.dll.p/d3d11_interop.cpp.obj
FAILED: src/d3d11/d3d11.dll.p/d3d11_interop.cpp.obj
x86_64-w64-mingw32-g++ -Isrc/d3d11/d3d11.dll.p -Isrc/d3d11 -I../../src/d3d11 -I../../include -I../../include/vulkan/include -I../../include/spirv/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -std=c++17 -O3 -msse -msse2 -msse3 -mfpmath=sse -Wimplicit-fallthrough -Wno-missing-field-initializers -Wno-unused-parameter -Wno-cast-function-type -Wno-unused-const-variable -Wno-missing-braces -DNOMINMAX -D_WIN32_WINNT=0xa00 -DDXVK_WSI_WIN32 -MD -MQ src/d3d11/d3d11.dll.p/d3d11_interop.cpp.obj -MF src/d3d11/d3d11.dll.p/d3d11_interop.cpp.obj.d -o src/d3d11/d3d11.dll.p/d3d11_interop.cpp.obj -c ../../src/d3d11/d3d11_interop.cpp
x86_64-w64-mingw32-g++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
[210/289] Compiling C++ object src/d3d11/d3d11.dll.p/d3d11_context.cpp.obj
ninja: build stopped: subcommand failed.
  • Ubuntu 22.10
  • ninja 1.11.0
  • mingw-w64-x86-64-dev 10.0.0-2
  • wine 8.0.1
  • CPU AMD Ryzen 7 5800H

Steps:

git clone --recursive https://github.com/doitsujin/dxvk.git
cd dxvk
./package-release.sh master . --no-package

Compiling manually gives the same error

What should I try to fix it?

TTheFireKahuna 2023-05-17 github

Same issue

[169/289] Compiling C++ object src/d3d11/d3d11.dll.p/d3d11_cuda.cpp.obj
FAILED: src/d3d11/d3d11.dll.p/d3d11_cuda.cpp.obj
i686-w64-mingw32-g++ -Isrc/d3d11/d3d11.dll.p -Isrc/d3d11 -I../src/d3d11 -I../include -I../include/vulkan/include -I../include/spirv/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -std=c++17 -g -msse -msse2 -msse3 -mfpmath=sse -Wimplicit-fallthrough -Wno-missing-field-initializers -Wno-unused-parameter -Wno-cast-function-type -Wno-unused-const-variable -Wno-missing-braces -DNOMINMAX -D_WIN32_WINNT=0xa00 -gstrict-dwarf -gdwarf-2 -DDXVK_WSI_WIN32 -MD -MQ src/d3d11/d3d11.dll.p/d3d11_cuda.cpp.obj -MF src/d3d11/d3d11.dll.p/d3d11_cuda.cpp.obj.d -o src/d3d11/d3d11.dll.p/d3d11_cuda.cpp.obj -c ../src/d3d11/d3d11_cuda.cpp
In file included from ../src/d3d11/d3d11_on_12.h:3,
                 from ../src/d3d11/d3d11_buffer.h:10,
                 from ../src/d3d11/d3d11_cuda.h:11,
                 from ../src/d3d11/d3d11_cuda.cpp:1:
../src/d3d11/d3d11_on_12_interfaces.h:5:10: fatal error: d3d11on12.h: No such file or directory
    5 | #include <d3d11on12.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
[182/289] Compiling C++ object src/dxgi/dxgi.dll.p/dxgi_output.cpp.obj
ninja: build stopped: subcommand failed.

I've reinstalled mingw, have the following packages installed

Setting up g++-mingw-w64-x86-64-posix (10.3.0-14ubuntu1+24.3) ...
Setting up g++-mingw-w64-x86-64 (10.3.0-14ubuntu1+24.3) ...
Setting up g++-mingw-w64-i686-posix (10.3.0-14ubuntu1+24.3) ...
Setting up g++-mingw-w64-i686 (10.3.0-14ubuntu1+24.3) ...
Setting up g++-mingw-w64 (10.3.0-14ubuntu1+24.3) ...
Ssquidme3 2023-05-28 github

Has anyone found a fix. I am getting the same issue. I 'm also on Ubuntu and upgrading distro and reinstalling mingw did nothing.
I am getting this error:

[167/290] Compiling C++ object src/d3d11/d3d11.dll.p/d3d11_class_linkage.cpp.obj
FAILED: src/d3d11/d3d11.dll.p/d3d11_class_linkage.cpp.obj 
x86_64-w64-mingw32-g++ -Isrc/d3d11/d3d11.dll.p -Isrc/d3d11 -I../../src/d3d11 -I../../include -I../../include/vulkan/include -I../../include/spirv/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -std=c++17 -O3 -msse -msse2 -msse3 -mfpmath=sse -Wimplicit-fallthrough -Wno-missing-field-initializers -Wno-unused-parameter -Wno-cast-function-type -Wno-unused-const-variable -Wno-missing-braces -DNOMINMAX -D_WIN32_WINNT=0xa00 -DDXVK_WSI_WIN32 -MD -MQ src/d3d11/d3d11.dll.p/d3d11_class_linkage.cpp.obj -MF src/d3d11/d3d11.dll.p/d3d11_class_linkage.cpp.obj.d -o src/d3d11/d3d11.dll.p/d3d11_class_linkage.cpp.obj -c ../../src/d3d11/d3d11_class_linkage.cpp
In file included from ../../src/d3d11/d3d11_on_12.h:3,
                 from ../../src/d3d11/d3d11_buffer.h:10,
                 from ../../src/d3d11/d3d11_context.h:16,
                 from ../../src/d3d11/d3d11_cmdlist.h:5,
                 from ../../src/d3d11/d3d11_device.h:17,
                 from ../../src/d3d11/d3d11_class_linkage.cpp:2:
../../src/d3d11/d3d11_on_12_interfaces.h:5:10: fatal error: d3d11on12.h: No such file or directory
    5 | #include <d3d11on12.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
[170/290] Compiling C++ object src/d3d11/d3d11.dll.p/d3d11_annotation.cpp.obj
FAILED: src/d3d11/d3d11.dll.p/d3d11_annotation.cpp.obj 
x86_64-w64-mingw32-g++ -Isrc/d3d11/d3d11.dll.p -Isrc/d3d11 -I../../src/d3d11 -I../../include -I../../include/vulkan/include -I../../include/spirv/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -std=c++17 -O3 -msse -msse2 -msse3 -mfpmath=sse -Wimplicit-fallthrough -Wno-missing-field-initializers -Wno-unused-parameter -Wno-cast-function-type -Wno-unused-const-variable -Wno-missing-braces -DNOMINMAX -D_WIN32_WINNT=0xa00 -DDXVK_WSI_WIN32 -MD -MQ src/d3d11/d3d11.dll.p/d3d11_annotation.cpp.obj -MF src/d3d11/d3d11.dll.p/d3d11_annotation.cpp.obj.d -o src/d3d11/d3d11.dll.p/d3d11_annotation.cpp.obj -c ../../src/d3d11/d3d11_annotation.cpp
In file included from ../../src/d3d11/d3d11_on_12.h:3,
                 from ../../src/d3d11/d3d11_buffer.h:10,
                 from ../../src/d3d11/d3d11_context.h:16,
                 from ../../src/d3d11/d3d11_cmdlist.h:5,
                 from ../../src/d3d11/d3d11_context_def.h:3,
                 from ../../src/d3d11/d3d11_annotation.cpp:2:
../../src/d3d11/d3d11_on_12_interfaces.h:5:10: fatal error: d3d11on12.h: No such file or directory
    5 | #include <d3d11on12.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
[176/290] Compiling C++ object src/d3d11/d3d11.dll.p/.._dxgi_dxgi_format.cpp.obj
ninja: build stopped: subcommand failed.

BBlisto91 2023-05-28 github

Sorry i don't think any of the devs use ubuntu and are all (or most?) on Arch based distros, myself included.
Having installed mingw-w64 plus the headers packages here i have the d3d11on12.h files included.

/usr/x86_64-w64-mingw32/include/d3d11on12.h
/usr/i686-w64-mingw32/include/d3d11on12.h

Version 10.0.0 by the looks of it.

BBlisto91 2023-08-08 github
AAhmed-E-86 2023-08-26 github

https://github.com/WinterSnowfall/dxvk-build-tools might also be of interest.

The first command in your freaking docker_build.sh contains this command:

docker system prune -f

And this freaking command deletes all stopped containers. I did not notice this command at first, then I found all the containers are deleted, and everything inside them. I do not know how I overlooked this command, but it happened. How did you think it is a good idea to add this command @Blisto91!?

Jjp7677 2023-08-26 github

Running docker system prune is indeed fatal when you use docker for other affairs. I sincerely hope that you didn't lost any serious data.
I solved this slightly different in my build-using-docker-attempt by just deleting the earlier tagged container, https://github.com/jp7677/dxvk-docker/blob/master/setup-dxvk-docker.sh#L8 (usage on you own risk, please also don't trust my scripts, I've written them with my setup and workflow in mind)

AAhmed-E-86 2023-08-26 github

@jp7677 I lost a few local databases that I was testing before production, nothing fatal, but I learned my lesson.

I am working on something related to dxvk-nvapi, but I have not used dxvk-nvapi before mainly because I have an AMD GPU, and I do not know if it is safe to use it globally, or it could to lead to issues with some games, or GPUs.

Jjp7677 2023-08-26 github

@jp7677 I lost a few local databases that I was testing before production, nothing fatal, but I learned my lesson.

I'm glad to hear that!

I am working on something related to dxvk-nvapi, but I have not used dxvk-nvapi before mainly because I have an AMD GPU, and I do not know if it is safe to use it globally, or it could to lead to issues with some games, or GPUs.

The benefits of dxvk-nvapi i.c.w. are very limited on AMD, I suggest to go through https://github.com/jp7677/dxvk-nvapi/blob/master/README.md and start slowly and enable it game by game if want to go that route. Feel free to open an issue at https://github.com/jp7677/dxvk-nvapi/issues when you have any questions since this is getting out of scope for this issue/issue tracker here.

BBlisto91 2023-08-26 github

Note it's not my project. But I am very sorry that I guided you to something that could have deleted important data 😬. Glad to hear nothing fatal was lost.

WWinterSnowfall 2023-08-26 github

I do not know how I overlooked this command, but it happened. How did you think it is a good idea to add this command @Blisto91!?

@Blisto91's not to blame, it's my fault. In my defense I never intended for people to use these scripts on an environment where they already have other docker containers (I certainly don't), since it's mostly targeted at beginners in docker, but agree it's sort of a big oops/oversight on my end. I will remove it and apologize for any trouble it's caused.

I also tend to use docker volumes for persistent storage (and strongly recommend their use in general), which the offending command doesn't remove, but admittedly resorting to them is a personal choice and I certainly don't expect everyone out there to.

I lost a few local databases that I was testing before production, nothing fatal, but I learned my lesson.

.. I'm very sorry this happened. Hopefully part of that lesson (that was not my intention to teach) is that you should never store persistent state inside of a container. If you'll ever use any IaC solution note that containers are regarded as perishable resources and can get removed/recreated outside of your control, so your persistent data lifecycle should not be tied to them in any way.

Edit: Don't use as of writing. See comment below.

It should be safe(r) to use now, even on a docker-heavy system, sorry for the trouble. As with everything, it's probably a good idea to try out the scripts in a sandbox or a non-critical system before committing to their use.

SSwimmingTiger 2023-10-07 github

I have the same issue with Ubuntu 22.04 and mingw-w64. But when I build with llvm-mingw, everything works well.

# remove mingw-w64
sudo apt purge --autoremove mingw-w64

# download llvm-mingw
wget https://github.com/mstorsjo/llvm-mingw/releases/download/20230320/llvm-mingw-20230320-ucrt-ubuntu-18.04-x86_64.tar.xz

# unpack
tar xf llvm-mingw-20230320-ucrt-ubuntu-18.04-x86_64.tar.xz

# set env
export PATH="$PWD/llvm-mingw-20230320-ucrt-ubuntu-18.04-x86_64/bin:$PATH" LD_LIBRARY_PATH="$PWD/llvm-mingw-20230320-ucrt-ubuntu-18.04-x86_64/lib"

# build dxvk
git clone --recursive https://github.com/doitsujin/dxvk.git
cd dxvk
./package-release.sh master . --no-package

It works fine.

Ssuamor 2024-01-19 github

I worked around this by manually installing the packages from Ubuntu 22.10.

https://packages.ubuntu.com/kinetic/mingw-w64-i686-dev https://packages.ubuntu.com/kinetic/mingw-w64-x86-64-dev https://packages.ubuntu.com/kinetic/mingw-w64-common

Just want to point out that 22.10 has no longer support. The links are no longer valid.
Currently you still can find the mingw 10.0 kinetic packages that are compatible, but only via search machine.

WWedge009 2024-01-19 github

I suppose you could try lunar (23.04) packages.

BBlisto91 2024-03-21 github

@dmitryr117 Is this still an issue with latest Ubuntu?

BBlisto91 2024-04-15 github

@dmitryr117 Friendly ping

Hhwertz 2024-07-11 github

Oh yeah, I had this issue. This isn't the way to do it probably, but I copied dxvk/include/native/directx/d3d11on12.h (or possibly *.h) to dxvk/src/d3d11/

I just recently re-checked out dxvk, due to some header error and now realize this isn't quite working any longer. I get an error about "../../../dxvk/src/d3d8/d3d8_interface.cpp:69:16: error: ‘D3DENUM_WHQL_LEVEL’ was not declared in this scope; did you mean ‘D3DENUM_NO_WHQL_LEVEL’?"

Ahh well. I do have a 24.04 VM, so I can just build it on there if I need to. Or Arch.

KK0bin maintainer 2024-10-05 github

We've clearly established that this is a problem with the packages shipped by specific distributions and a workaround has been posted. So I'd say this issue can be closed.

Hhwertz 2024-10-05 github

Indeed. And for the last error I had (with the error with dxvk/src/d3d8) I simply made a copy of package-release.sh (called pacakage-release-nod3d8.sh) and in the section for "meson setup" I added "-Denable_d3d8=false" to it. I probably could replace my mingw headers with other ones to fix it, but I don't have any games that need the new d3d8 support (I have a few games that old but presumably the wine's wined3d is taking care of them instead...)

So distro-specific, and this bug documents the workarounds even for that distro.
Thanks for the great work!
--Henry

DLLs