Giter Site home page Giter Site logo

Build issues on Fedora 28 about nine HOT 34 CLOSED

Venemo avatar Venemo commented on June 5, 2024
Build issues on Fedora 28

from nine.

Comments (34)

dhewg avatar dhewg commented on June 5, 2024

meson.build:41:4: ERROR: Problem encountered: WINE headers not found

I got that on debian in the past too, and it's because winegcc didn't set the include path for the libwine headers. I fixed that, and the patch got merged for WINE v3.21 iirc. So starting with that development release, or v4 stable, that issue is fixed.

In the meantime, you can add -I /usr/include/wine to c_args in tools/cross-wine64.in and tools/cross-wine32.in. That should fix it.

Dependency d3dadapter9 found: NO

/usr/lib64/d3d/d3dadapter9.so as well as d3d.pc file you mentioned are the 64bit version, you need the 32bit one as well.

Checking for function "dlopen" : NO

Same issue with libc, you need a 32bit package with its headers.

I can't help much with what packages are required for Fedora, but if you figure it out please mention the list and I'll add it to the README ;)

from nine.

Venemo avatar Venemo commented on June 5, 2024

/usr/lib64/d3d/d3dadapter9.so as well as d3d.pc file you mentioned are the 64bit version, you need the 32bit one as well.

Sorry for being unclear. Yes the 32-bit version is also installed.

[root@timur-xps ~]# cat /usr/lib/pkgconfig/d3d.pc 
prefix=/usr
exec_prefix=/usr
libdir=/usr/lib
includedir=/usr/include
moduledir=/usr/lib/d3d

Name: d3d
Description: Native D3D driver modules
Version: 1.0.0
Requires.private: libdrm >= 2.4.75
Cflags: -I${includedir}

Same issue with libc, you need a 32bit package with its headers.

It should be there as well:

[root@timur-xps ~]# ls /usr/lib/libdl*
/usr/lib/libdl-2.27.so  /usr/lib/libdl.so.2

from nine.

dhewg avatar dhewg commented on June 5, 2024

Ok, /usr/lib/pkgconfig/d3d.pc looks good then.
If you get

Cross dependency d3dadapter9 found: NO (tried pkgconfig and cmake)
Cross dependency d3d found: YES 1.0.0

then that's fine, it's the same thing, d3d is just another name for d3dadapter9.

Now I see that it tries to link /usr/lib64/wine/libwinecrt0.a, and that is another WINE issue I fixed. That's going to get ugly, and I recommend to build with WINE >= 3.21 (or at least the WINE tools >= 3.21 if your distro packages it that way). But if you feel adventurous you can add something like this to c_link_args in tools/cross-wine32.in:

                  '-nodefaultlibs',
                  '-L/usr/lib/wine',
                  '/usr/lib/wine/libwinecrt0.a',
                  '-lntdll',
                  '-lkernel32',
                  '-luser32',
                  '-lgdi32',

from nine.

Venemo avatar Venemo commented on June 5, 2024

@dhewg Thanks. After reading it further I noticed that I need another pkg-config package for 32-bit. Now that I installed it I get a different error.

[Timur@timur-xps nine]$ git clean -fdx
Removing tools/cross-wine32
Removing tools/cross-wine64
[Timur@timur-xps nine]$ ./release.sh 
found fedora compatible distro
The Meson build system
Version: 0.47.2
Source dir: /home/Timur/Projects/Others/nine
Build dir: /tmp/tmp.fM2jX2osWF/build32
Build type: cross build
Program tools/get_version.sh found: YES (/home/Timur/Projects/Others/nine/tools/get_version.sh)
Project name: Gallium Nine Standalone
Project version: 0.1.0.121
Native C compiler: cc (gcc 8.2.1 "cc (GCC) 8.2.1 20181215 (Red Hat 8.2.1-6)")
Cross C compiler: winegcc (gcc 8.2.1)
Host machine cpu family: x86
Host machine cpu: i686
Target machine cpu family: x86
Target machine cpu: i686
Build machine cpu family: x86_64
Build machine cpu: x86_64
Checking if "winelib check" compiles: YES
Has header "wine/debug.h": YES
Program wrc found: YES (/usr/bin/wrc)
Checking for function "dlopen" : NO
Library dl found: YES
Checking for function "dlopen" : YES
Checking for function "dlclose" : YES
Checking for function "dlsym" : YES
Checking for function "dladdr" : YES
Dependency d3dadapter9 found: NO

meson.build:72:2: ERROR:  Could not generate cargs for d3d:



A full log can be found at /tmp/tmp.fM2jX2osWF/build32/meson-logs/meson-log.txt

The relevant part from the meson log:

Determining dependency 'd3dadapter9' with pkg-config executable '/usr/bin/i686-redhat-linux-gnu-pkg-config'
Called `/usr/bin/i686-redhat-linux-gnu-pkg-config --modversion d3dadapter9` -> 1

Dependency d3dadapter9 found: NO
Determining dependency 'd3d' with pkg-config executable '/usr/bin/i686-redhat-linux-gnu-pkg-config'
Called `/usr/bin/i686-redhat-linux-gnu-pkg-config --modversion d3d` -> 0
1.0.0
Called `/usr/bin/i686-redhat-linux-gnu-pkg-config --cflags d3d` -> 1


meson.build:72:2: ERROR:  Could not generate cargs for d3d:

from nine.

Venemo avatar Venemo commented on June 5, 2024

Okay, I think the main reason is missing 32-bit -devel packages, it's just that meson doesn't really do a good job at telling what it needs.

from nine.

Venemo avatar Venemo commented on June 5, 2024

After installing all the 32-bit devel packages, I get a linker error:

[12/13] Linking target d3d9-nine/d3d9-nine.dll.so.
FAILED: d3d9-nine/d3d9-nine.dll.so 
winegcc  -o d3d9-nine/d3d9-nine.dll.so d3d9-nine/version.res 'd3d9-nine/d3d9-nine@@d3d9-nine.dll@sha/d3d9_main.c.o' 'd3d9-nine/d3d9-nine@@d3d9-nine.dll@sha/d3dadapter9.c.o' 'd3d9-nine/d3d9-nine@@d3d9-nine.dll@sha/device_wrap.c.o' 'd3d9-nine/d3d9-nine@@d3d9-nine.dll@sha/dri3.c.o' 'd3d9-nine/d3d9-nine@@d3d9-nine.dll@sha/present.c.o' 'd3d9-nine/d3d9-nine@@d3d9-nine.dll@sha/shader_validator.c.o' 'd3d9-nine/d3d9-nine@@d3d9-nine.dll@sha/wndproc.c.o' ../../../home/Timur/Projects/Others/nine/d3d9-nine/d3d9.spec -Wl,--no-undefined -Wl,--as-needed -Wl,-O1 -shared -fPIC -Wl,--start-group -Wl,-soname,d3d9-nine.dll.so -ldl /usr/lib/libX11.so /usr/lib/libXext.so /usr/lib/libX11-xcb.so /usr/lib/libxcb.so /usr/lib/libxcb-dri3.so /usr/lib/libxcb-present.so /usr/lib/libxcb-xfixes.so -ldxguid -luuid -ladvapi32 -luser32 -Wl,--end-group -m32 -mwindows 
d3d9-nine/d3d9-nine@@d3d9-nine.dll@sha/dri3.c.o: In function `PRESENTDestroyPixmapContent.part.7':
dri3.c:(.text+0x198): undefined reference to `eglQueryAPI'
dri3.c:(.text+0x1a7): undefined reference to `eglBindAPI'
dri3.c:(.text+0x1b6): undefined reference to `eglMakeCurrent'
dri3.c:(.text+0x1d4): undefined reference to `eglMakeCurrent'
dri3.c:(.text+0x1dc): undefined reference to `eglBindAPI'
dri3.c:(.text+0x1f1): undefined reference to `eglGetError'
dri3.c:(.text+0x22a): undefined reference to `glDeleteFramebuffers'
dri3.c:(.text+0x237): undefined reference to `glDeleteFramebuffers'
dri3.c:(.text+0x247): undefined reference to `glDeleteTextures'
dri3.c:(.text+0x251): undefined reference to `glDeleteTextures'
d3d9-nine/d3d9-nine@@d3d9-nine.dll@sha/dri3.c.o: In function `DRI2FallbackInit':
dri3.c:(.text+0x913): undefined reference to `eglQueryAPI'
dri3.c:(.text+0x924): undefined reference to `eglGetProcAddress'
dri3.c:(.text+0x94f): undefined reference to `eglInitialize'
dri3.c:(.text+0x966): undefined reference to `eglTerminate'
dri3.c:(.text+0x96e): undefined reference to `eglBindAPI'
dri3.c:(.text+0x9b7): undefined reference to `eglQueryString'
dri3.c:(.text+0x9e9): undefined reference to `eglQueryString'
dri3.c:(.text+0xa82): undefined reference to `eglChooseConfig'
dri3.c:(.text+0xa9a): undefined reference to `eglBindAPI'
dri3.c:(.text+0xabb): undefined reference to `eglCreateContext'
dri3.c:(.text+0xad7): undefined reference to `eglGetProcAddress'
dri3.c:(.text+0xae7): undefined reference to `eglGetProcAddress'
dri3.c:(.text+0xaf9): undefined reference to `eglGetProcAddress'
dri3.c:(.text+0xb29): undefined reference to `eglMakeCurrent'
dri3.c:(.text+0xb81): undefined reference to `eglBindAPI'
dri3.c:(.text+0xbc5): undefined reference to `eglDestroyContext'
d3d9-nine/d3d9-nine@@d3d9-nine.dll@sha/dri3.c.o: In function `DRI2FallbackDestroy':
dri3.c:(.text+0xbf3): undefined reference to `eglQueryAPI'
dri3.c:(.text+0xc02): undefined reference to `eglBindAPI'
dri3.c:(.text+0xc10): undefined reference to `eglMakeCurrent'
dri3.c:(.text+0xc1e): undefined reference to `eglDestroyContext'
dri3.c:(.text+0xc3d): undefined reference to `eglBindAPI'
dri3.c:(.text+0xc65): undefined reference to `eglTerminate'
d3d9-nine/d3d9-nine@@d3d9-nine.dll@sha/dri3.c.o: In function `DRI2FallbackPRESENTPixmap':
dri3.c:(.text+0x1b2b): undefined reference to `eglMakeCurrent'
dri3.c:(.text+0x1b33): undefined reference to `eglBindAPI'
dri3.c:(.text+0x1b7d): undefined reference to `eglQueryAPI'
dri3.c:(.text+0x1b8c): undefined reference to `eglBindAPI'
dri3.c:(.text+0x1bce): undefined reference to `eglMakeCurrent'
dri3.c:(.text+0x1bf4): undefined reference to `eglMakeCurrent'
dri3.c:(.text+0x1caa): undefined reference to `eglBindAPI'
dri3.c:(.text+0x1cd1): undefined reference to `eglGetError'
dri3.c:(.text+0x1d0b): undefined reference to `glGenTextures'
dri3.c:(.text+0x1d1b): undefined reference to `glBindTexture'
dri3.c:(.text+0x1d32): undefined reference to `glTexParameteri'
dri3.c:(.text+0x1d49): undefined reference to `glTexParameteri'
dri3.c:(.text+0x1d65): undefined reference to `glGenFramebuffers'
dri3.c:(.text+0x1d75): undefined reference to `glBindFramebuffer'
dri3.c:(.text+0x1d94): undefined reference to `glFramebufferTexture2D'
dri3.c:(.text+0x1da1): undefined reference to `glCheckFramebufferStatus'
dri3.c:(.text+0x1dbe): undefined reference to `glBindTexture'
dri3.c:(.text+0x1e01): undefined reference to `glGenTextures'
dri3.c:(.text+0x1e11): undefined reference to `glBindTexture'
dri3.c:(.text+0x1e28): undefined reference to `glTexParameteri'
dri3.c:(.text+0x1e3f): undefined reference to `glTexParameteri'
dri3.c:(.text+0x1e5b): undefined reference to `glGenFramebuffers'
dri3.c:(.text+0x1e6b): undefined reference to `glBindFramebuffer'
dri3.c:(.text+0x1e8a): undefined reference to `glFramebufferTexture2D'
dri3.c:(.text+0x1e97): undefined reference to `glCheckFramebufferStatus'
dri3.c:(.text+0x1eb4): undefined reference to `glBindTexture'
d3d9-nine/d3d9-nine@@d3d9-nine.dll@sha/dri3.c.o: In function `PRESENTPixmap':
dri3.c:(.text+0x2801): undefined reference to `eglQueryAPI'
dri3.c:(.text+0x2810): undefined reference to `eglBindAPI'
dri3.c:(.text+0x281f): undefined reference to `eglMakeCurrent'
dri3.c:(.text+0x2845): undefined reference to `eglMakeCurrent'
dri3.c:(.text+0x284d): undefined reference to `eglBindAPI'
dri3.c:(.text+0x2a4b): undefined reference to `glBindFramebuffer'
dri3.c:(.text+0x2a61): undefined reference to `glBindFramebuffer'
dri3.c:(.text+0x2a8c): undefined reference to `glBlitFramebuffer'
dri3.c:(.text+0x2a94): undefined reference to `glFlush'
dri3.c:(.text+0x2aa1): undefined reference to `eglGetError'
collect2: error: ld returned 1 exit status
winegcc: gcc failed
ninja: build stopped: subcommand failed.

from nine.

dhewg avatar dhewg commented on June 5, 2024

That's libgl and libegl for the dri2 fallback. Maybe the 32bit version of those -devel packages are missing?
Alternatively you can disable dri2 and just build support for dri3: pass '-Ddri2=false' to the meson cmdline.

from nine.

Venemo avatar Venemo commented on June 5, 2024

Yep, the 32-bit mesa devel packages were missing. Though I would have expected meson to check that too.

from nine.

Venemo avatar Venemo commented on June 5, 2024

Okay, after installing all dependencies, I was able to build it! Will report back about how it works. :)

from nine.

dhewg avatar dhewg commented on June 5, 2024

Whew, finally ;)

meson.build does check for both of those libs, the issue is likely related to multiarch. It's sort of a mess, maybe you noticed the bootstrap.sh script where I already tried to work around one of the issues. Every distro does it a bit differently...

It would be great if you could summarize what you had to do to get it to build for other Fedora users!

from nine.

Venemo avatar Venemo commented on June 5, 2024

Let's say that I kind of used a very big hammer...

What I did was dnf install mesa*-devel.i686 libxcb*-devel.i686 libX*-devel.i686 libdrm-devel.i686 pkgconf-pkg-config.i686 wine-devel.i686 wine-devel.x86_64 mesa-libd3d-devel.x86_64 mesa-libd3d-devel.i686 wine-debugsource.i686 wine-debugsource.x86_64 - and I'm pretty sure some of these are not really necessary.

from nine.

dhewg avatar dhewg commented on June 5, 2024

Hehe, okay ;)

Which version of WINE are you using? According to this Fedora 28 should have 3.21? The WINE header issue and the wrong linkage of /usr/lib64/wine/libwinecrt0.a should be fixed with that version?

from nine.

Venemo avatar Venemo commented on June 5, 2024

Yes, that is correct it has 3.21, I gotta admit that part was my fault, because I was using an older version (3.13) with the PBA patch from a copr repo. Bascially the PBA patch effectively doubled the frame rates of the game I was playing on it.

I will upgrade to latest 3.21 before testing nine.

from nine.

dhewg avatar dhewg commented on June 5, 2024

It should work with 3.13 too, but building with >= 3.21 should be 'just' a matter of installing the required packages - without those other headaches ;)

from nine.

dhewg avatar dhewg commented on June 5, 2024

Remember to remove the wine header directory you copied before you try again

from nine.

Venemo avatar Venemo commented on June 5, 2024

On 3.21 (staging, if it matters) that comes with F28, the headers are still not found from their default location. But otherwise Nine works pretty well. Frame rates are roughly in the same ballpark as with the PBA patch, but the peak frame rate is higher.

from nine.

dhewg avatar dhewg commented on June 5, 2024

Depends on the game and if you're cpu or gpu limited. You can of course combine nine with pba, esync or whatever.

If winegcc still can't find it's headers that is either a bug in that tool or the package. Does that happen when building for 64bit, 32bit or both? Can you please paste the output of echo 'int main() { return 0; }' > /tmp/test.c; winegcc -v /tmp/test.c

from nine.

dhewg avatar dhewg commented on June 5, 2024

(erm, looking at PBA, while you can combine it with nine, PBA improves wined3d, so it doesn't help nine at all)

from nine.

dhewg avatar dhewg commented on June 5, 2024

Are you sure nine is enabled or working? All checkboxes in the gui should be checked and upon running a game you'd get Native Direct3D 9 v0.1.0.120 is active.

from nine.

Venemo avatar Venemo commented on June 5, 2024

Can you please paste the output of

Sure thing, here you go:

[Timur@timur-xps nine]$ echo 'int main() { return 0; }' > /tmp/test.c; winegcc -v /tmp/test.c
gcc -m64 -fshort-wchar -DWINE_UNICODE_NATIVE -D_REENTRANT -fPIC -DWIN64 -D_WIN64 -D__WIN64 -D__WIN64__ -DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ -D__WINNT -D__WINNT__ -D__stdcall=__attribute__((ms_abi)) -D__cdecl=__attribute__((ms_abi)) -D_stdcall=__attribute__((ms_abi)) -D_cdecl=__attribute__((ms_abi)) -D__fastcall=__attribute__((ms_abi)) -D_fastcall=__attribute__((ms_abi)) -D__declspec(x)=__declspec_##x -D__declspec_align(x)=__attribute__((aligned(x))) -D__declspec_allocate(x)=__attribute__((section(x))) -D__declspec_deprecated=__attribute__((deprecated)) -D__declspec_dllimport=__attribute__((dllimport)) -D__declspec_dllexport=__attribute__((dllexport)) -D__declspec_naked=__attribute__((naked)) -D__declspec_noinline=__attribute__((noinline)) -D__declspec_noreturn=__attribute__((noreturn)) -D__declspec_nothrow=__attribute__((nothrow)) -D__declspec_novtable=__attribute__(()) -D__declspec_selectany=__attribute__((weak)) -D__declspec_thread=__thread -D__int8=char -D__int16=short -D__int32=int -D__int64=long -D__WINE__ -c -o test-E3mHxL.o -v /tmp/test.c -isystem/usr/include -isystem/usr/include/wine/windows 
Using built-in specs.
COLLECT_GCC=gcc
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --enable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 8.2.1 20181215 (Red Hat 8.2.1-6) (GCC) 
COLLECT_GCC_OPTIONS='-m64' '-fshort-wchar' '-D' 'WINE_UNICODE_NATIVE' '-D' '_REENTRANT' '-fPIC' '-D' 'WIN64' '-D' '_WIN64' '-D' '__WIN64' '-D' '__WIN64__' '-D' 'WIN32' '-D' '_WIN32' '-D' '__WIN32' '-D' '__WIN32__' '-D' '__WINNT' '-D' '__WINNT__' '-D' '__stdcall=__attribute__((ms_abi))' '-D' '__cdecl=__attribute__((ms_abi))' '-D' '_stdcall=__attribute__((ms_abi))' '-D' '_cdecl=__attribute__((ms_abi))' '-D' '__fastcall=__attribute__((ms_abi))' '-D' '_fastcall=__attribute__((ms_abi))' '-D' '__declspec(x)=__declspec_##x' '-D' '__declspec_align(x)=__attribute__((aligned(x)))' '-D' '__declspec_allocate(x)=__attribute__((section(x)))' '-D' '__declspec_deprecated=__attribute__((deprecated))' '-D' '__declspec_dllimport=__attribute__((dllimport))' '-D' '__declspec_dllexport=__attribute__((dllexport))' '-D' '__declspec_naked=__attribute__((naked))' '-D' '__declspec_noinline=__attribute__((noinline))' '-D' '__declspec_noreturn=__attribute__((noreturn))' '-D' '__declspec_nothrow=__attribute__((nothrow))' '-D' '__declspec_novtable=__attribute__(())' '-D' '__declspec_selectany=__attribute__((weak))' '-D' '__declspec_thread=__thread' '-D' '__int8=char' '-D' '__int16=short' '-D' '__int32=int' '-D' '__int64=long' '-D' '__WINE__' '-c' '-o' 'test-E3mHxL.o' '-v' '-isystem' '/usr/include' '-isystem' '/usr/include/wine/windows' '-mtune=generic' '-march=x86-64'
 /usr/libexec/gcc/x86_64-redhat-linux/8/cc1 -quiet -v -D WINE_UNICODE_NATIVE -D _REENTRANT -D WIN64 -D _WIN64 -D __WIN64 -D __WIN64__ -D WIN32 -D _WIN32 -D __WIN32 -D __WIN32__ -D __WINNT -D __WINNT__ -D __stdcall=__attribute__((ms_abi)) -D __cdecl=__attribute__((ms_abi)) -D _stdcall=__attribute__((ms_abi)) -D _cdecl=__attribute__((ms_abi)) -D __fastcall=__attribute__((ms_abi)) -D _fastcall=__attribute__((ms_abi)) -D __declspec(x)=__declspec_##x -D __declspec_align(x)=__attribute__((aligned(x))) -D __declspec_allocate(x)=__attribute__((section(x))) -D __declspec_deprecated=__attribute__((deprecated)) -D __declspec_dllimport=__attribute__((dllimport)) -D __declspec_dllexport=__attribute__((dllexport)) -D __declspec_naked=__attribute__((naked)) -D __declspec_noinline=__attribute__((noinline)) -D __declspec_noreturn=__attribute__((noreturn)) -D __declspec_nothrow=__attribute__((nothrow)) -D __declspec_novtable=__attribute__(()) -D __declspec_selectany=__attribute__((weak)) -D __declspec_thread=__thread -D __int8=char -D __int16=short -D __int32=int -D __int64=long -D __WINE__ -isystem /usr/include -isystem /usr/include/wine/windows /tmp/test.c -quiet -dumpbase test.c -m64 -mtune=generic -march=x86-64 -auxbase-strip test-E3mHxL.o -version -fshort-wchar -fPIC -o /tmp/ccO7QfWk.s
GNU C17 (GCC) version 8.2.1 20181215 (Red Hat 8.2.1-6) (x86_64-redhat-linux)
	compiled by GNU C version 8.2.1 20181215 (Red Hat 8.2.1-6), GMP version 6.1.2, MPFR version 3.1.6-p2, MPC version 1.0.2, isl version isl-0.16.1-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/8/include-fixed"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/8/../../../../x86_64-redhat-linux/include"
ignoring duplicate directory "/usr/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include
 /usr/include/wine/windows
 /usr/lib/gcc/x86_64-redhat-linux/8/include
 /usr/local/include
End of search list.
GNU C17 (GCC) version 8.2.1 20181215 (Red Hat 8.2.1-6) (x86_64-redhat-linux)
	compiled by GNU C version 8.2.1 20181215 (Red Hat 8.2.1-6), GMP version 6.1.2, MPFR version 3.1.6-p2, MPC version 1.0.2, isl version isl-0.16.1-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 20541af5d31e647ac01a32c3ed0407f7
COLLECT_GCC_OPTIONS='-m64' '-fshort-wchar' '-D' 'WINE_UNICODE_NATIVE' '-D' '_REENTRANT' '-fPIC' '-D' 'WIN64' '-D' '_WIN64' '-D' '__WIN64' '-D' '__WIN64__' '-D' 'WIN32' '-D' '_WIN32' '-D' '__WIN32' '-D' '__WIN32__' '-D' '__WINNT' '-D' '__WINNT__' '-D' '__stdcall=__attribute__((ms_abi))' '-D' '__cdecl=__attribute__((ms_abi))' '-D' '_stdcall=__attribute__((ms_abi))' '-D' '_cdecl=__attribute__((ms_abi))' '-D' '__fastcall=__attribute__((ms_abi))' '-D' '_fastcall=__attribute__((ms_abi))' '-D' '__declspec(x)=__declspec_##x' '-D' '__declspec_align(x)=__attribute__((aligned(x)))' '-D' '__declspec_allocate(x)=__attribute__((section(x)))' '-D' '__declspec_deprecated=__attribute__((deprecated))' '-D' '__declspec_dllimport=__attribute__((dllimport))' '-D' '__declspec_dllexport=__attribute__((dllexport))' '-D' '__declspec_naked=__attribute__((naked))' '-D' '__declspec_noinline=__attribute__((noinline))' '-D' '__declspec_noreturn=__attribute__((noreturn))' '-D' '__declspec_nothrow=__attribute__((nothrow))' '-D' '__declspec_novtable=__attribute__(())' '-D' '__declspec_selectany=__attribute__((weak))' '-D' '__declspec_thread=__thread' '-D' '__int8=char' '-D' '__int16=short' '-D' '__int32=int' '-D' '__int64=long' '-D' '__WINE__' '-c' '-o' 'test-E3mHxL.o' '-v' '-isystem' '/usr/include' '-isystem' '/usr/include/wine/windows' '-mtune=generic' '-march=x86-64'
 as -v --64 -o test-E3mHxL.o /tmp/ccO7QfWk.s
GNU assembler version 2.29.1 (x86_64-redhat-linux) using BFD version version 2.29.1-23.fc28
COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/8/:/usr/libexec/gcc/x86_64-redhat-linux/8/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/8/:/usr/lib/gcc/x86_64-redhat-linux/
LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/8/:/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/8/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-m64' '-fshort-wchar' '-D' 'WINE_UNICODE_NATIVE' '-D' '_REENTRANT' '-fPIC' '-D' 'WIN64' '-D' '_WIN64' '-D' '__WIN64' '-D' '__WIN64__' '-D' 'WIN32' '-D' '_WIN32' '-D' '__WIN32' '-D' '__WIN32__' '-D' '__WINNT' '-D' '__WINNT__' '-D' '__stdcall=__attribute__((ms_abi))' '-D' '__cdecl=__attribute__((ms_abi))' '-D' '_stdcall=__attribute__((ms_abi))' '-D' '_cdecl=__attribute__((ms_abi))' '-D' '__fastcall=__attribute__((ms_abi))' '-D' '_fastcall=__attribute__((ms_abi))' '-D' '__declspec(x)=__declspec_##x' '-D' '__declspec_align(x)=__attribute__((aligned(x)))' '-D' '__declspec_allocate(x)=__attribute__((section(x)))' '-D' '__declspec_deprecated=__attribute__((deprecated))' '-D' '__declspec_dllimport=__attribute__((dllimport))' '-D' '__declspec_dllexport=__attribute__((dllexport))' '-D' '__declspec_naked=__attribute__((naked))' '-D' '__declspec_noinline=__attribute__((noinline))' '-D' '__declspec_noreturn=__attribute__((noreturn))' '-D' '__declspec_nothrow=__attribute__((nothrow))' '-D' '__declspec_novtable=__attribute__(())' '-D' '__declspec_selectany=__attribute__((weak))' '-D' '__declspec_thread=__thread' '-D' '__int8=char' '-D' '__int16=short' '-D' '__int32=int' '-D' '__int64=long' '-D' '__WINE__' '-c' '-o' 'test-E3mHxL.o' '-v' '-isystem' '/usr/include' '-isystem' '/usr/include/wine/windows' '-mtune=generic' '-march=x86-64'
winebuild -v -fno-asynchronous-unwind-tables --cc-cmd=gcc -m64 --ld-cmd=ld -D_REENTRANT -fPIC --exe -o a.out-2Fs6co.spec.o -F a.out --subsystem console -L/usr/lib64/wine -L/usr/lib64 -- test-E3mHxL.o /usr/lib64/wine/libadvapi32.def /usr/lib64/wine/libuser32.def /usr/lib64/wine/libwinecrt0.a /usr/lib64/wine/libkernel32.def /usr/lib64/wine/libntdll.def 
gcc -m64 -xassembler -c -o a.GONbu1.o a.s9kP6o.s
ld -r -o a.MHTnSG.o a.GONbu1.o test-E3mHxL.o /usr/lib64/wine/libwinecrt0.a
gcc -m64 -xassembler -c -o a.out-2Fs6co.spec.o a.yu9DJM.s
Creating file try_link-yeoE43.c
gcc -m64 -o try_link-8QOVVJ.out -fPIC -shared -Wl,-Bsymbolic -Wl,-z,defs -Wl,-init,__wine_spec_init,-fini,_wine_spec_fini try_link-yeoE43.c 
Creating file try_link-ULHFg7.c
gcc -m64 -shared -Wl,-Bsymbolic -Wl,-z,defs -Wl,-init,__wine_spec_init,-fini,__wine_spec_fini -o a.out.so -o try_link-WigYJO.out -Wl,-z,max-page-size=0x1000 try_link-ULHFg7.c 
gcc -m64 -shared -Wl,-Bsymbolic -Wl,-z,defs -Wl,-init,__wine_spec_init,-fini,__wine_spec_fini -o a.out.so -Wl,-z,max-page-size=0x1000 -L/usr/lib64/wine -L/usr/lib64 a.out-2Fs6co.spec.o test-E3mHxL.o /usr/lib64/wine/libwinecrt0.a -lwine -lm -lc 
Creating file a.out

from nine.

Venemo avatar Venemo commented on June 5, 2024

You can of course combine nine with pba, esync or whatever. (erm, looking at PBA, while you can combine it with nine, PBA improves wined3d, so it doesn't help nine at all)

PBA gives a huge performance boost to some games (especially Blizzard titles) because it improves the way memory is allocated by Wine's default D3D9 implementation, so it basically doubles the frame rates for me as compared to the vanilla wined3d.

AFAIK the author came up with the PBA patch after profiling what happens in WoW. He just didn't ever bother to upstream his patch or bring it up to the quality that is required for upstreaming it.

Are you sure nine is enabled or working? All checkboxes in the gui should be checked and upon running a game you'd get Native Direct3D 9 v0.1.0.120 is active.

Yes, I'm pretty sure it's enabled and working. All checkboxes are checked in ninewinecfg.

All I'm saying is that it produces frame rates which are roughly in the same ballpark as wined3d with the PBA patch, which is roughly double what vanilla wined3d can do. I think this is pretty good.

To give you some context, I'm playing Starcraft 2 in 4K on an RX 570 on medium-high settings. This is completely unplayable on vanilla wined3d, and pretty good with either Nine or PBA. (Athough still somewhat less than what I would get in windows on the same machine.)

I don't really think anybody really profiled what is going on in wine when you play in 4K, and honestly I can't blame anyone for that, since it probably only affects a small fraction of the user base. (As it happens I'm not really a gamer, but just a programmer who sometimes plays some old games on his development machine. If I were a serious gamer I would most definitely just stick to 1080p.)

Sorry for the long comment!

from nine.

dhewg avatar dhewg commented on June 5, 2024

Thanks for the paste, and it looks like it's a Fedora packaging issue. I filed a bug report here

I'm on 4k too, which is a little too much for my gpu. You might be interested in this, which brought me to valve's "fullscreen hack". With that, I can set games to e.g. 1080p fullscreen, and the hack upscales that to 4k. I guess that you would get higher frames rates on such a setup with nine than with pba.

from nine.

Venemo avatar Venemo commented on June 5, 2024

Thanks, I'll take a look at that hack.

The same setup can run SC2 on higher settings with 60+ fps on windows. On the PBA wined3d I get between 40-60 fps depending on what's happening in the game, and on nine I get around 40 fps, but this is more consistent (ie. has fewer drops) than PBA.

One interesting tidbit, though may be a bit off-topic in here, but I took a look at SC2 with perf top, and these are the top lines:

  17,39%  d3dadapter9.so.1.0.0     [.] si_set_constant_buffer                                                                                                                                                       ◆
   4,03%  perf-10843.map           [.] 0x00000001404697b5                                                                                                                                                           ▒
   2,46%  d3dadapter9.so.1.0.0     [.] amdgpu_do_add_real_buffer                                                                                                                                                    ▒
   2,33%  d3dadapter9.so.1.0.0     [.] NineDevice9_SetIndices                                                                                                                                                       ▒
   1,71%  d3dadapter9.so.1.0.0     [.] amdgpu_cs_add_buffer                                                                                                                                                         ▒
   0,93%  dsound.dll.so            [.] 0x00000000000297ca                                                                                                                                                           ▒
   0,90%  perf-10843.map           [.] 0x00000001404697a3                                                                                                                                                           ▒
   0,85%  libc-2.27.so             [.] __memmove_avx_unaligned_erms                                                                                                                                                 ▒
   0,68%  perf-10843.map           [.] 0x0000000141591658                                                                                                                                                           ▒
   0,61%  d3dadapter9.so.1.0.0     [.] NineDevice9_SetStreamSource                                                                                                                                                  ▒
   0,57%  dsound.dll.so            [.] 0x0000000000029731                                                                                                                                                           ▒
   0,56%  perf-10843.map           [.] 0x0000000141680afd                                                                                                                                                           ▒
   0,52%  perf-10843.map           [.] 0x000000014165f616                                                                                                                                                           ▒
   0,47%  d3dadapter9.so.1.0.0     [.] NineDevice9_SetVertexShader                                                                                                                                                  ▒
   0,46%  d3dadapter9.so.1.0.0     [.] amdgpu_add_fence_dependencies_bo_list                                                                                                                                        ▒
   0,42%  d3dadapter9.so.1.0.0     [.] amdgpu_lookup_buffer                                                                                                                                                         ▒
   0,40%  libc-2.27.so             [.] __memcmp_avx2_movbe                                                                                                                                                          ▒
   0,34%  dsound.dll.so            [.] 0x00000000000297c1                                                                                                                                                           ▒
   0,33%  perf-10843.map           [.] 0x0000000141680afa                                                                                                                                                           ▒
   0,31%  d3dadapter9.so.1.0.0     [.] nine_update_state                                      

Taking a brief look at si_set_constant_buffer I have no clue why it may be the slowest part. I also haven't a clue why perf thinks it's in d3dadapter.so when I believe it should be in the radeonsi library? Other than that I have no idea what the rest of the CPU is doing, all the lines below this are less than 0.3%. Or maybe I'm using perf wrong, this is the first time I tried it.

from nine.

axeldavy avatar axeldavy commented on June 5, 2024

We already implement something like the pba patches in gallium nine.

HAve you checked the gpu is not used 100% ?
Find the exact name with GALLIUM_HUD=help glxgears
and then it's going to be something like GALLIUM_HUD=fps,cpu0+cpu1+cpu2+cpu3,GPU-usage wine blabla.exe
replace GPU-usage with the correct name.

from nine.

Venemo avatar Venemo commented on June 5, 2024

@axeldavy Thanks, it didn't occour to me to use GALLIUM_HUD but it's a good idea. What I did check thus far is the power consumption of the GPU which is about 50%, so I'm pretty sure the GPU is not the bottleneck here. SC2 is known to be a CPU-bound game.

Thinking about what I saw in perf a bit more, I think Nine does some sort of copy (either in system RAM, or between system RAM and video RAM) which doesn't have a noticable overhead at lower resolutions, but starts to be a bottleneck at 4K. This is just a guess though.

Any guidance is much appreciated in figuring out what's going on.

from nine.

dhewg avatar dhewg commented on June 5, 2024

You can try to set these for nine:

export thread_submit=true
export tearfree_discard=true

That helps on my setup. Less stutter, more fps.

from nine.

Venemo avatar Venemo commented on June 5, 2024

Thanks @axeldavy and @dhewg

I tried running it like this now:

GALLIUM_HUD=GPU-load+cpu,shader-clock+memory-clock+temperature tearfree_discard=true thread_submit=true mesa_glthread=true WINEDEBUG=-all WINEPREFIX=/home/Timur/.wineSC2 wine ~/.wineSC2/drive_c/Program\ Files\ \(x86\)/StarCraft\ II/Support64/SC2Switcher_x64.exe

What I see that the GPU load is about 40-50% (depending on how high I set the graphics), and CPU load is between 20-30%, and I'm still getting low frame rates (around 40-45 fps), though the two suggested environment variables did improve it slightly.

EDIT: I tried setting the system resolution to 1080p, but still not getting any significantly better frame rates.

Here's what perf top says:

  19,63%  [kernel]                [k] amdgpu_mm_rreg
   9,78%  d3dadapter9.so.1.0.0    [.] si_set_constant_buffer
   1,31%  d3dadapter9.so.1.0.0    [.] NineDevice9_SetIndices
   1,06%  dsound.dll.so           [.] 0x000000000002a5ea
   0,95%  perf-10216.map          [.] 0x00000001404697a3
   0,93%  libc-2.28.so            [.] __memmove_avx_unaligned_erms
   0,85%  d3dadapter9.so.1.0.0    [.] amdgpu_do_add_real_buffer
   0,62%  d3dadapter9.so.1.0.0    [.] amdgpu_cs_add_buffer
   0,59%  dsound.dll.so           [.] 0x000000000002a551
   0,57%  perf-10216.map          [.] 0x00000001404697b5
   0,56%  d3dadapter9.so.1.0.0    [.] NineDevice9_SetStreamSource

from nine.

dhewg avatar dhewg commented on June 5, 2024

What unit is your 20-30% cpu load in? Overall (all cores=100%) or like top, where 100% equals full load on one core? The latter would indicate that the game isn't properly threaded and you're still cpu limited. Try another game, most of the time the fps improves notably with nine.

Worth trying might be vblank_mode=0 and/or disabling wm compositing.

from nine.

Venemo avatar Venemo commented on June 5, 2024

@dhewg Not sure what unit, this is what GALLIUM_HUD shows. Not sure how to disable WM compositing on Gnome 3, but I guess I'll try another DE, just to make sure it isn't Gnome's fault.

In any case, I suggest we close this issue, since the actual build problem is dealt with. I'll try to investigate the performance problem some more and will open another issue to discuss it.

from nine.

dhewg avatar dhewg commented on June 5, 2024

Sounds good. Report general issues (as in: not specific for this standalone version) here.

from nine.

axeldavy avatar axeldavy commented on June 5, 2024

Could you open the issue somewhere else to discuss it ?

from nine.

axeldavy avatar axeldavy commented on June 5, 2024

I checked the buffer access patterns, and what the game hits should be the best possible path (persistent buffers which we keep mapped).

On the first campain, after the videos, I get about 140 fps on full hd, everything maxed out on my radeon rx 480. The GPU load is about 90%. My 4 cpu threads are all around 60-70%..
I used GALLIUM_HUD=GPU-load,fps,cpu0+cpu1+cpu2+cpu3,shader-clock+memory-clock+temperature tearfree_discard=true WINEDEBUG=-all

I didn't use thread_submit=true, the game was hanging on launch, I have to fix that.
I use a debug build, so the overhead is higher than in a normal build.

Thus my results don't reproduce yours...

from nine.

iiv3 avatar iiv3 commented on June 5, 2024

@Venemo, do you compile your own kernel? If so, you might have some additional tracing enabled.

If not...
Could you try to disable "iommu=off", in case you are hitting some "soft" emulation that involves page faults.

If this doesn't help either, try entering the "amdgpu_mm_rreg" in perf top and see which instructions are getting most heat.

from nine.

Venemo avatar Venemo commented on June 5, 2024

@axeldavy @iiv3 I opened this issue according to the suggestion from @dhewg - iXit/Mesa-3D#333 where I responded to your comments here and also added some more details about my hardware setup.

from nine.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.