Assertion failed when starting build


on ubuntu 22.04 i executed game cooker. Preview in editor works.

When i try to execute the built executable it yields:

"Assertion failed, GPUSwapChainVulkan.cpp, Line:209

Expression: surfaceFormatsCount > 0"

The card is nvidia MX150

What can i do?

It looks like Vulkan API vkGetPhysicalDeviceSurfaceFormatsKHR returns invalid amount of presentable surface formats. I suspect it’s old video driver. Could you run Debug build of Flax Editor and attach log file? Also, updating GPU driver to NVIDIA Proprietary might help (eg. version 520).

Hello mafiesto4, thank you for your help.

nvidia-smi yields:

| NVIDIA-SMI 525.78.01 Driver Version: 525.78.01 CUDA Version: 12.0 |
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
| 0 NVIDIA GeForce … Off | 00000000:01:00.0 Off | N/A |
| N/A 62C P0 N/A / N/A | 945MiB / 4096MiB | 55% Default |
| | | N/A |

| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
| 0 N/A N/A 1342 G /usr/lib/xorg/Xorg 467MiB |
| 0 N/A N/A 3468 G xfwm4 1MiB |
| 0 N/A N/A 6322 G …777929671656322754,131072 197MiB |
| 0 N/A N/A 92089 G /usr/bin/evolution 1MiB |
| 0 N/A N/A 110883 C+G ./FlaxEditor 274MiB |

lspci yields:

01:00.0 3D controller: NVIDIA Corporation GP108M [GeForce MX150] (rev a1)

The editor is not really the problem, it works well. Problem arises when i try to execute a FlaxGame binary created from the editor with Game Cooker.

I built FlaxGame in Debug mode from a Debug executable of the editor, but i cant see a log file from FlaxGame and there is no output on the console. Same when i execute the BasicTemplate next to it.

Is there a way to get a log file from a binary?

You can run built game with -log commandline to print the log to the console. More info: Command line access | Flax Documentation

Thank you, i used the -std flag, i think that is what you meant. One of the lines it yielded was:

[ 00:00:00.333 ]: [Info] Graphics Device created! Adapter: ‘Intel(R) UHD Graphics 620 (KBL GT2)’, Renderer: Vulkan, Shader Profile: Vulkan SM5, Feature Level: SM5

So it chose the intel gpu in my laptop. That is interesting, because i set to always use the nvidia gpu via prime command line and also in the “Nvidia X Server Settings”.

Running it with the “-nvidia” flag like so: “./BasicTemplate -nvidia” instantly solved the problem and it started without any problems.