FLAMEGPU/FLAMEGPU2-visualiser

Problem with visualization after update to Fedora 40

Closed this issue · 9 comments

Hi,
after a system update (now I'm using Fedora 40), the visualization component of FLAMEGPU2 does not work anymore. It opens a black window that crash after one second with an sdt::exception. In the video below you can see this behaviour. This is probably related to some libraries, but I'm not an expert of these ones.

Do you have any idea of what happened? Without the visualization it works correctly.

Thank you very much for your help!

Screencast.from.2024-05-22.18-11-41.webm

That doesn't tell us much. Are you able to run a debug build via gdb to catch it's backtrace?

Here you can find the coredump

coredump.txt

This doesn't really provide any useful information, if you can reproduce it with a debug build (-DCMAKE_BUILD_TYPE=Debug) it should hopefully give more detail (especially if that's within gdb).

                Stack trace of thread 236287:
                #0  0x00007ffff77af144 __pthread_kill_implementation (libc.so.6 + 0x98144)
                #1  0x00007ffff775765e raise (libc.so.6 + 0x4065e)
                #2  0x00007ffff773f902 abort (libc.so.6 + 0x28902)
                #3  0x00007fffed2a5d99 _ZN9__gnu_cxx27__verbose_terminate_handlerEv.cold (libstdc++.so.6 + 0xa5d99)
                #4  0x00007fffed2b7b7c _ZN10__cxxabiv111__terminateEPFvvE (libstdc++.so.6 + 0xb7b7c)
                #5  0x00007fffed2a5941 _ZSt9terminatev (libstdc++.so.6 + 0xa5941)
                #6  0x00007fffed2b7e08 __cxa_throw (libstdc++.so.6 + 0xb7e08)
                #7  0x000000000062ee5a n/a (/home/dbaccega/Desktop/PhD/FLAMEGPU2-F4F/build/bin/Release/FLAMEGPUABM + 0x22ee5a)

Just realised we have a small section in the docs explaining how to gdb (you can use gdb in place of cuda-gdb as it doesn't appear to be a CUDA device issue.)

https://docs.flamegpu.com/guide/debugging-models/using-a-debugger.html#id1

Ok, so an OpenGL error GL_INVALID_OPERATION is occurring here.

glGenTextures() is a pretty core OpenGL function though, so it's possibly something uncaught from earlier.

My best guess would be that your graphics driver doesn't support CUDA OpenGL interoperability. This could be a case that you're using the Nouveau (open source) driver rather than Nvidia's proprietary driver? A quick google suggests after updates it's necessary to reinstall the proprietary driver.

I'm no expert on this topic, @ptheywood knows alot more than me about Linux.

I think that there is a problem in my PC. The output of lspci |grep -E "VGA|3D" is:

0000:00:02.0 VGA compatible controller: Intel Corporation Raptor Lake-P [Iris Xe Graphics] (rev 04)
0000:01:00.0 3D controller: NVIDIA Corporation AD107M [GeForce RTX 4060 Max-Q / Mobile] (rev a1)

And the output of glxinfo | grep 'renderer string' is:
OpenGL renderer string: Mesa Intel(R) Graphics (RPL-P)

I'm trying to understand how to solve this

The visualisation needs to be rendered by the nvidia GPU not the intel GPU for the FLAME GPU visualisation to work, as the agent data is resident on the nvidia GPU.

Your laptop is often referred to as "Optimus" for searching for how to resolve this.
You can run individual programs on the nvidia gpu with some commands when set up (prime-run is the officially supported method IIRC, but it has been a long time since I've had an optimus laptop).
Or you can configure the laptop to always use the nvidia GPU, but this will significantly harm battery life, so you probably want to look into prime-run.

This appears to be documentation for how to use prime on fedora, although I'm not sure how correct it is.

https://rpmfusion.org/Howto/Optimus

I reinstalled the Nvidia's proprietary driver and cuda and now it works

Thank you!