Bug 229832 - emulators/rpcs3: graphics don't display; program hangs if output window closed
Summary: emulators/rpcs3: graphics don't display; program hangs if output window closed
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Jan Beich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-17 13:48 UTC by Steven Wilson
Modified: 2021-03-18 14:16 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (jbeich)


Attachments
RPCS3 log (197.73 KB, application/gzip)
2018-07-17 13:48 UTC, Steven Wilson
no flags Details
apitrace with Ivy Bridge, no override (94.67 KB, application/gzip)
2018-07-19 03:37 UTC, Steven Wilson
no flags Details
apitrace with Ivy Bridge; 4.3/430 override (94.78 KB, application/gzip)
2018-07-19 03:38 UTC, Steven Wilson
no flags Details
RPCS3 log with Ivy Bridge, no override (21.47 KB, application/gzip)
2018-07-19 03:39 UTC, Steven Wilson
no flags Details
RPCS3 log with Ivy Bridge; 4.3/430 override (21.81 KB, application/gzip)
2018-07-19 03:39 UTC, Steven Wilson
no flags Details
RPCS3.log i7-4790k + HD 5770 with mesa overrides (138.87 KB, text/plain)
2018-08-11 17:40 UTC, Franc[e]sco
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Wilson 2018-07-17 13:48:51 UTC
Created attachment 195196 [details]
RPCS3 log

OS: FreeBSD 11.2-RELEASE
port versions: 0.0.5.631, 0.0.5.644 (from packages)
CPU: Intel Core i7-3770K
GPU: NVIDIA GeForce GTX 970
nvidia-driver version: 390.67 (from ports, due to PR#228536)
DE: KDE Plasma 5

When I launch a game in RPCS3 (attempted with both an allegedly-playable disc game and a simple homebrew "Breakout" .pkg), the OpenGL output window opens, but never renders anything. The contents of the window are just whatever was on-screen in that location when the window opened. If I close the output window rather than clicking the "Stop" button in the main window, the program hangs. I've tried multiple settings for the various recompiler vs. interpreter options; the behavior is identical with every combination I tried.

I tried truss to see if it was stuck on something obvious, but I suspect I need some kind of filtering option because syscalls continually occur regardless of apparent activity.
Comment 1 Jan Beich freebsd_committer freebsd_triage 2018-07-18 05:40:46 UTC
> Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz | 8 Threads | 15.85 GiB RAM | AVX

i7-3770K is IvyBridge, so also try integrated GPU via drm-stable-kmod + mesa-dri.

> -{rsx::thread} RSX: Failed to set swap interval
> -{rsx::thread} RSX: GL RENDERER: Mesa DRI Intel(R) HD Graphics 530 (Skylake GT2)  (Intel Open Source Technology Center)
> -{rsx::thread} RSX: GL VERSION: 4.5 (Core Profile) Mesa 18.1.2
> -{rsx::thread} RSX: GLSL VERSION: 4.50
> +{rsx::thread} RSX: GL RENDERER: GeForce GTX 970/PCIe/SSE2 (NVIDIA Corporation)
> +{rsx::thread} RSX: GL VERSION: 4.3.0 NVIDIA 390.67
> +{rsx::thread} RSX: GLSL VERSION: 4.30 NVIDIA via Cg compiler
>  {rsx::thread} RSX: Supported texel buffer size reported: 134217728 bytes
> [...]
> +{rsx::thread} Thread time: 0.923251s (0.000000Gc); Faults: 0 [rsx:0, spu:0];
> +Stopping emulator...

Looks like it hangs before loading shaders. Probably a nvidia-driver issue. Try other versions (e.g., 384.130, 396.24) or play with various driver options (see /usr/local/share/doc/NVIDIA_GLX-1.0/README)

I'll try to reproduce on my old Kepler card after replacing HDMI cable. For that your Xorg.0.log and apitrace dump (compress with xz -9) maybe useful.

>  {PPU[0x1000000] Thread (main_thread) [0x002b0c0c]} sys_rsx: sys_rsx_context_attribute(context_id=0x55555555, package_id=0x10a, a3=0x0, a4=0x0, a5=0x80000000, a6=0x0)
>  {PPU[0x1000000] Thread (main_thread) [0x002b1b40]} sys_rsx: sys_rsx_context_attribute(context_id=0x55555555, package_id=0x10a, a3=0x1, a4=0x0, a5=0x80000000, a6=0x0)
> -{rsx::thread} RSX: NV3089_IMAGE_IN_SIZE: Invalid blit dimensions passed
> -{PPU[0x1000000] Thread (main_thread) [0x002b270c]} sys_rsx: sys_rsx_context_attribute(context_id=0x55555555, package_id=0x300, a3=0x0, a4=0x0, a5=0x0, a6=0x0)
> -{PPU[0x1000000] Thread (main_thread) [0x002b270c]} sys_rsx: sys_rsx_context_attribute(context_id=0x55555555, package_id=0x300, a3=0x1, a4=0x0, a5=0x0, a6=0x0)
> -{PPU[0x1000000] Thread (main_thread) [0x002b270c]} sys_rsx: sys_rsx_context_attribute(context_id=0x55555555, package_id=0x300, a3=0x2, a4=0x0, a5=0x0, a6=0x0)
> -{PPU[0x1000000] Thread (main_thread) [0x002b270c]} sys_rsx: sys_rsx_context_attribute(context_id=0x55555555, package_id=0x300, a3=0x3, a4=0x0, a5=0x0, a6=0x0)
> -{PPU[0x1000000] Thread (main_thread) [0x002b270c]} sys_rsx: sys_rsx_context_attribute(context_id=0x55555555, package_id=0x300, a3=0x4, a4=0x0, a5=0x0, a6=0x0)
> -{PPU[0x1000000] Thread (main_thread) [0x002b270c]} sys_rsx: sys_rsx_context_attribute(context_id=0x55555555, package_id=0x300, a3=0x5, a4=0x0, a5=0x0, a6=0x0)
> -{PPU[0x1000000] Thread (main_thread) [0x002b270c]} sys_rsx: sys_rsx_context_attribute(context_id=0x55555555, package_id=0x300, a3=0x6, a4=0x0, a5=0x0, a6=0x0)
> -{PPU[0x1000000] Thread (main_thread) [0x002b270c]} sys_rsx: sys_rsx_context_attribute(context_id=0x55555555, package_id=0x300, a3=0x7, a4=0x0, a5=0x0, a6=0x0)
> -{PPU[0x1000000] Thread (main_thread) [0x002b270c]} sys_rsx: sys_rsx_context_attribute(context_id=0x55555555, package_id=0x300, a3=0x8, a4=0x0, a5=0x0, a6=0x0)
> -{PPU[0x1000000] Thread (main_thread) [0x002b270c]} sys_rsx: sys_rsx_context_attribute(context_id=0x55555555, package_id=0x300, a3=0x9, a4=0x0, a5=0x0, a6=0x0)
> -{PPU[0x1000000] Thread (main_thread) [0x002b270c]} sys_rsx: sys_rsx_context_attribute(context_id=0x55555555, package_id=0x300, a3=0xa, a4=0x0, a5=0x0, a6=0x0)
> -{PPU[0x1000000] Thread (main_thread) [0x002b270c]} sys_rsx: sys_rsx_context_attribute(context_id=0x55555555, package_id=0x300, a3=0xb, a4=0x0, a5=0x0, a6=0x0)
> -{PPU[0x1000000] Thread (main_thread) [0x002b270c]} sys_rsx: sys_rsx_context_attribute(context_id=0x55555555, package_id=0x300, a3=0xc, a4=0x0, a5=0x0, a6=0x0)
> -{PPU[0x1000000] Thread (main_thread) [0x002b270c]} sys_rsx: sys_rsx_context_attribute(context_id=0x55555555, package_id=0x300, a3=0xd, a4=0x0, a5=0x0, a6=0x0)
> -{PPU[0x1000000] Thread (main_thread) [0x002b270c]} sys_rsx: sys_rsx_context_attribute(context_id=0x55555555, package_id=0x300, a3=0xe, a4=0x0, a5=0x0, a6=0x0)
> -{PPU[0x1000000] Thread (main_thread) [0x002b2968]} sys_rsx: sys_rsx_context_attribute(context_id=0x55555555, package_id=0x300, a3=0x0, a4=0x1000100e60000, a5=0x2800601cc001, a6=0x0)
> -{PPU[0x1000000] Thread (main_thread) [0x002b2968]} sys_rsx: sys_rsx_context_attribute(context_id=0x55555555, package_id=0x300, a3=0x0, a4=0x1000101cc0000, a5=0x280060398001, a6=0x0)
> -{PPU[0x1000000] Thread (main_thread) [0x002b2968]} sys_rsx: sys_rsx_context_attribute(context_id=0x55555555, package_id=0x300, a3=0x1, a4=0x1cd000102080000, a5=0x14005c4101cd, a6=0x0)
> -{PPU[0x1000000] Thread (main_thread) [0x002b2968]} sys_rsx: sys_rsx_context_attribute(context_id=0x55555555, package_id=0x300, a3=0x1, a4=0x1cd000102440000, a5=0x14005c4881cd, a6=0x0)
> -{PPU[0x1000000] Thread (main_thread) [0x002b2968]} sys_rsx: sys_rsx_context_attribute(context_id=0x55555555, package_id=0x300, a3=0x2, a4=0xdba00310e9f0000, a5=0x280070654245, a6=0x0)
> -{PPU[0x1000000] Thread (main_thread) [0x002b2cd0]} sys_rsx: sys_rsx_context_attribute(context_id=0x55555555, package_id=0x301, a3=0x0, a4=0x52105000300, a5=0x10000dba0000, a6=0xff80100400202000)
> -{PPU[0x1000000] Thread (main_thread) [0x00105b44]} sys_semaphore: sys_semaphore_create(sem_id=*0x10042f6c, attr=*0xd0010810, initial_val=1, max_val=2)
> -{PPU[0x1000000] Thread (main_thread) [0x00105b48]} cellSysutil TODO: cellVideoOutConfigure(videoOut=0, config=*0xd0010700, option=*0x0, waitForEvent=0)
> -{PPU[0x1000000] Thread (main_thread) [0x002b1c44]} sys_rsx: sys_rsx_attribute(packageId=0x2, a2=0x1, a3=0x1, a4=0x0, a5=0x0)
> -{PPU[0x1000000] Thread (main_thread) [0x002b1c6c]} sys_rsx: sys_rsx_context_attribute(context_id=0x55555555, package_id=0x101, a3=0x1, a4=0x1, a5=0x0, a6=0x0)
> -{PPU[0x1000000] Thread (main_thread) [0x002b1e88]} sys_rsx: sys_rsx_context_attribute(context_id=0x55555555, package_id=0x104, a3=0x0, a4=0x500000002d0, a5=0x140001cd0000, a6=0x0)
> -{PPU[0x1000000] Thread (main_thread) [0x002b1e88]} sys_rsx: sys_rsx_context_attribute(context_id=0x55555555, package_id=0x104, a3=0x1, a4=0x500000002d0, a5=0x140002090000, a6=0x0)
> -{PPU[0x1000000] Thread (main_thread) [0x00092788]} sys_mutex: sys_mutex_create(mutex_id=*0x20115770, attr=*0xd00106e8)
> -{PPU[0x1000000] Thread (main_thread) [0x00092958]} sys_cond: sys_cond_create(cond_id=*0x20115780, mutex_id=0x85004400, attr=*0xd00106f8)
> -{PPU[0x1000000] Thread (main_thread) [0x001ebcd4]} sys_tty: sys_tty_write(ch=0, buf=*0x20100100, len=64, pwritelen=*0xd0010600)
> -{PPU[0x1000000] Thread (main_thread) [0x001eb9a8]} sys_fs: sys_fs_open(path=“/host_root/c:/usr/local/cell/sample_data/graphics//shaders.bin”, flags=0, fd=*0xd00106a0, mode=0, arg=*0x0, size=0x0)
> -{PPU[0x1000000] Thread (main_thread) [0x001eb9a8]} vfs::get(): device not found: /host_root/c:/usr/local/cell/sample_data/graphics//shaders.bin
> -{PPU[0x1000000] Thread (main_thread) [0x001eb9a8]} 'sys_fs_open' failed with 0x8001003a : CELL_ENOTMOUNTED, “/host_root/c:/usr/local/cell/sample_data/graphics//shaders.bin” [1]
> -{PPU[0x1000000] Thread (main_thread) [0x001ebcd4]} sys_tty: sys_tty_write(ch=0, buf=*0x20100100, len=95, pwritelen=*0xd0010470)
> -{PPU[0x1000000] Thread (main_thread) [0x001ebcd4]} sys_tty: sys_tty_write(ch=0, buf=*0x20100100, len=34, pwritelen=*0xd000fd40)
> -{PPU[0x1000000] Thread (main_thread) [0x00105bf8]} sys_io: cellPadInit(max_connect=2)
> -{PPU[0x1000000] Thread (main_thread) [0x001833e0]} sys_mutex: sys_mutex_create(mutex_id=*0x10043878, attr=*0xd00109b8)
> -{PPU[0x1000000] Thread (main_thread) [0x00247788]} sys_memory: sys_memory_allocate(size=0x20000, flags=0x200, alloc_addr=*0xd00108f0)
> -{PPU[0x1000000] Thread (main_thread) [0x00244f74]} sys_lwmutex: _sys_lwmutex_create(lwmutex_id=*0xd0010740, protocol=0x2, control=*0x200901c8, arg4=0x80000001, name=0x5f6c763268656100, arg6=0x0)
> -{PPU[0x1000000] Thread (main_thread) [0x001ebcd4]} sys_tty: sys_tty_write(ch=0, buf=*0x20100100, len=58, pwritelen=*0xd0010560)
> -{RSX Decompiler Thread} RSX: VP not found in buffer!
> -{rsx::thread} RSX: Found font file '/home/steven/.config/rpcs3/dev_flash/data/font/SCE-PS3-VR-R-LATIN.TTF' as a replacement for 'Arial'
> -{RSX Decompiler Thread} RSX: FP not found in buffer!
> -{rsx::thread} RSX: Add program (vp id = 10, fp id = 11)
> -{RSX Decompiler Thread} RSX: *** prog id = 12
> -{RSX Decompiler Thread} RSX: *** vp id = 10
> -{RSX Decompiler Thread} RSX: *** fp id = 11
> -{RSX Decompiler Thread} RSX: *** vp shader = 
> -#version 430
> -layout(std140, binding = 0) uniform VertexContextBuffer
Comment 2 Steven Wilson 2018-07-19 03:37:59 UTC
Created attachment 195267 [details]
apitrace with Ivy Bridge, no override
Comment 3 Steven Wilson 2018-07-19 03:38:35 UTC
Created attachment 195268 [details]
apitrace with Ivy Bridge; 4.3/430 override
Comment 4 Steven Wilson 2018-07-19 03:39:13 UTC
Created attachment 195269 [details]
RPCS3 log with Ivy Bridge, no override
Comment 5 Steven Wilson 2018-07-19 03:39:41 UTC
Created attachment 195270 [details]
RPCS3 log with Ivy Bridge; 4.3/430 override
Comment 6 Steven Wilson 2018-07-19 03:41:25 UTC
I tried with drm-stable-kmod and Mesa, but I suspect I've somehow messed something up. It's only reporting support for OpenGL 3.3 and GLSL 330, when several sources suggest that I should be getting at least 4.2/420 with this combination of hardware and Mesa version (and RPCS3 apparently requires 4.3/430; I saw an RPCS3 error specifically about this initially, but don't see it now, and I have no idea why it isn't showing now).

Apparent behavior is similar, but I get a more obvious error in the log:

F 0:00:05.219316 {rsx::thread} N2gl4glsl14link_exceptionE thrown: linkage failed: 'error: vertex shader lacks `main'

Stopping emulation at this point occasionally triggers a hang or segfault.

If I set MESA_GL_VERSION_OVERRIDE=4.30 and MESA_GLSL_VERSION_OVERRIDE=430, I don't see any obvious error in the logs, but the renderer thread still seemingly exits very quickly and there are no apparent changes to the overall behavior.

I've attached an apitrace file and RPCS3 log for each of these conditions.
Comment 7 Franc[e]sco 2018-08-11 17:38:20 UTC
I am observing the exact same behaviour with both the latest git version of the emulator and the one in FreeBSD repos.

I'm running with the radeon driver on a hd 5770 and i7-4790k

OpenGL renderer string: AMD JUNIPER (DRM 2.29.0 / 11.2-RELEASE, LLVM 6.0.1)

I have to use env MESA_GL_VERSION_OVERRIDE=4.3 MESA_GLSL_VERSION_OVERRIDE=430 because gl info strings only report around version 3.3, but glxinfo shows that I have all the required ogl extensions for rpcs3:

 % glxinfo | grep buffer_storage
...
    GL_ARB_buffer_storage, GL_ARB_clear_buffer_object, GL_ARB_clear_texture, 
    GL_ARB_blend_func_extended, GL_ARB_buffer_storage,


% glxinfo | grep uniform_buffer_object
...
    GL_ARB_uniform_buffer_object, GL_ARB_vertex_array_bgra, 
    GL_ARB_uniform_buffer_object, GL_ARB_vertex_array_bgra,

% glxinfo | grep 420pack
...
    GL_ARB_shader_texture_lod, GL_ARB_shading_language_420pack, 
    GL_ARB_shading_language_100, GL_ARB_shading_language_420pack,

% glxinfo | grep explicit_uniform
...
    GL_ARB_explicit_uniform_location, GL_ARB_fragment_coord_conventions, 
    GL_ARB_explicit_attrib_location, GL_ARB_explicit_uniform_location,

I'll attach  my RPCS3.log for attempting to run the triangle example elf
Comment 8 Franc[e]sco 2018-08-11 17:40:54 UTC
Created attachment 196101 [details]
RPCS3.log i7-4790k + HD 5770 with mesa overrides
Comment 9 Franc[e]sco 2018-08-11 18:32:30 UTC
also if i run with MESA_DEBUG=1 I get

Mesa: User error: GL_INVALID_VALUE in glTexStorage2D(width, height or depth < 1)

followed by repeated "function is no-op"
Comment 10 Daniel Engberg freebsd_committer freebsd_triage 2020-03-20 08:53:15 UTC
Is still an issue? Can someone confirm?