Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vulkan assertion since updating glslang from 1.3.224 to 1.3.231 #10965

Closed
q3cpma opened this issue Dec 4, 2022 · 8 comments
Closed

Vulkan assertion since updating glslang from 1.3.224 to 1.3.231 #10965

q3cpma opened this issue Dec 4, 2022 · 8 comments
Labels

Comments

@q3cpma
Copy link

q3cpma commented Dec 4, 2022

Important Information

Provide following Information:

Reproduction steps

Update glslang from 1.3.224-r1 to 1.3.231-r2 and

$ mpv mpv --no-config --vo=gpu --gpu-api=vulkan my.mkv

Expected behavior

No problem.

Actual behavior

$ mpv --no-config --gpu-api=vulkan my.mkv
 (+) Video --vid=1 (*) 'ENCODED BY DARKDREAM' (h264 1280x720 23.976fps)
 (+) Audio --aid=1 --alang=eng (*) 'English' (aac 6ch 48000Hz)
     Audio --aid=2 --alang=jpn 'Japanese' (aac 2ch 48000Hz)
 (+) Subs  --sid=1 --slang=eng (*) 'English (Translation Only)' (ass)
     Subs  --sid=2 --slang=eng 'English' (ass)
AO: [alsa] 44100Hz stereo 2ch float
VO: [gpu] 1280x720 yuv420p
mpv: /var/tmp/portage/dev-util/glslang-1.3.231-r2/work/glslang-sdk-1.3.231.0/SPIRV/SpvBuilder.cpp:1075: spv::Id spv::Builder::createDebugGlobalVariable(spv::Id, const char*, spv::Id): Assertion `type != 0' failed.
zsh: IOT instruction (core dumped)  mpv --no-config --gpu-api=vulkan

Downgrading glslang fixes it.

Log file

http://0x0.st/okYN.txt

@q3cpma q3cpma added the os:linux label Dec 4, 2022
@q3cpma
Copy link
Author

q3cpma commented Dec 4, 2022

Tried downgrading libplacebo to 5.229.1 too, to no avail.

@q3cpma
Copy link
Author

q3cpma commented Dec 4, 2022

@q3cpma
Copy link
Author

q3cpma commented Dec 4, 2022

Here's the gdb backtrace:

Thread 11 "mpv/vo" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffde7fc6c0 (LWP 25562)]
__pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
44	      return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0;
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007ffff58e901f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#2  0x00007ffff589bb62 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007ffff5886471 in __GI_abort () at abort.c:79
#4  0x00007ffff5886395 in __assert_fail_base (fmt=0x7ffff59f6880 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x7ffff19a57a9 "type != 0", 
    file=0x7ffff19a5960 "/var/tmp/portage/dev-util/glslang-1.3.231-r2/work/glslang-sdk-1.3.231.0/SPIRV/SpvBuilder.cpp", line=1075, function=<optimized out>)
    at assert.c:92
#5  0x00007ffff5894b12 in __GI___assert_fail (assertion=0x7ffff19a57a9 "type != 0", 
    file=0x7ffff19a5960 "/var/tmp/portage/dev-util/glslang-1.3.231-r2/work/glslang-sdk-1.3.231.0/SPIRV/SpvBuilder.cpp", line=1075, 
    function=0x7ffff19a60e8 "spv::Id spv::Builder::createDebugGlobalVariable(spv::Id, const char*, spv::Id)") at assert.c:101
#6  0x00007ffff17cc434 in spv::Builder::createDebugGlobalVariable (this=this@entry=0x7fffde7f70a8, type=0, name=name@entry=0x7ffff19a135e "", 
    variable=variable@entry=33) at /usr/src/debug/dev-util/glslang-1.3.231-r2/glslang-sdk-1.3.231.0/SPIRV/SpvBuilder.cpp:1075
#7  0x00007ffff17d2699 in spv::Builder::createVariable (this=0x7fffde7f70a8, precision=precision@entry=spv::DecorationMax, 
    storageClass=storageClass@entry=spv::StorageClassOutput, type=<optimized out>, type@entry=31, name=name@entry=0x7ffff19a135e "", initializer=0, 
    compilerGenerated=false) at /usr/src/debug/dev-util/glslang-1.3.231-r2/glslang-sdk-1.3.231.0/SPIRV/SpvBuilder.cpp:2249
#8  0x00007ffff179f56b in (anonymous namespace)::TGlslangToSpvTraverser::createSpvVariable (forcedType=<optimized out>, node=0x7fffc9210c70, 
    this=0x7fffde7f7040) at /usr/src/debug/dev-util/glslang-1.3.231-r2/glslang-sdk-1.3.231.0/SPIRV/GlslangToSpv.cpp:4070
#9  (anonymous namespace)::TGlslangToSpvTraverser::getSymbolId (this=this@entry=0x7fffde7f7040, symbol=symbol@entry=0x7fffc9210c70)
    at /usr/src/debug/dev-util/glslang-1.3.231-r2/glslang-sdk-1.3.231.0/SPIRV/GlslangToSpv.cpp:8890
#10 0x00007ffff17a15a9 in (anonymous namespace)::TGlslangToSpvTraverser::visitSymbol (this=0x7fffde7f7040, symbol=0x7fffc9210c70)
    at /usr/src/debug/dev-util/glslang-1.3.231-r2/glslang-sdk-1.3.231.0/SPIRV/GlslangToSpv.cpp:2001
#11 0x00007ffff1795e67 in (anonymous namespace)::TGlslangToSpvTraverser::visitBinary (this=0x7fffde7f7040, node=0x7fffc9210e70)
    at /usr/src/debug/dev-util/glslang-1.3.231-r2/glslang-sdk-1.3.231.0/SPIRV/GlslangToSpv.cpp:2171
#12 0x00007ffff18f801a in glslang::TIntermBinary::traverse (this=0x7fffc9210e70, it=0x7fffde7f7040)
    at /usr/src/debug/dev-util/glslang-1.3.231-r2/glslang-sdk-1.3.231.0/glslang/MachineIndependent/IntermTraverse.cpp:92
#13 0x00007ffff1796b76 in (anonymous namespace)::TGlslangToSpvTraverser::visitBinary (this=0x7fffde7f7040, node=0x7fffc92117e0)
    at /usr/src/debug/dev-util/glslang-1.3.231-r2/glslang-sdk-1.3.231.0/SPIRV/GlslangToSpv.cpp:2130
#14 0x00007ffff18f801a in glslang::TIntermBinary::traverse (this=0x7fffc92117e0, it=0x7fffde7f7040)
    at /usr/src/debug/dev-util/glslang-1.3.231-r2/glslang-sdk-1.3.231.0/glslang/MachineIndependent/IntermTraverse.cpp:92
#15 0x00007ffff18f88c5 in glslang::TIntermAggregate::traverse (this=0x7fffc92118b0, it=0x7fffde7f7040)
    at /usr/src/debug/dev-util/glslang-1.3.231-r2/glslang-sdk-1.3.231.0/glslang/MachineIndependent/IntermTraverse.cpp:175
#16 0x00007ffff18f88c5 in glslang::TIntermAggregate::traverse (this=0x7fffc9212600, it=0x7fffde7f7040)
    at /usr/src/debug/dev-util/glslang-1.3.231-r2/glslang-sdk-1.3.231.0/glslang/MachineIndependent/IntermTraverse.cpp:175
#17 0x00007ffff17a8b4f in (anonymous namespace)::TGlslangToSpvTraverser::visitFunctions (glslFunctions=..., this=0x7fffde7f7040)
    at /usr/src/debug/dev-util/glslang-1.3.231-r2/glslang-sdk-1.3.231.0/SPIRV/GlslangToSpv.cpp:5240
#18 (anonymous namespace)::TGlslangToSpvTraverser::visitAggregate (this=0x7fffde7f7040, visit=<optimized out>, node=<optimized out>)
    at /usr/src/debug/dev-util/glslang-1.3.231-r2/glslang-sdk-1.3.231.0/SPIRV/GlslangToSpv.cpp:2822
#19 0x00007ffff18f89aa in glslang::TIntermAggregate::traverse (this=0x7fffc92127c0, it=0x7fffde7f7040)
    at /usr/src/debug/dev-util/glslang-1.3.231-r2/glslang-sdk-1.3.231.0/glslang/MachineIndependent/IntermTraverse.cpp:159
#20 0x00007ffff17ab786 in glslang::GlslangToSpv (intermediate=..., spirv=std::vector of length 0, capacity 0, logger=logger@entry=0x7fffde7f7dc0, 
    options=<optimized out>) at /usr/src/debug/dev-util/glslang-1.3.231-r2/glslang-sdk-1.3.231.0/SPIRV/GlslangToSpv.cpp:9619
#21 0x00007ffff17acc62 in glslang::GlslangToSpv (intermediate=..., spirv=..., options=<optimized out>)
    at /usr/src/debug/dev-util/glslang-1.3.231-r2/glslang-sdk-1.3.231.0/SPIRV/GlslangToSpv.cpp:9601
#22 0x00007ffff5cdf518 in shaderc_util::Compiler::Compile(shaderc_util::string_piece const&, EShLanguage, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const*, std::function<EShLanguage (std::ostream*, shaderc_util::string_piece const&)> const&, shaderc_util::CountingIncluder&, shaderc_util::Compiler::OutputType, std::ostream*, unsigned long*, unsigned long*) const () from /usr/lib64/libshaderc_shared.so.1
#23 0x00007ffff5cd6808 in (anonymous namespace)::CompileToSpecifiedOutputType(shaderc_compiler*, char const*, unsigned long, shaderc_shader_kind, char const*, char const*, shaderc_compile_options*, shaderc_util::Compiler::OutputType) () from /usr/lib64/libshaderc_shared.so.1
#24 0x00007ffff5cd716f in shaderc_compile_into_spv () from /usr/lib64/libshaderc_shared.so.1
#25 0x00007ffff5d46202 in shaderc_compile (spirv=0x7fffc85a3bd0, alloc=0x7fffc8283ab0, glsl=0x7fffc85a3618, stage=GLSL_SHADER_VERTEX, 
    shader=0x7fffc828da50 "#version 450\n#define tex1D texture\n#define tex3D texture\n#define LUT_POS(x, lut_size) mix(0.5 / (lut_size), 1.0 - 0.5 / (lut_size), (x))\nlayout(location=0) in vec2 vertex_position;\nlayout(location=1) "...) at ../libplacebo-v5.229.1/src/glsl/spirv_shaderc.c:104
#26 0x00007ffff5d6b167 in vk_compile_glsl (out_spirv=<synthetic pointer>, 
    shader=0x7fffc828da50 "#version 450\n#define tex1D texture\n#define tex3D texture\n#define LUT_POS(x, lut_size) mix(0.5 / (lut_size), 1.0 - 0.5 / (lut_size), (x))\nlayout(location=0) in vec2 vertex_position;\nlayout(location=1) "..., stage=GLSL_SHADER_VERTEX, alloc=0x7fffc8283ab0, gpu=0x7fffc85a3610)
    at ../libplacebo-v5.229.1/src/vulkan/gpu_pass.c:167
#27 vk_pass_create (gpu=0x7fffc85a3610, params=0x7fffde7f9540) at ../libplacebo-v5.229.1/src/vulkan/gpu_pass.c:515
#28 0x00007ffff5d11e86 in pl_pass_create (gpu=gpu@entry=0x7fffc85a3610, params=params@entry=0x7fffde7f9540) at ../libplacebo-v5.229.1/src/gpu.c:1485
#29 0x00005555556c1e21 in renderpass_create_pl (ra=0x7fffc85bb850, params=0x7fffde7f9760) at ../mpv-0.35.0/video/out/placebo/ra_pl.c:558
#30 0x0000555555680daa in create_pass (entry=0x7fffc8278150, sc=0x7fffc85eaba0) at ../mpv-0.35.0/video/out/gpu/shader_cache.c:638
#31 gl_sc_generate (sc=0x7fffc85eaba0, type=<optimized out>, target_format=0x7fffc835f4a0, vao=0x7fffc828b940, vao_len=<optimized out>, vertex_stride=32)
    at ../mpv-0.35.0/video/out/gpu/shader_cache.c:958
#32 0x0000555555682fc9 in gl_sc_dispatch_draw (sc=0x7fffc85eaba0, target=target@entry=0x7fffc82646b8, discard=discard@entry=false, vao=<optimized out>, 
    vao_len=vao_len@entry=4, vertex_stride=32, vertices=0x7fffc80031b0, num_vertices=6) at ../mpv-0.35.0/video/out/gpu/shader_cache.c:995
#33 0x000055555568bd3e in render_pass_quad (dst=0x7fffc86300e0, discard=false, fbo=..., p=0x7fffc862f670) at ../mpv-0.35.0/video/out/gpu/video.c:1280
#34 finish_pass_fbo (p=p@entry=0x7fffc862f670, fbo=..., discard=discard@entry=false, dst=dst@entry=0x7fffc86300e0)
    at ../mpv-0.35.0/video/out/gpu/video.c:1288
#35 0x000055555568d762 in pass_draw_to_screen (p=p@entry=0x7fffc862f670, fbo=...) at ../mpv-0.35.0/video/out/gpu/video.c:3095
#36 0x0000555555691fdf in gl_video_render_frame (p=0x7fffc862f670, frame=frame@entry=0x7fffc83779c0, fbo=..., flags=flags@entry=3)
    at ../mpv-0.35.0/video/out/gpu/video.c:3376
#37 0x000055555569a4d9 in draw_frame (vo=0x5555558a3d50, frame=0x7fffc83779c0) at ../mpv-0.35.0/video/out/vo_gpu.c:85
#38 0x000055555569977f in render_frame (vo=0x5555558a3d50) at ../mpv-0.35.0/video/out/vo.c:965
#39 vo_thread (ptr=0x5555558a3d50) at ../mpv-0.35.0/video/out/vo.c:1103
#40 0x00007ffff58e737a in start_thread (arg=<optimized out>) at pthread_create.c:442
#41 0x00007ffff596822c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Link to bt full output: http://0x0.st/okIL.txt

@jeeb
Copy link
Member

jeeb commented Dec 4, 2022

Alright, so it is going from top to bottom:

  • mpv
  • libplacebo
  • shaderc
  • glslang

Quite the mix, esp. with the last two. So libplacebo is calling shaderc, and then shaderc is calling glslang internally. I would also just recommend rebuilding both shaderc and glslang just in case, in case one of those projects did some API/ABI breakage and the update only rebuilt one of those two.

@jeeb
Copy link
Member

jeeb commented Dec 4, 2022

Also you can see where the area of mpv/libplacebo ends in

#25 0x00007ffff5d46202 in shaderc_compile (spirv=0x7fffc85a3bd0, alloc=0x7fffc8283ab0, glsl=0x7fffc85a3618, stage=GLSL_SHADER_VERTEX,
    shader=0x7fffc828da50 "#version 450\n#define tex1D texture\n#define tex3D texture\n#define LUT_POS(x, lut_size) mix(0.5 / (lut_size), 1.0 - 0.5 / (lut_size), (x))\nlayout(location=0) in vec2 vertex_position;\nlayout(location=1) "...) at ../libplacebo-v5.229.1/src/glsl/spirv_shaderc.c:104

which then calls shaderc_compile_into_spv (https://code.videolan.org/videolan/libplacebo/-/blob/7ead30db8aa75db28236eee40899f0ff6e3c9688/src/glsl/spirv_shaderc.c#L103-105)

After that it's all shaderc/glslang, and I'm definitely not sure if there's any relevant variables being passed on directly.

@q3cpma
Copy link
Author

q3cpma commented Dec 4, 2022 via email

@ionenwks
Copy link
Contributor

ionenwks commented Dec 4, 2022

There was a mistake in the stabilization process in Gentoo, shaderc-2022.2 was never supposed to be used with that glslang version.

I think there's nothing to do here.

@jeeb
Copy link
Member

jeeb commented Dec 4, 2022

Alright, great. Closing.

@jeeb jeeb closed this as completed Dec 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants