Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
06815 Crash/Freeze Major Always Jan 1, 2018, 18:56 Feb 1, 2023, 19:45
Tester Firewave View Status Public Platform MAME (Self-compiled)
Assigned To Resolution Open OS Linux (64-bit)
Status [?] Acknowledged Driver
Version 0.193 Fixed in Version Build 64-bit
Fixed in Git Commit Github Pull Request #
Summary 06815: -video bgfx hangs on Linux
Description Using "-video bgfx" causes MAME/BGFX/llvmpipe to consume a lot of CPU and the UI is unresponsive. All other -video modes (soft, accel, opengl) are working flawlessly. I am using ubuntu 16.04.3 LTS 64-bit.
Steps To Reproduce
Additional Information
  2935 root      20   0  753096 227560 102168 S 12.6  8.2   0:02.10 llvmpipe-7
  2929 root      20   0  753096 227560 102168 S 12.3  8.2   0:01.80 llvmpipe-1
  2931 root      20   0  753096 227560 102168 S 12.3  8.2   0:01.90 llvmpipe-3
  2932 root      20   0  753096 227560 102168 S 12.3  8.2   0:01.94 llvmpipe-4
  2933 root      20   0  753096 227560 102168 S 12.3  8.2   0:01.92 llvmpipe-5
  2930 root      20   0  753096 227560 102168 S 11.6  8.2   0:01.96 llvmpipe-2
  2928 root      20   0  753096 227560 102168 S 11.3  8.2   0:01.71 llvmpipe-0
  2934 root      20   0  753096 227560 102168 S 11.0  8.2   0:01.81 llvmpipe-6
  2876 root      19  -1  309584  40568  24672 S  6.6  1.5   0:01.24 Xorg
  2936 root      20   0  753096 227560 102168 S  6.6  8.2   0:03.44 mame64_
  2927 root      20   0  753096 227560 102168 S  2.3  8.2   0:01.12 mame64_

[Switching to thread 1 (Thread 0x7fd2bf2ce900 (LWP 2927))]
#0  0x00007fd2be52ac1d in nanosleep () at ../sysdeps/unix/syscall-template.S:84
#1  0x000000000598f5d1 in osd_sleep(unsigned long) ()
#2  0x00000000054a2cb8 in video_manager::throttle_until_ticks(unsigned long) ()
#3  0x000000000549f534 in video_manager::update_throttle(attotime) ()
#4  0x000000000549e80d in video_manager::frame_update(bool) ()
#5  0x000000000542c721 in running_machine::run(bool) ()
#6  0x00000000039fb44d in mame_machine_manager::execute() ()
#7  0x0000000003a67eb8 in cli_frontend::start_execution(mame_machine_manager*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) ()
#8  0x0000000003a68ddc in cli_frontend::execute(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&) ()
#9  0x00000000039fbf2c in emulator_info::start_frontend(emu_options&, osd_interface&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&) ()
#10 0x0000000003952e0f in main ()

[Switching to thread 10 (Thread 0x7fd2a578f700 (LWP 2936))]
#0  pthread_cond_timedwait@@GLIBC_2.3.2 ()
    at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:225
#1  0x00000000059870f4 in bx::Semaphore::wait(int) ()
#2  0x00000000059324d5 in bgfx::Context::renderFrame(int) ()
#3  0x00000000059323e1 in bgfx::renderFrame(int) ()
#4  0x000000000593fdaa in bgfx::Context::renderThread(bx::Thread*, void*) ()
#5  0x000000000598a57f in bx::ThreadInternal::threadFunc(void*) ()
#6  0x00007fd2be5216ba in start_thread (arg=0x7fd2a578f700)
    at pthread_create.c:333
#7  0x00007fd2bb86d3dd in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

[Switching to thread 2 (Thread 0x7fd2ad40a700 (LWP 2928))]
#0  pthread_cond_wait@@GLIBC_2.3.2 ()
    at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007fd2b191b7f3 in ?? ()
   from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#2  0x00007fd2b191b657 in ?? ()
   from /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
#3  0x00007fd2be5216ba in start_thread (arg=0x7fd2ad40a700)
    at pthread_create.c:333
#4  0x00007fd2bb86d3dd in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
Github Commit
Flags
Regression Version
Affected Sets / Systems
Attached Files
 
Relationships
There are no relationship linked to this issue.
Notes
3
User avatar
No.14602
Firewave
Senior Tester
Jan 2, 2018, 19:29
Using GALLIUM_DRIVER to change doesn't really give any better results.

softpipe - the thread in /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so consumes all the CPU of the system, but UI is barely responsive just not completely frozen.

swrast - doesn't work at all
libGL error: failed to create dri screen
libGL error: failed to load driver: swrast
User avatar
No.14607
Firewave
Senior Tester
Jan 3, 2018, 09:42
I tried glxgears with softpipe and llvmpipe and it is working fine - although softpipe is about 10x slower. So it appears to be something MAME or bgfx does.

Also unrelated to the bgfx issue after closing MAME I am no longer able to use the shell session I started MAME in - keyboard entries won't register.
User avatar
No.21057
cuavas
Administrator
Feb 1, 2023, 19:45
Is this still relevant? BGFX seems to work OK on Linux for me now.