Home Page
Hello. Since building 0.235, I find that I'm no longer able to run MAME in BGFX mode. SDL and OpenGl work fine. When I try to run with BGFX, I get:

Enter sdl_info::create
MESA-INTEL: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0

X Error of failed request: BadDrawable (invalid Pixmap or Window parameter)
Major opcode of failed request: 149 ()
Minor opcode of failed request: 4
Resource id in failed request: 0x200000e
Serial number of failed request: 423
Current serial number in output stream: 428

I should note that even if I run the sysctl command, only the warning goes away, the error remains. I have made sure that I have the latest BGFX files in the right place. I have been able to use BGFX successfully on this laptop for several versions, this is a brand new experience for me. Any ideas on what I can try? For background, I'm on Ubuntu 21.04, using nvidia-driver-470. Thank you.
The message says it's trying to use your Intel integrated GPU instead of your Nvidia discrete one. I'm not sure how to fix that.
Interesting. I double checked a few things on my system, video acceleration appears enabled in my browsers, I also ran:

~$ glxinfo
name of display: :1
display: :1 screen: 0
direct rendering: Yes
server glx vendor string: NVIDIA Corporation
server glx version string: 1.4

and "direct rendering" is a "Yes"... I'm going to rebuild to 0.234 and see if the problem persist. Thank you RB.
Can now confirm: rebuilding back to 0.234 allowed me to use BGFX mode. Will now build back to 0.235 and test.
OK, I've rebuilt MAME back to 0.235, updated the bgfx folder, and I am back to the same problem. So, 0.234 BGFX = working for me, and 0.235 BGFX = not working for me. Everything else is the same. RB, any way I can drill down deeper into this, possibly get you some debug information? Thanks.
Did you tried it from the latest mame source? BGFX got some fixes.

git clone https://github.com/mamedev/mame.git


Try it to see. For the 0.236 beta.

Some of the games screen didn't work right with the 0.235 released because of the BGFX changes. I thought maybe it did something to the Linux version to where it crash.
Hi Dullaron, any branch in particular? I just tried doing a checkout master, pulling latest, and building that, but sadly no, it does not improve the situation.
The master branch, as of cbc2489, has all of the current post-0.235 BGFX fixes.
OK, so this just got a lot more interesting: I was able to reproduce the issue on a second separate laptop. I realized I had a laptop I was using to test out the Pop! OS distro on, and I know I had MAME running just fine with BGFX on that as well. Updated that to 0.235, rebuilt, and boom: BadDrawable. The systems are similar, but not identical:

OS_____Ubuntu_______Pop! OS
GPU____GTX-1660 Ti___GTX-970M

And as before, the Pop! OS laptop can run just fine in OpenGL and SDL. Only having a problem with BGFX.

RB, I synced to commit ea3185a when I built master on the Ubuntu laptop, and still have the issue. I have just synced to fc79b73 on the Pop! OS laptop and am rebuilding now, but I suspect the results will be the same. Please advise. Thank you!
Try this one over here at https://sdlmame.wallyweek.org/ There 3 installers there.
Out of habit, I always perform a make clean before building, just to be safe. I've been burned by that a number of times. I'll give the installers a shot as soon as I'm able.
@Dullaron: Just tried the mame_0.235+dfsg.1-0ubuntu1~ppa1~hirsute1_amd64.deb installer (along with mame_data). Same problem.

@R. Belmont: Recompiled (cleanly) on both laptops from commit fc79b73. Same problem.

Happy to try more suggestions.
I popped an issue in for this in github: https://github.com/mamedev/mame/issues/8538

Edit: The issue was leaving bgfx_backend set to auto. The problem disappeared when I set it to opengl. Thanks.
Yeah don't leave it on auto. Glad you got it working again. I have it on opengl here.
Auto not working is still an issue, I assume it's picking Vulkan in that situation since those are the only two backends that work on Linux.

Do we know if there are issues on non-Linux with Vulkan so we can get it somewhere in an environment JD has a chance to repro?
The trouble is it works with Vulkan for most people on Linux. It only seems to be problematic with certain cards/drivers. The issues with AMD cards with Vulkan on Linux were solved already (post 0.135). Given that it’s so hardware- and driver-specific, I very much doubt any Windows setup is going to provide equivalent results.
Might want to put a note about this issue on the MAME website for the Linux users. If there any more issues please put a note about those too. This way people won't be going around in a circle trying to get something to work. No I'm not mad. smile
So I just double checked if Vulkan could run on my system. I just produced this image using the vkcube utility (run through mangohud): https://imgur.com/a/MZ5jVBr So I can rule out that my system is incompatible with vulkan. Yet if I intentionally set the bgfx_backend to vulkan, the crash reproduces.
Just rebuilt to MAME 0.234 to test it out. Set video to bgfx and bgfx_backend to vulkan. MAME launches and runs (mangohud confirms vulkan in use) but then the video freezes after a few seconds. Emulation continues however. I can run pacman and insert coins and press start and I hear the coin sound and the start music. There are just no video updates. Double checked to confirm: no such issues with the opengl backend, the video continues normally.
Video stopping to refresh is a known problem:
Nvidia driver 470 has issues for Geforce 600 cards. CUDA, Nvenc and g-sync issues.
Driver 465 works fine.
© Forums