Created attachment 200742 [details] Output of the games I tried to run some Linux games with my AMD Radeon RX560 but they are all failing. I tried games/linux-doom3 and the Linux Version of Unreal. Both run fine with NVIDA Hardware and the proprietary driver but with the AMD Hardware the screen goes black and then there are some messages on the console. I have tried with linux-c6 and linux-c7 ports. Perhaps the errors come from the linux-mesa stuff because NVIDIA installs its own OpenGL stuff then this PR should go tho the maintainer of the emulators/linux_base ports. In the attachements are the outputs of linux-doom3 with linux_base-c6 and with linux-c7 Also at the End of the file there is the output from Unreal on linux_base-c6 and linux_base-c7 Interesting is that linux-c6 tries to load the amdgpu_dri.so while linux-c7 tries to load radeonsi_dri.so.
If I recall correctly, we've seen this issue and there may be a fix for it. Could you open an issue with 'upstream' (as this is not a problem with the port but the DRM itself)? Here: https://github.com/FreeBSDDesktop/kms-drm . Thank you!
Assign to committer (maintainer) that resolved
You could just use games/dhewm3. It's an open source reimplementation of Doom 3's engine with fixes for some issues that are not in the proprietary port.
I know, dhewm runs fine with AMD Radeon. I reported this because there are (OpenGL-)Problems with Linux Programs. linux-doom3 was just an Example. (I have the Original DVD to test the game). linux-quake4 is'nt working too. As suggested above i will report an issue upstream.
Make sure you have linprocfs and linsysfs mounted. Also try running with "env LIBGL_DRI3_DISABLE=true linux-doom3". If linux-c6 tries to load amdgpu_dri.so it's probably too old for your graphics card and you'll have to use linux-c7.
Can you try again with the latest c7 ports?
(In reply to Tijl Coosemans from comment #6) Same problem with the latest c7 port. I think it has nothing to do with the linux compatibility because when i run the game with the intel driver from drm-kmod it runs fine on the onboard graphics chip.
I've just committed a change to graphics/linux-c7-glx-utils so it also installs glxinfo32 on amd64. Can you install the updated port and then attach the output of both /compat/linux/usr/bin/glxinfo32 and /compat/linux/usr/bin/glxinfo64 to this bug?
Created attachment 205110 [details] Output from /compat/linux/usr/bin/glxinfo32
Created attachment 205111 [details] Output from /compat/linux/usr/bin/glxinfo64
Thanks, both seem to load radeonsi_dri.so fine now. Does Unreal still fail to load radeonsi_dri.so?
Yes it does. Processors / Cores 8 Forcing CPU affinity disabled. libGL error: unable to load driver: radeonsi_dri.so libGL error: driver pointer missing libGL error: failed to load driver: radeonsi libGL error: unable to load driver: radeonsi_dri.so libGL error: driver pointer missing libGL error: failed to load driver: radeonsi libGL error: unable to load driver: swrast_dri.so libGL error: failed to load driver: swrast X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 155 (GLX) Minor opcode of failed request: 3 (X_GLXCreateContext) Value in failed request: 0x0 Serial number of failed request: 41 Current serial number in output stream: 42
I also tried /compat/linux/usr/bin/glxgears (is this 64bit?) from c7 and it fails with a Segfault.
Can you run Unreal through ktrace like this: ktrace -i -f /path/to/ktrace.out /path/to/command kdump -H -f /path/to/ktrace.out > /path/to/ktrace.txt Then attach ktrace.txt. You'll probably have to compress it using xz or something. Same for /compat/linux/usr/bin/glxgears (which is indeed 64-bit).
Created attachment 205129 [details] kdump of /compat/linux/usr/bin/glxgears Here is the dump from glxgears. The dump from unreal is too big. The compressed file has 17.4MB Should i cut off the beginning of the file?
Created attachment 205137 [details] kdump of UnrealXLinux.bin Ok, here are the last lines of the kdump from unreal. I hope it helps.
For glxgears PRIME_HANDLE_TO_FD ioctl returns EINVAL for some reason. Maybe x11@ knows more about that. Unreal seems to fail to load dependencies of /compat/linux/lib/libLLVM-6.0-rhel.so. The directory that contains Unreal, does that contain any libraries? What is the output of "find -s /path/to/unrealdir -name '*.so*'"? What is the output of "/compat/linux/bin/sh ldd /path/to/UnrealXLinux.bin"?
The libraries are in the "System" subfolder where also the UnrealXLinux.bin is. % find -s Unreal/System -name '*.so*' Unreal/System/ALAudio.so Unreal/System/Audio.so Unreal/System/Core.so Unreal/System/Editor.so Unreal/System/Emitter.so Unreal/System/Engine.so Unreal/System/Fire.so Unreal/System/FMODAudioDrv.so Unreal/System/IpDrv.so Unreal/System/libalut.so.0 Unreal/System/libalut.so.0.1 Unreal/System/libalut.so.0.1.0 Unreal/System/libfmod-3.75.so Unreal/System/libfmod.so Unreal/System/libgcc_s.so Unreal/System/libgcc_s.so.1 Unreal/System/libmikmod.so Unreal/System/libmikmod.so.2 Unreal/System/libmikmod.so.2.0.4 Unreal/System/libmudflap.so Unreal/System/libmudflap.so.0 Unreal/System/libmudflap.so.0.0.0 Unreal/System/libmudflapth.so Unreal/System/libmudflapth.so.0 Unreal/System/libmudflapth.so.0.0.0 Unreal/System/libopenal.so Unreal/System/libopenal.so.1 Unreal/System/libopenal.so.1.12.854 Unreal/System/libSDL-1.2.so Unreal/System/libSDL-1.2.so.0 Unreal/System/libSDL-1.2.so.0.11.2 Unreal/System/libssp.so Unreal/System/libssp.so.0 Unreal/System/libssp.so.0.0.0 Unreal/System/libstdc++.so Unreal/System/libstdc++.so.6 Unreal/System/libstdc++.so.6.0.8 Unreal/System/libXxf86dga.so Unreal/System/libXxf86dga.so.1 Unreal/System/libXxf86dga.so.1.0.0 Unreal/System/NullDrv.so Unreal/System/NullNetDriver.so Unreal/System/NullRender.so Unreal/System/OpenGLDrv.so Unreal/System/Render.so Unreal/System/SDLDrv.so Unreal/System/SDLGLDrv.so Unreal/System/SDLSoftDrv.so Unreal/System/SwFMOD.so Unreal/System/UEnginePPC.so Unreal/System/XDrv.so Unreal/System/XMesaGLDrv.so % ldd Unreal/System/UnrealXLinux.bin linux32_vdso.so.1 => (0xffffe000) Core.so => ./Core.so (0x21200000) Engine.so => ./Engine.so (0x21a00000) libXxf86dga.so.1 => ./libXxf86dga.so.1 (0x21024000) libstdc++.so.6 => ./libstdc++.so.6 (0x2102c000) libm.so.6 => /lib/libm.so.6 (0x21125000) libgcc_s.so.1 => ./libgcc_s.so.1 (0x21167000) libc.so.6 => /lib/libc.so.6 (0x21d51000) libX11.so.6 => /lib/libX11.so.6 (0x2189b000) librt.so.1 => /lib/librt.so.1 (0x21173000) libpthread.so.0 => /lib/libpthread.so.0 (0x2117d000) libdl.so.2 => /lib/libdl.so.2 (0x21198000) libXext.so.6 => /lib/libXext.so.6 (0x2119d000) /lib/ld-linux.so.2 (0x01001000) libxcb.so.1 => /lib/libxcb.so.1 (0x211b0000) libXau.so.6 => /lib/libXau.so.6 (0x211db000)
The PRIME_HANDLE_TO_FD ioctl failing for Xwayland is solved in Xorg 1.20. Hopefully this is the same and will also be fixed by 1.20. There are three solutions 1) Wait for Xorg 1.20 2) Build your own x11-servers/xorg-server from https://github.com/FreeBSDDesktop/freebsd-ports/tree/feature/xserver-1.20 (I think it's OK to only build this package and install it over the old one). 3) Patch the drm driver by removing DRM_AUTH from the two lines where PRIME_HANDLE_TO_FD and it's reverse ioctls are defined. See https://github.com/FreeBSDDesktop/kms-drm/issues/33
I will try to merge the xorg-server port into my poudriere ports tree and build that port. This will take some time.
Try deleting (or renaming) these: Unreal/System/libgcc_s.so Unreal/System/libgcc_s.so.1 Unreal/System/libstdc++.so Unreal/System/libstdc++.so.6 Unreal/System/libstdc++.so.6.0.8 Unreal/System/libXxf86dga.so Unreal/System/libXxf86dga.so.1 Unreal/System/libXxf86dga.so.1.0.0 These are probably older versions of the ones in /compat/linux/usr/lib.
So now i'm on xorg-server-1.20.4,1 but the errors are still the same. /compat/linux/usr/bin/glxgears => Segmentation fault linux-doom3 => Segmentation fault Unreal is still not working too an when i remove the suggested libraries it ends wit a Segmentation fault.
(In reply to Stefan Rumetshofer from comment #22) I take it this is with LIBGL_DRI3_DISABLE=1?
(In reply to Johannes Lundberg from comment #23) Shit, i forgot to set the variable after i restarted Xorg. glxgears and Unreal are running now.