All games maded with Unity engine crashes on AMD GPU, but worked on Intel GPU on same machine

All games maded with Unity engine crashes on AMD GPU, but worked on Intel GPU on same machine.

Discussion in amd-gfx mailing list

This looks like a driver crash in free/delete after mesa_glsl_link_shader.
I don’t believe that Unity is duplicating these symbols (as concluded in the freedesktop thread) - as far as I can tell, this is all in the radeonsi driver.

Valgrind doesn’t show any memory-related issue with Mesa. It does show
an issue with “New Unity Project”. This can corrupt the heap and cause
a random crash on the next call of malloc/free/new/delete:

3377545–264984–valgrind.txt (1.58 MB)

We’ll investigate, but if that were the case, wouldn’t it affect the intel driver the same way?

Marek said:

There are several factors making radeonsi more vulnerable to heap corruption:

  • radeonsi has a lot of running threads, unlike intel
  • radeonsi uses LLVM, which is a big user of new/delete to the extent of making new/delete/malloc/free a little slower for Mesa and Unity.

Closed-source drivers use their own allocator for memory allocations (usually jemalloc), so they are immune to such Unity bugs.