mesa issueshttps://gitlab.freedesktop.org/mesa/mesa/-/issues2022-11-03T09:08:11Zhttps://gitlab.freedesktop.org/mesa/mesa/-/issues/7336llvmpipe/clover failures with LLVM 132022-11-03T09:08:11ZLionel Landwerlinllvmpipe/clover failures with LLVM 13https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16970 is going to update the CI with LLVM 13 instead of LLVM 11.
This fixing some tests and triggering new failures with llvmpipe :
```
+ diff -u .gitlab-ci/piglit/llvmpipe-clove...https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16970 is going to update the CI with LLVM 13 instead of LLVM 11.
This fixing some tests and triggering new failures with llvmpipe :
```
+ diff -u .gitlab-ci/piglit/llvmpipe-clover.txt.baseline .gitlab-ci/piglit/llvmpipe-clover.txt
--- .gitlab-ci/piglit/llvmpipe-clover.txt.baseline 2022-09-23 14:45:16.392107790 +0000
+++ .gitlab-ci/piglit/llvmpipe-clover.txt 2022-09-23 14:45:16.388107697 +0000
@@ -8,16 +8,13 @@
api/cllinkprogram: skip
interop/egl_khr_cl_event2: skip
program/build/include-directories: fail
-program/build/math-intrinsics: fail
program/build/printf: skip
program/check predefined preprocessor macros/__opencl_c_version__ must be consistent with host (if defined): skip
program/check predefined preprocessor macros/__opencl_c_version__ must be defined for opencl 1.2 and later: skip
program/check predefined preprocessor macros/cl_version_1_2 must be defined for opencl 1.2 and later: skip
program/check predefined preprocessor macros/cl_version_2_0 must be defined for opencl 2.0 and later: skip
program/execute/amdgcn-callee-saved-registers: skip
-program/execute/amdgcn-f16-inline-immediates: fail
-program/execute/amdgcn-f32-inline-immediates: fail
-program/execute/amdgcn-i16-inline-immediates: fail
+program/execute/amdgcn-f32-inline-immediates/add integer 64: fail
program/execute/atomic_int64_add-global: skip
program/execute/atomic_int64_add-global-return: skip
program/execute/atomic_int64_add-local: skip
@@ -68,12 +65,14 @@
program/execute/calls-large-struct: crash
program/execute/calls-struct/regs struct: fail
program/execute/calls-struct/small struct in regs: fail
-program/execute/fdiv-modifiers-f32: fail
program/execute/global-offset/3d, input dependent: fail
program/execute/image-attributes: crash
program/execute/load-hi16-generic: skip
program/execute/load-lo16-generic: skip
-program/execute/mad-mix: fail
program/execute/program-tester-check-local-size-test-should-skip/this test should skip: skip
program/execute/scalar-logical-float: skip
program/execute/store-hi16-generic: skip
+program/execute/vload/vloada_half-float-constant: fail
+program/execute/vload/vloada_half-float-global: fail
+program/execute/vload/vloada_half-float-local: fail
+program/execute/vload/vloada_half-float-private: fail
```https://gitlab.freedesktop.org/mesa/mesa/-/issues/7331llvmpipe/lavapipe: glDispatchCompute crash in Mesa 22.22022-09-29T14:27:36Zfridenmfllvmpipe/lavapipe: glDispatchCompute crash in Mesa 22.2### System information
- OS: Windows 11
- Mesa version: 22.2
### Describe the issue
I'm launching a compute shader that reads values from three SSBOs and writes to one SSBO, but the program always crashes at glDispatchCompute and I ex...### System information
- OS: Windows 11
- Mesa version: 22.2
### Describe the issue
I'm launching a compute shader that reads values from three SSBOs and writes to one SSBO, but the program always crashes at glDispatchCompute and I expected the call to succeed as it worked in 22.1.2 and 22.2 RC2, or at least get a debug message via glDebugMessageCallback, but instead it crashes when calling glDispatchCompute. I can't attach the code from the company I work at but I've attached a screenshot of the call stack with debug symbols which hopefully narrows down the search a bit.
### Regression
The exact same program worked for 22.1.2 and 22.2 RC1.
### Log files as attachment
llvmpipe:
![mesa_22.2_llvm_compute_crash_0](/uploads/7710c6c650f53bc851741f100b4ec39f/mesa_22.2_llvm_compute_crash_0.jpg)
lavapipe:
![image](/uploads/5c2ae8a7341126f7b4086f0e85e92127/image.png)https://gitlab.freedesktop.org/mesa/mesa/-/issues/7326llvmpipe: supertuxkart unusable2022-09-27T19:48:01ZMike Blumenkrantzllvmpipe: supertuxkart unusableTrying to start a race in supertuxkart appears to be impossible with llvmpipe: It just hangs at the end of the loading screen. Tried waiting a while and nothing ever progresses.Trying to start a race in supertuxkart appears to be impossible with llvmpipe: It just hangs at the end of the loading screen. Tried waiting a while and nothing ever progresses.https://gitlab.freedesktop.org/mesa/mesa/-/issues/7286document how to running llvmpipe depq test locally2023-03-15T18:02:13ZYonggang Luodocument how to running llvmpipe depq test locally```
rm -rf artifacts
mkdir artifacts
curl -o artifacts/install.tar https://gitlab.freedesktop.org/mesa/mesa/-/jobs/28401135/artifacts/raw/artifacts/install.tar
docker run --privileged -it --rm -v $PWD:/builds/mesa/mesa/ -w /builds/mesa/...```
rm -rf artifacts
mkdir artifacts
curl -o artifacts/install.tar https://gitlab.freedesktop.org/mesa/mesa/-/jobs/28401135/artifacts/raw/artifacts/install.tar
docker run --privileged -it --rm -v $PWD:/builds/mesa/mesa/ -w /builds/mesa/mesa/ \
-e LIBGL_ALWAYS_SOFTWARE=true -e GALLIUM_DRIVER=llvmpipe \
-e FLAKES_CHANNEL=#mesa-swrast-ci \
-e GPU_VERSION=llvmpipe \
-e GALLIVM_PERF=nopt \
-e DEQP_SUITE=llvmpipe \
-e FDO_CI_CONCURRENT=64 \
-e CI_NODE_INDEX=1 \
-e CI_NODE_TOTAL=1 \
registry.freedesktop.org/mesa/mesa/debian/x86_test-gl:2022-09-14-add-jq--2022-09-12-virglrenderer--d5aa3941aa03c2f716595116354fb81eb8012acb \
bash
rm -rf install
tar -xf artifacts/install.tar
LD_LIBRARY_PATH=`pwd`/install xvfb-run --server-args='-noreset' install/deqp-runner.sh
```
Comes from https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18213#note_1555240https://gitlab.freedesktop.org/mesa/mesa/-/issues/7244llvmpipe / softpipe: GPU Caps Viewer OpenGL 1.x and 2.x 3D demos from OpenGL ...2023-03-15T17:30:45ZProdea Alexandru-Liviullvmpipe / softpipe: GPU Caps Viewer OpenGL 1.x and 2.x 3D demos from OpenGL demos group segfault with MinGW-w64 GCC debug optimized or release binariesCrash occurs only with 3D demos from OpenGL demos group. There are some OpenGL 1.x and 2.x 3D demos in GeeXLab demos group, but those run normally. As I specified in title, crashes don't reproduce with MSVC binaries and also MinGW if dis...Crash occurs only with 3D demos from OpenGL demos group. There are some OpenGL 1.x and 2.x 3D demos in GeeXLab demos group, but those run normally. As I specified in title, crashes don't reproduce with MSVC binaries and also MinGW if disabling optimizations (builtype=debug) for some reason. Linking dependencies statically or dynamically or enabling / disabling futex or even disabling LLVM usage has no effect on this issue. Even at backtrace level there are no meaningful differences.
#### Most recent commit I tested this with
````
commit 19fc870ac65845daf3c6176ecb06786acaf829e6 (HEAD -> main, origin/main, origin/HEAD)
Author: Kenneth Graunke <kenneth@whitecape.org>
Date: Tue Sep 6 17:18:16 2022 -0700
intel/compiler: Use subgroup invocation for ICP handle loads
...
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18455>
````
#### Regression
Yes, this is a long standing regression from around 21.1 cycle or even way back to 19.3 cycle. I don't remember if it was reproducible with the old Scons build. I tried bisecting it when it was fresh but other issues being in the way, notably more broad crashes and build failures that were later resolved made bisecting to a range smaller than 150-200 commits impossible.
#### Build process
- Build was done in a MSYS2 MINGW32 shell
- Update and install dependencies
````
pacman -Syu
pacman -Syu;pacman -S flex,bison,mingw-w64-i686-{cc,gdb,llvm,meson,pkgconf,python-mako,vulkan-devel,zstd} --needed --noconfirm
````
- Build with swrast only
````
/mingw32/bin/meson setup build/gcc-x86 --libdir="lib/x86" --pkgconfig.relocatable -Dzstd=enabled --backend=ninja --buildtype=debugoptimized -Db_ndebug=false --force-fallback-for= -Dcpp_rtti=true -Dllvm=enabled -Dshared-llvm=enabled --cmake-prefix-path= -Dgallium-drivers=swrast -Dvulkan-drivers= -Dgallium-d3d10umd=false -Dspirv-to-dxil=false -Dshared-glapi=enabled -Dgles1=enabled -Dgles2=enabled -Degl=enabled -Dosmesa=false -Dbuild-tests=false -Dmicrosoft-clc=disabled -Dgallium-opencl=disabled -Dc_args="-march=core2 -pipe" -Dcpp_args="-march=core2 -pipe" -Ddraw-use-llvm=true -Dmin-windows-version=7
````
- Build with swrast, zink and d3d12
````
/mingw32/bin/meson setup build/gcc-x86 --libdir="lib/x86" --pkgconfig.relocatable -Dzstd=enabled --backend=ninja --buildtype=debugoptimized -Db_ndebug=true --force-fallback-for= -Dcpp_rtti=true -Dllvm=enabled -Dshared-llvm=enabled --cmake-prefix-path= -Dgallium-drivers=swrast,zink,d3d12 -Dvulkan-drivers= -Dgallium-d3d10umd=false -Dspirv-to-dxil=true -Dshared-glapi=enabled -Dgles1=enabled -Dgles2=enabled -Degl=enabled -Dosmesa=false -Dbuild-tests=false -Dmicrosoft-clc=disabled -Dgallium-opencl=disabled -Dc_args="-march=core2 -pipe" -Dcpp_args="-march=core2 -pipe" -Ddraw-use-llvm=true -Dmin-windows-version=7
````
#### Backtraces
- Build with swrast only
````
Thread 19 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1360.0x5ec]
0x6e8c05e8 in _mesa_Lightfv@12 (light=16384, pname=4611, params=0x7a9f824) at ../../src/mesa/main/light.c:284
284 TRANSFORM_POINT(temp, ctx->ModelviewMatrixStack.Top->m, params);
(gdb) bt
#0 0x6e8c05e8 in _mesa_Lightfv@12 (light=16384, pname=4611, params=0x7a9f824)
at ../../src/mesa/main/light.c:284
#1 0x74edbdb5 in core3d!?push@o3Stack@oZone3D_nsp@@QAEXPAX@Z ()
from C:\Software\systools\GPU\GPU_Caps_Viewer\core3d.dll
#2 0x00004000 in ?? ()
#3 0x00001203 in ?? ()
#4 0x07a9f824 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
````
- Build with swrast, zink and d3d12
````
Thread 20 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 8972.0xbd4]
0x6d524e09 in _mesa_RasterPos (ctx=0x7526a70, vObj=0x737f830) at ../../src/mesa/main/rastpos.c:515
515 TRANSFORM_POINT(ctx->Current.RasterTexCoords[u],
(gdb) bt
#0 0x6d524e09 in _mesa_RasterPos (ctx=0x7526a70, vObj=0x737f830) at ../../src/mesa/main/rastpos.c:515
#1 0x6d9c6876 in st_RasterPos (ctx=<optimized out>, ctx@entry=0x7526a70, v=<optimized out>,
v@entry=0x737f830) at ../../src/mesa/state_tracker/st_cb_rasterpos.c:236
#2 0x6d935b57 in rasterpos (x=x@entry=0, y=y@entry=0, z=z@entry=0, w=w@entry=1)
at ../../src/mesa/main/rastpos.c:549
#3 0x6d525f3f in _mesa_RasterPos2f@8 (x=0, y=0) at ../../src/mesa/main/rastpos.c:562
#4 0x74e29e74 in core3d!?push@o3Stack@oZone3D_nsp@@QAEXPAX@Z ()
from C:\Software\systools\GPU\GPU_Caps_Viewer\core3d.dll
#5 0x00000000 in ?? ()
````
This backtrace is different than the one with swrast build only despite the fact that on my system swrast is default as there is no d3d12 or Vulkan hardware acceleration available.Yonggang LuoYonggang Luohttps://gitlab.freedesktop.org/mesa/mesa/-/issues/7225removing tgsi to llvm compiler2023-06-01T09:35:15ZYonggang Luoremoving tgsi to llvm compilerrationale:
anholt lygstate: as far as I know, the only blocker is that lower_int_to_float cause array indexing to be floats, which gallivm_nir can't understand. But I think we should be able to pretty easily handle that by looking at ...rationale:
anholt lygstate: as far as I know, the only blocker is that lower_int_to_float cause array indexing to be floats, which gallivm_nir can't understand. But I think we should be able to pretty easily handle that by looking at options->no_integers in the gallivm_nir frontendhttps://gitlab.freedesktop.org/mesa/mesa/-/issues/7224gnome-initial-setup crashed in llvmpipe rendering via GTK+ in Fedora GNOME 43...2022-09-20T17:32:47ZAdam Williamsongnome-initial-setup crashed in llvmpipe rendering via GTK+ in Fedora GNOME 43~rc testing### System information
- OS: Fedora 37
- GPU: qemu virtio GPU
- Kernel version: 5.19.6
- Mesa version: 22.2.0-rc3
- Xserver version (if applicable): N/A, on Wayland
- Desktop manager and compositor: GNOME 43-rc
### Describe the issue
...### System information
- OS: Fedora 37
- GPU: qemu virtio GPU
- Kernel version: 5.19.6
- Mesa version: 22.2.0-rc3
- Xserver version (if applicable): N/A, on Wayland
- Desktop manager and compositor: GNOME 43-rc
### Describe the issue
In Fedora downstream testing of [the GNOME 43-rc update](https://bodhi.fedoraproject.org/updates/FEDORA-2022-50e585b456), one [openQA test failed due to a crash in gnome-initial-setup](https://openqa.fedoraproject.org/tests/1421707). At the last green-outlined frame g-i-s is running (on first boot after system install) and the test is proceeding normally; then g-i-s crashes and the system is left stuck, just showing the desktop background and two empty black bars, and the test fails.
The backtrace is long and runs from g-i-s through GTK into mesa and llvmpipe (and hence LLVM); I initially filed [against GTK](https://gitlab.gnome.org/GNOME/gtk/-/issues/5164) but they suggested the bug is likely in llvmpipe. I can't trace the exact source of the crash as it doesn't happen on every test run, the same test run on UEFI passed (the failure was on BIOS, though I doubt that matters), and the same pair of tests (UEFI and BIOS) passed on our staging instance. So I can't say exactly what introduced the crash.
openQA tests on qemu VMs using virtio graphics.
### Regression
Can't say for sure.
### Log files as attachment
- [tarball of /var/log](/uploads/225a2d8ab46b49ad568cd47b1c57cc3d/_graphical_wait_login-var_log.tar.gz)
- [backtrace](/uploads/812ee50d7b9781652ae4240ddc1c0620/gisbt.txt)https://gitlab.freedesktop.org/mesa/mesa/-/issues/7198pursue avx512 support in llvmpipe/lavapipe2022-09-05T05:47:20ZYonggang Luopursue avx512 support in llvmpipe/lavapipeThis is the following up of mr https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17813#note_1537067This is the following up of mr https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17813#note_1537067https://gitlab.freedesktop.org/mesa/mesa/-/issues/6848gallivm: Emit saturated add intrinsics2022-07-18T15:54:45ZEmma Anholtemma@anholt.netgallivm: Emit saturated add intrinsicsLooking at !17468, llvmpipe is one of the few drivers setting `lower_uadd_sat`, which also lowers usub_sat, but ‘llvm.usub.sat.*’ and similar intrinsics do exist and it looks like we could just use them.Looking at !17468, llvmpipe is one of the few drivers setting `lower_uadd_sat`, which also lowers usub_sat, but ‘llvm.usub.sat.*’ and similar intrinsics do exist and it looks like we could just use them.https://gitlab.freedesktop.org/mesa/mesa/-/issues/6839Compiling Mesa fails against LLVM13 and clang with -stdlib=libc++2022-07-11T08:33:10ZEtnaCompiling Mesa fails against LLVM13 and clang with -stdlib=libc++I'm trying to build a parallel version of Mesa (v21.3.0) in my /home with Clang and libc++ against my own LLVM13, libva and libvdpau but the build always fails when linking. This is the output produced:
```
[2/809] Linking target src/ga...I'm trying to build a parallel version of Mesa (v21.3.0) in my /home with Clang and libc++ against my own LLVM13, libva and libvdpau but the build always fails when linking. This is the output produced:
```
[2/809] Linking target src/gallium/drivers/llvmpipe/lp_test_format
FAILED: src/gallium/drivers/llvmpipe/lp_test_format
/home/etna/Runtime/BuildSystem/LLVM13WithWASM/bin/clang++ -stdlib=libc++ -o src/gallium/drivers/llvmpipe/lp_test_format src/gallium/drivers/llvmpipe/lp_test_format.p/lp_test_format.c.o src/gallium/drivers/llvmpipe/lp_test_format.p/lp_test_main.c.o -L/home/etna/Runtime/MesaWithDecodeAccel/lib -L/home/etna/Runtime/MesaWithDecodeAccel/lib64 -L/home/etna/Runtime/MesaWithDecodeAccel/lib/x86_64-linux-gnu -L/home/etna/Runtime/MesaWithDecodeAccel/lib/x86_64-linux-gnu/vdpau -L/home/etna/Runtime/Deps/python-3.10.0/lib -L/home/etna/Runtime/Deps/python-3.10.0/lib64 -L/home/etna/Runtime/BuildSystem/LLVM13WithWASM/lib -I/home/etna/Runtime/MesaWithDecodeAccel/include -I/home/etna/Runtime/Deps/python-3.10.0/include -I/home/etna/Runtime/BuildSystem/LLVM13WithWASM/include -Wl,--as-needed -Wl,--no-undefined -Wl,-rpath -Wl,/home/etna/Runtime/MesaWithDecodeAccel/lib -Wl,-rpath -Wl,/home/etna/Runtime/MesaWithDecodeAccel/lib64 -Wl,-rpath -Wl,/home/etna/Runtime/MesaWithDecodeAccel/lib/x86_64-linux-gnu -Wl,-rpath -Wl,/home/etna/Runtime/MesaWithDecodeAccel/lib/x86_64-linux-gnu/vdpau -Wl,-rpath -Wl,/home/etna/Runtime/Deps/python-3.10.0/lib -Wl,-rpath -Wl,/home/etna/Runtime/Deps/python-3.10.0/lib64 -Wl,-rpath -Wl,/home/etna/Runtime/BuildSystem/LLVM13WithWASM/lib -fPIC -stdlib=libc++ -Wl,--start-group src/gallium/drivers/llvmpipe/libllvmpipe.a src/util/libmesa_util.a src/util/format/libmesa_format.a src/gallium/auxiliary/libgallium.a src/compiler/nir/libnir.a src/compiler/libcompiler.a -lLLVM-13 -pthread -ldl /usr/lib/x86_64-linux-gnu/libz.so -lm -lLLVM-13 /usr/lib/x86_64-linux-gnu/libdrm.so -lLLVM-13 -Wl,--end-group
ld: error: undefined symbol: llvm::EngineBuilder::EngineBuilder(std::__1::unique_ptr<llvm::Module, std::__1::default_delete<llvm::Module> >)
>>> referenced by lp_bld_misc.cpp
>>> gallivm_lp_bld_misc.cpp.o:(lp_build_create_jit_compiler_for_module) in archive src/gallium/auxiliary/libgallium.a
ld: error: undefined symbol: llvm::EngineBuilder::setMCJITMemoryManager(std::__1::unique_ptr<llvm::RTDyldMemoryManager, std::__1::default_delete<llvm::RTDyldMemoryManager> >)
>>> referenced by lp_bld_misc.cpp
>>> gallivm_lp_bld_misc.cpp.o:(lp_build_create_jit_compiler_for_module) in archive src/gallium/auxiliary/libgallium.a
ld: error: undefined symbol: llvm::RTDyldMemoryManager::getSymbolAddressInProcess(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
>>> referenced by lp_bld_misc.cpp
>>> gallivm_lp_bld_misc.cpp.o:(llvm::RTDyldMemoryManager::getSymbolAddress(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)) in archive src/gallium/auxiliary/libgallium.a
ld: error: undefined symbol: llvm::LegacyJITSymbolResolver::lookup(std::__1::set<llvm::StringRef, std::__1::less<llvm::StringRef>, std::__1::allocator<llvm::StringRef> > const&, llvm::unique_function<void (llvm::Expected<std::__1::map<llvm::StringRef, llvm::JITEvaluatedSymbol, std::__1::less<llvm::StringRef>, std::__1::allocator<std::__1::pair<llvm::StringRef const, llvm::JITEvaluatedSymbol> > > >)>)
>>> referenced by lp_bld_misc.cpp
>>> gallivm_lp_bld_misc.cpp.o:(vtable for ShaderMemoryManager) in archive src/gallium/auxiliary/libgallium.a
>>> referenced by lp_bld_misc.cpp
>>> gallivm_lp_bld_misc.cpp.o:(vtable for DelegatingJITMemoryManager) in archive src/gallium/auxiliary/libgallium.a
ld: error: undefined symbol: llvm::LegacyJITSymbolResolver::getResponsibilitySet(std::__1::set<llvm::StringRef, std::__1::less<llvm::StringRef>, std::__1::allocator<llvm::StringRef> > const&)
>>> referenced by lp_bld_misc.cpp
>>> gallivm_lp_bld_misc.cpp.o:(vtable for ShaderMemoryManager) in archive src/gallium/auxiliary/libgallium.a
>>> referenced by lp_bld_misc.cpp
>>> gallivm_lp_bld_misc.cpp.o:(vtable for DelegatingJITMemoryManager) in archive src/gallium/auxiliary/libgallium.a
clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
[5/809] Compiling C object src/gallium/winsys/radeon/drm/libradeonwinsys.a.p/radeon_drm_bo.c.o
ninja: build stopped: subcommand failed.
```
If I build against libstdc++ (i.e.: without the -stdlib=libc++ -lc++ -lc++abi flags) the errors do not happen. So it seems that the issue lies with LLVM or libc++ somewhere. Can anyone help?
The build flags are
```
LIBRARY_PATH=/home/etna/Runtime/MesaWithDecodeAccel/lib:/home/etna/Runtime/MesaWithDecodeAccel/lib64:/home/etna/Runtime/MesaWithDecodeAccel/lib/x86_64-linux-gnu:/home/etna/Runtime/MesaWithDecodeAccel/lib/x86_64-linux-gnu/vdpau:/home/etna/Runtime/Deps/python-3.10.0/lib:/home/etna/Runtime/Deps/python-3.10.0/lib64:/home/etna/Runtime/BuildSystem/LLVM13WithWASM/lib:$LIBRARY_PATH C_INCLUDE_PATH=/home/etna/Runtime/MesaWithDecodeAccel/include:/home/etna/Runtime/Deps/python-3.10.0/include:/home/etna/Runtime/BuildSystem/LLVM13WithWASM/include:$C_INCLUDE_PATH CPLUS_INCLUDE_PATH=/home/etna/Runtime/MesaWithDecodeAccel/include:/home/etna/Runtime/Deps/python-3.10.0/include:/home/etna/Runtime/BuildSystem/LLVM13WithWASM/include:$CPLUS_INCLUDE_PATH LD_LIBRARY_PATH=/home/etna/Runtime/MesaWithDecodeAccel/lib:/home/etna/Runtime/MesaWithDecodeAccel/lib64:/home/etna/Runtime/MesaWithDecodeAccel/lib/x86_64-linux-gnu:/home/etna/Runtime/MesaWithDecodeAccel/lib/x86_64-linux-gnu/vdpau:/home/etna/Runtime/Deps/python-3.10.0/lib:/home/etna/Runtime/Deps/python-3.10.0/lib64:/home/etna/Runtime/BuildSystem/LLVM13WithWASM/lib:$LD_LIBRARY_PATH PATH=/home/etna/Runtime/MesaWithDecodeAccel/bin:/home/etna/Runtime/MesaWithDecodeAccel/sbin:/home/etna/Runtime/MesaWithDecodeAccel/libexec:/home/etna/Runtime/Deps/python-3.10.0/bin:/home/etna/Runtime/Deps/FlexBison-Build25Jul2021/bin:/home/etna/Runtime/Deps/NasmYasm/bin:/home/etna/Runtime/Deps/gperf-3.1/bin:/home/etna/Runtime/BuildSystem/LLVM13WithWASM/bin:/home/etna/Runtime/BuildSystem/LLVM13WithWASM/libexec:$PATH PKG_CONFIG_PATH=/home/etna/Runtime/MesaWithDecodeAccel/lib/pkgconfig:/home/etna/Runtime/MesaWithDecodeAccel/lib64/pkgconfig:/home/etna/Runtime/MesaWithDecodeAccel/lib/x86_64-linux-gnu/pkgconfig:/home/etna/Runtime/Deps/python-3.10.0/lib/pkgconfig:/home/etna/Runtime/Deps/python-3.10.0/lib64/pkgconfig:/home/etna/Runtime/BuildSystem/LLVM13WithWASM/lib/pkgconfig:$PKG_CONFIG_PATH LDFLAGS='-L/home/etna/Runtime/MesaWithDecodeAccel/lib -L/home/etna/Runtime/MesaWithDecodeAccel/lib64 -L/home/etna/Runtime/MesaWithDecodeAccel/lib/x86_64-linux-gnu -L/home/etna/Runtime/MesaWithDecodeAccel/lib/x86_64-linux-gnu/vdpau -L/home/etna/Runtime/Deps/python-3.10.0/lib -L/home/etna/Runtime/Deps/python-3.10.0/lib64 -L/home/etna/Runtime/BuildSystem/LLVM13WithWASM/lib' CPPFLAGS='-I/home/etna/Runtime/MesaWithDecodeAccel/include -I/home/etna/Runtime/Deps/python-3.10.0/include -I/home/etna/Runtime/BuildSystem/LLVM13WithWASM/include' CC=/home/etna/Runtime/BuildSystem/LLVM13WithWASM/bin/clang CXX="/home/etna/Runtime/BuildSystem/LLVM13WithWASM/bin/clang++ -stdlib=libc++ -lc++ -lc++abi" CFLAGS='-L/home/etna/Runtime/MesaWithDecodeAccel/lib -L/home/etna/Runtime/MesaWithDecodeAccel/lib64 -L/home/etna/Runtime/MesaWithDecodeAccel/lib/x86_64-linux-gnu -L/home/etna/Runtime/MesaWithDecodeAccel/lib/x86_64-linux-gnu/vdpau -L/home/etna/Runtime/Deps/python-3.10.0/lib -L/home/etna/Runtime/Deps/python-3.10.0/lib64 -L/home/etna/Runtime/BuildSystem/LLVM13WithWASM/lib -I/home/etna/Runtime/MesaWithDecodeAccel/include -I/home/etna/Runtime/Deps/python-3.10.0/include -I/home/etna/Runtime/BuildSystem/LLVM13WithWASM/include -Wl,-rpath -Wl,/home/etna/Runtime/MesaWithDecodeAccel/lib -Wl,-rpath -Wl,/home/etna/Runtime/MesaWithDecodeAccel/lib64 -Wl,-rpath -Wl,/home/etna/Runtime/MesaWithDecodeAccel/lib/x86_64-linux-gnu -Wl,-rpath -Wl,/home/etna/Runtime/MesaWithDecodeAccel/lib/x86_64-linux-gnu/vdpau -Wl,-rpath -Wl,/home/etna/Runtime/Deps/python-3.10.0/lib -Wl,-rpath -Wl,/home/etna/Runtime/Deps/python-3.10.0/lib64 -Wl,-rpath -Wl,/home/etna/Runtime/BuildSystem/LLVM13WithWASM/lib -fPIC' CXXFLAGS='-L/home/etna/Runtime/MesaWithDecodeAccel/lib -L/home/etna/Runtime/MesaWithDecodeAccel/lib64 -L/home/etna/Runtime/MesaWithDecodeAccel/lib/x86_64-linux-gnu -L/home/etna/Runtime/MesaWithDecodeAccel/lib/x86_64-linux-gnu/vdpau -L/home/etna/Runtime/Deps/python-3.10.0/lib -L/home/etna/Runtime/Deps/python-3.10.0/lib64 -L/home/etna/Runtime/BuildSystem/LLVM13WithWASM/lib -I/home/etna/Runtime/MesaWithDecodeAccel/include -I/home/etna/Runtime/Deps/python-3.10.0/include -I/home/etna/Runtime/BuildSystem/LLVM13WithWASM/include -Wl,-rpath -Wl,/home/etna/Runtime/MesaWithDecodeAccel/lib -Wl,-rpath -Wl,/home/etna/Runtime/MesaWithDecodeAccel/lib64 -Wl,-rpath -Wl,/home/etna/Runtime/MesaWithDecodeAccel/lib/x86_64-linux-gnu -Wl,-rpath -Wl,/home/etna/Runtime/MesaWithDecodeAccel/lib/x86_64-linux-gnu/vdpau -Wl,-rpath -Wl,/home/etna/Runtime/Deps/python-3.10.0/lib -Wl,-rpath -Wl,/home/etna/Runtime/Deps/python-3.10.0/lib64 -Wl,-rpath -Wl,/home/etna/Runtime/BuildSystem/LLVM13WithWASM/lib -fPIC -stdlib=libc++ -lc++ -lc++abi' meson .. --wrap-mode=nodownload --buildtype=plain --prefix=/home/etna/Runtime/MesaWithDecodeAccel -Ddri-drivers='' -Dvulkan-drivers='amd','swrast','intel' -Dglvnd=true -Dshared-glapi=enabled -Dgallium-xvmc=disabled -Dgallium-omx=disabled -Db_ndebug=true -Dbuild-tests=true -Dglx-direct=true -Dgbm=enabled -Ddri3=enabled "-Dplatforms=x11 ,wayland" -Dgallium-extra-hud=true -Dgallium-vdpau=enabled -Dgallium-xa=enabled -Dllvm=enabled -Dgallium-nine=true -Dgallium-va=enabled -Dgallium-drivers='swrast','r300','r600','nouveau','virgl','svga','iris','radeonsi','zink','crocus' -Dgles1=disabled -Dgles2=enabled -Dosmesa=true -Dvalgrind=enabled -Dvulkan-device-select-layer=true -Dvulkan-overlay-layer=true
```https://gitlab.freedesktop.org/mesa/mesa/-/issues/6833ssbo-atomiccompswap-int tests fail with llvmpipe2022-07-11T08:37:12Zjjjighgssbo-atomiccompswap-int tests fail with llvmpipeWhen set LP_NUM_THREADS=1, the result is as follow:
```
Atomic counter 0 test failed: Reference == Observed
Reference: 4294967295
Observed: 2290649225
Test failure on line 76
Atomic counter 1 test failed: Reference == Observed
Re...When set LP_NUM_THREADS=1, the result is as follow:
```
Atomic counter 0 test failed: Reference == Observed
Reference: 4294967295
Observed: 2290649225
Test failure on line 76
Atomic counter 1 test failed: Reference == Observed
Reference: 4294967295
Observed: 2290649224
Test failure on line 77
Atomic counter 2 test failed: Reference == Observed
Reference: 4294967295
Observed: 2290649224
Test failure on line 78
Atomic counter 3 test failed: Reference == Observed
Reference: 4294967295
Observed: 2290649224
Test failure on line 79
Atomic counter 4 test failed: Reference == Observed
Reference: 4294967295
Observed: 2290649224
Test failure on line 80
Atomic counter 5 test failed: Reference == Observed
Reference: 4294967295
Observed: 2290649224
Test failure on line 81
Atomic counter 6 test failed: Reference == Observed
Reference: 4294967295
Observed: 2290649224
Test failure on line 82
Atomic counter 7 test failed: Reference == Observed
Reference: 0
Observed: 167
Test failure on line 83
```
Some of the shader codes are as follows:
```
int f;
uint i;
int c;
/* This is an open-coded atomicAdd. */
do {
f = value;
i = uint(f) / 4u;
c = int(i / 32u);
/* Stop when values won't fit in the mask array. */
if (c >= mask.length()) {
color = vec4(0.0, 0.0, 1.0, 1.0);
return ;
}
} while (f != atomicCompSwap(value, f, f + 4));
uint bit = i % 32u;
uint m = 1u << bit;
```
I found the atomicCompSwap function to be fine, but value and f got it wrong.
Some of the LLVM IR are as follows:
```
bgnloop: ; preds = %loop_end39, %75
%126 = load <4 x i32>, <4 x i32>* %5, align 16
%maskcb = and <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1>, %126
%maskfull = and <4 x i32> %125, %maskcb
store <4 x i32> zeroinitializer, <4 x i32>* %4, align 16
...
if-true-block: ; preds = %loop_begin16
%134 = extractelement <4 x i32> zeroinitializer, i32 %131
%"&context.num_ssbos_ptr[]" = getelementptr [16 x i32], [16 x i32]* %context.num_ssbos_ptr, i32 0, i32 %134
%"context.num_ssbos_ptr[]" = load i32, i32* %"&context.num_ssbos_ptr[]", align 4
%"&context.ssbos_ptr[]" = getelementptr [16 x i32*], [16 x i32*]* %context.ssbos_ptr, i32 0, i32 %134
%"context.ssbos_ptr[]" = load i32*, i32** %"&context.ssbos_ptr[]", align 8
%135 = ashr i32 %"context.num_ssbos_ptr[]", 2
%136 = add i32 %133, 0
%137 = icmp ult i32 %136, %135
%138 = sext i1 %137 to i32
%139 = and i32 -1, %138
%140 = icmp ne i32 %139, 0
br i1 %140, label %if-true-block19, label %if-false-block
if-true-block19: ; preds = %if-true-block
%141 = getelementptr i32, i32* %"context.ssbos_ptr[]", i32 %136
%"context.ssbos_ptr[][]" = load i32, i32* %141, align 4
%142 = load <4 x i32>, <4 x i32>* %4, align 16
%143 = insertelement <4 x i32> %142, i32 %"context.ssbos_ptr[][]", i32 %131
store <4 x i32> %143, <4 x i32>* %4, align 16
br label %endif-block18
if-false-block: ; preds = %if-true-block
%144 = load <4 x i32>, <4 x i32>* %4, align 16
%145 = insertelement <4 x i32> %144, i32 0, i32 %131
store <4 x i32> %145, <4 x i32>* %4, align 16
br label %endif-block18
endif-block18: ; preds = %if-false-block, %if-true-block19
br label %endif-block
endif-block: ; preds = %loop_begin16, %endif-block18
%146 = add i32 %131, 1
store i32 %146, i32* %loop_counter17, align 4
%147 = icmp uge i32 %146, 4
br i1 %147, label %loop_end, label %loop_begin16
loop_end: ; preds = %endif-block
%148 = load i32, i32* %loop_counter17, align 4
%149 = load <4 x i32>, <4 x i32>* %4, align 16
%150 = lshr <4 x i32> %149, <i32 2, i32 2, i32 2, i32 2>
%151 = lshr <4 x i32> %149, <i32 7, i32 7, i32 7, i32 7>
%152 = icmp sge <4 x i32> %151, <i32 7, i32 7, i32 7, i32 7>
%153 = sext <4 x i1> %152 to <4 x i32>
%154 = and <4 x i32> %125, %153
...
```
In loop_end should not be lshr directly with `%4`, because `%4` is initialized to 0 in bgnloop. LLVM IR seems to look wrong,
so I think it could be that there was something wrong with the nir to LLVM IR, but why?https://gitlab.freedesktop.org/mesa/mesa/-/issues/6827Build Failure in libgallium2022-07-17T17:27:53ZSolarAquarionBuild Failure in libgallium```
[1587/2715] Compiling C object src/gallium/auxiliary/libgallium.a.p/gallivm_lp_bld_coro.c.o
../mesa/src/gallium/auxiliary/gallivm/lp_bld_coro.c: In function ‘lp_build_coro_alloc_mem_array’:
../mesa/src/gallium/auxiliary/gallivm/lp_bl...```
[1587/2715] Compiling C object src/gallium/auxiliary/libgallium.a.p/gallivm_lp_bld_coro.c.o
../mesa/src/gallium/auxiliary/gallivm/lp_bld_coro.c: In function ‘lp_build_coro_alloc_mem_array’:
../mesa/src/gallium/auxiliary/gallivm/lp_bld_coro.c:209:4: warning: ‘LLVMBuildLoad’ is deprecated [-Wdeprecated-declarations]
209 | LLVMValueRef alloced_ptr = LLVMBuildLoad(gallivm->builder, coro_hdl_ptr, "");
| ^~~~~~~~~~~~
In file included from /usr/include/llvm-c/Core.h:18,
from ../mesa/src/gallium/auxiliary/gallivm/lp_bld.h:51,
from ../mesa/src/gallium/auxiliary/gallivm/lp_bld_coro.h:31,
from ../mesa/src/gallium/auxiliary/gallivm/lp_bld_coro.c:27:
/usr/include/llvm-c/Core.h:3931:1: note: declared here
3931 | LLVM_ATTRIBUTE_C_DEPRECATED(
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
[1588/2715] Compiling C object src/gallium/auxiliary/libgallium.a.p/gallivm_lp_bld_format_float.c.o
[1589/2715] Compiling C object src/gallium/auxiliary/libgallium.a.p/gallivm_lp_bld_arit.c.o
FAILED: src/gallium/auxiliary/libgallium.a.p/gallivm_lp_bld_arit.c.o
cc -Isrc/gallium/auxiliary/libgallium.a.p -Isrc/gallium/auxiliary -I../mesa/src/gallium/auxiliary -Isrc/loader -I../mesa/src/loader -I../mesa/src/gallium/include -Isrc -I../mesa/src -Iinclude -I../mesa/include -I../mesa/src/gallium/auxiliary/util -Isrc/compiler/nir -I../mesa/src/compiler/nir -Isrc/util -I../mesa/src/util -I/usr/include/libdrm -I/usr/include/valgrind -fvisibility=hidden -flto=auto -fdiagnostics-color=always -DNDEBUG -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c11 -O0 '-DPACKAGE_VERSION="22.2.0-devel"' '-DPACKAGE_BUGREPORT="https://gitlab.freedesktop.org/mesa/mesa/-/issues"' -DHAVE_R300 -DHAVE_R600 -DHAVE_RADEONSI -DHAVE_NOUVEAU -DHAVE_IRIS -DHAVE_ZINK -DHAVE_VIRGL -DHAVE_SVGA -DHAVE_SWRAST -DHAVE_PANFROST -DHAVE_LIMA -DHAVE_ASAHI -DHAVE_CROCUS -DVIDEO_CODEC_VC1DEC=0 -DVIDEO_CODEC_H264DEC=1 -DVIDEO_CODEC_H264ENC=1 -DVIDEO_CODEC_H265DEC=1 -DVIDEO_CODEC_H265ENC=1 -DHAVE_X11_PLATFORM -DHAVE_WAYLAND_PLATFORM -DHAVE_SURFACELESS_PLATFORM -DHAVE_DRM_PLATFORM -DHAVE_XCB_PLATFORM -DUSE_ELF_TLS -DHAVE_ST_VDPAU -DENABLE_ST_OMX_BELLAGIO=1 -DENABLE_ST_OMX_TIZONIA=0 -DHAVE_VA_SURFACE_ATTRIB_DRM_FORMAT_MODIFIERS -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_DRM -DENABLE_SHADER_CACHE -DHAVE___BUILTIN_BSWAP32 -DHAVE___BUILTIN_BSWAP64 -DHAVE___BUILTIN_CLZ -DHAVE___BUILTIN_CLZLL -DHAVE___BUILTIN_CTZ -DHAVE___BUILTIN_EXPECT -DHAVE___BUILTIN_FFS -DHAVE___BUILTIN_FFSLL -DHAVE___BUILTIN_POPCOUNT -DHAVE___BUILTIN_POPCOUNTLL -DHAVE___BUILTIN_UNREACHABLE -DHAVE___BUILTIN_TYPES_COMPATIBLE_P -DHAVE_FUNC_ATTRIBUTE_CONST -DHAVE_FUNC_ATTRIBUTE_FLATTEN -DHAVE_FUNC_ATTRIBUTE_MALLOC -DHAVE_FUNC_ATTRIBUTE_PURE -DHAVE_FUNC_ATTRIBUTE_UNUSED -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT -DHAVE_FUNC_ATTRIBUTE_WEAK -DHAVE_FUNC_ATTRIBUTE_FORMAT -DHAVE_FUNC_ATTRIBUTE_PACKED -DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL -DHAVE_FUNC_ATTRIBUTE_ALIAS -DHAVE_FUNC_ATTRIBUTE_NORETURN -DHAVE_FUNC_ATTRIBUTE_VISIBILITY -DHAVE_UINT128 -DUSE_SSE41 -DUSE_GCC_ATOMIC_BUILTINS -DUSE_X86_64_ASM -DMAJOR_IN_SYSMACROS -DHAS_SCHED_H -DHAS_SCHED_GETAFFINITY -DHAVE_LINUX_FUTEX_H -DHAVE_ENDIAN_H -DHAVE_DLFCN_H -DHAVE_SYS_SHM_H -DHAVE_CET_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_TIMESPEC_GET -DHAVE_MEMFD_CREATE -DHAVE_RANDOM_R -DHAVE_FLOCK -DHAVE_STRTOK_R -DHAVE_GETRANDOM -DHAVE_QSORT_R -DHAVE_STRUCT_TIMESPEC -DHAVE_PROGRAM_INVOCATION_NAME -DHAVE_ISSIGNALING -DHAVE_POSIX_MEMALIGN -DHAVE_DIRENT_D_TYPE -DHAVE_STRTOD_L -DHAVE_DLADDR -DHAVE_DL_ITERATE_PHDR -DHAVE_ZLIB -DHAVE_ZSTD -DHAVE_COMPRESSION -DHAVE_PTHREAD -DHAVE_PTHREAD_SETAFFINITY -DHAVE_LIBDRM -DHAVE_LIBUDEV -DLLVM_AVAILABLE '-DMESA_LLVM_VERSION_STRING="15.0.0"' -DLLVM_IS_SHARED=1 -DDRAW_LLVM_AVAILABLE -DUSE_LIBGLVND=1 -DHAVE_VALGRIND -DMESA_EXECMEM -DHAVE_LIBUNWIND -DWL_HIDE_DEPRECATED -DHAVE_OPENMP -DHAVE_DRI3 -DHAVE_DRI3_MODIFIERS -DHAVE_GALLIUM_EXTRA_HUD=1 -DHAVE_LIBSENSORS=1 -DVK_USE_PLATFORM_WAYLAND_KHR -DVK_USE_PLATFORM_XCB_KHR -DVK_USE_PLATFORM_XLIB_KHR -DVK_USE_PLATFORM_XLIB_XRANDR_EXT -DVK_USE_PLATFORM_DISPLAY_KHR -mtls-dialect=gnu2 -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=empty-body -Werror=incompatible-pointer-types -Werror=int-conversion -Wimplicit-fallthrough -Wno-missing-field-initializers -Wno-format-truncation -fno-math-errno -fno-trapping-math -fno-common -Wno-unused-function -Werror=format -Wformat-security -ffunction-sections -fdata-sections -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto=auto -Wno-error=deprecated-declarations -fPIC -pthread -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Werror=pointer-arith -Werror=vla -MD -MQ src/gallium/auxiliary/libgallium.a.p/gallivm_lp_bld_arit.c.o -MF src/gallium/auxiliary/libgallium.a.p/gallivm_lp_bld_arit.c.o.d -o src/gallium/auxiliary/libgallium.a.p/gallivm_lp_bld_arit.c.o -c ../mesa/src/gallium/auxiliary/gallivm/lp_bld_arit.c
../mesa/src/gallium/auxiliary/gallivm/lp_bld_arit.c: In function ‘lp_build_div’:
../mesa/src/gallium/auxiliary/gallivm/lp_bld_arit.c:1311:17: error: implicit declaration of function ‘LLVMConstSDiv’; did you mean ‘LLVMConstFDiv’? [-Werror=implicit-function-declaration]
1311 | return LLVMConstSDiv(a, b);
| ^~~~~~~~~~~~~
| LLVMConstFDiv
../mesa/src/gallium/auxiliary/gallivm/lp_bld_arit.c:1311:17: error: returning ‘int’ from a function with return type ‘LLVMValueRef’ {aka ‘struct LLVMOpaqueValue *’} makes pointer from integer without a cast [-Werror=int-conversion]
1311 | return LLVMConstSDiv(a, b);
| ^~~~~~~~~~~~~~~~~~~
../mesa/src/gallium/auxiliary/gallivm/lp_bld_arit.c:1313:17: error: implicit declaration of function ‘LLVMConstUDiv’; did you mean ‘LLVMConstFDiv’? [-Werror=implicit-function-declaration]
1313 | return LLVMConstUDiv(a, b);
| ^~~~~~~~~~~~~
| LLVMConstFDiv
../mesa/src/gallium/auxiliary/gallivm/lp_bld_arit.c:1313:17: error: returning ‘int’ from a function with return type ‘LLVMValueRef’ {aka ‘struct LLVMOpaqueValue *’} makes pointer from integer without a cast [-Werror=int-conversion]
1313 | return LLVMConstUDiv(a, b);
| ^~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
[1590/2715] Compiling C object src/gallium/auxiliary/libgallium.a.p/gallivm_lp_bld_flow.c.o
[1591/2715] Compiling C object src/gallium/auxiliary/libgallium.a.p/gallivm_lp_bld_format_aos_array.c.o
../mesa/src/gallium/auxiliary/gallivm/lp_bld_format_aos_array.c: In function ‘lp_build_fetch_rgba_aos_array’:
../mesa/src/gallium/auxiliary/gallivm/lp_bld_format_aos_array.c:81:4: warning: ‘LLVMBuildGEP’ is deprecated [-Wdeprecated-declarations]
81 | ptr = LLVMBuildGEP(builder, base_ptr, &offset, 1, "");
| ^~~
In file included from /usr/include/llvm-c/Core.h:18,
from ../mesa/src/gallium/auxiliary/gallivm/lp_bld.h:51,
from ../mesa/src/gallium/auxiliary/gallivm/lp_bld_const.h:41,
from ../mesa/src/gallium/auxiliary/gallivm/lp_bld_format_aos_array.c:28:
/usr/include/llvm-c/Core.h:3938:1: note: declared here
3938 | LLVM_ATTRIBUTE_C_DEPRECATED(
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
[1592/2715] Compiling C object src/gallium/auxiliary/libgallium.a.p/util_u_helpers.c.o
[1593/2715] Compiling C object src/gallium/auxiliary/libgallium.a.p/gallivm_lp_bld_format_aos.c.o
[1594/2715] Compiling C object src/gallium/auxiliary/libgallium.a.p/gallivm_lp_bld_format_s3tc.c.o
../mesa/src/gallium/auxiliary/gallivm/lp_bld_format_s3tc.c: In function ‘s3tc_store_cached_block’:
../mesa/src/gallium/auxiliary/gallivm/lp_bld_format_s3tc.c:1137:4: warning: ‘LLVMBuildGEP’ is deprecated [-Wdeprecated-declarations]
1137 | ptr = LLVMBuildGEP(builder, cache, indices, ARRAY_SIZE(indices), "");
| ^~~
In file included from /usr/include/llvm-c/Core.h:18,
from ../mesa/src/gallium/auxiliary/gallivm/lp_bld.h:51,
from ../mesa/src/gallium/auxiliary/gallivm/lp_bld_arit.h:40,
from ../mesa/src/gallium/auxiliary/gallivm/lp_bld_format_s3tc.c:45:
/usr/include/llvm-c/Core.h:3938:1: note: declared here
3938 | LLVM_ATTRIBUTE_C_DEPRECATED(
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../mesa/src/gallium/auxiliary/gallivm/lp_bld_format_s3tc.c:1144:7: warning: ‘LLVMBuildGEP’ is deprecated [-Wdeprecated-declarations]
1144 | ptr = LLVMBuildGEP(builder, cache, indices, ARRAY_SIZE(indices), "");
| ^~~
/usr/include/llvm-c/Core.h:3938:1: note: declared here
3938 | LLVM_ATTRIBUTE_C_DEPRECATED(
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../mesa/src/gallium/auxiliary/gallivm/lp_bld_format_s3tc.c: In function ‘s3tc_lookup_cached_pixel’:
../mesa/src/gallium/auxiliary/gallivm/lp_bld_format_s3tc.c:1162:4: warning: ‘LLVMBuildGEP’ is deprecated [-Wdeprecated-declarations]
1162 | member_ptr = LLVMBuildGEP(builder, ptr, indices, ARRAY_SIZE(indices), "");
| ^~~~~~~~~~
/usr/include/llvm-c/Core.h:3938:1: note: declared here
3938 | LLVM_ATTRIBUTE_C_DEPRECATED(
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../mesa/src/gallium/auxiliary/gallivm/lp_bld_format_s3tc.c:1163:4: warning: ‘LLVMBuildLoad’ is deprecated [-Wdeprecated-declarations]
1163 | return LLVMBuildLoad(builder, member_ptr, "cache_data");
| ^~~~~~
/usr/include/llvm-c/Core.h:3931:1: note: declared here
3931 | LLVM_ATTRIBUTE_C_DEPRECATED(
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../mesa/src/gallium/auxiliary/gallivm/lp_bld_format_s3tc.c: In function ‘s3tc_lookup_tag_data’:
../mesa/src/gallium/auxiliary/gallivm/lp_bld_format_s3tc.c:1178:4: warning: ‘LLVMBuildGEP’ is deprecated [-Wdeprecated-declarations]
1178 | member_ptr = LLVMBuildGEP(builder, ptr, indices, ARRAY_SIZE(indices), "");
| ^~~~~~~~~~
/usr/include/llvm-c/Core.h:3938:1: note: declared here
3938 | LLVM_ATTRIBUTE_C_DEPRECATED(
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
[1595/2715] Compiling C object src/gallium/auxiliary/libgallium.a.p/nir_nir_draw_helpers.c.o
[1596/2715] Compiling C object src/gallium/auxiliary/libgallium.a.p/nir_tgsi_to_nir.c.o
[1597/2715] Compiling C object src/gallium/auxiliary/libgallium.a.p/gallivm_lp_bld_conv.c.o
[1598/2715] Compiling C object src/gallium/auxiliary/libgallium.a.p/gallivm_lp_bld_const.c.o
[1599/2715] Compiling C object src/gallium/auxiliary/libgallium.a.p/nir_nir_to_tgsi.c.o
[1600/2715] Compiling C++ object src/gallium/auxiliary/libgallium.a.p/gallivm_lp_bld_debug.cpp.o
[1601/2715] Compiling C object src/mesa/libmesa.a.p/vbo_vbo_exec_api.c.o
[1602/2715] Linking target src/amd/vulkan/libvulkan_radeon.so
ninja: build stopped: subcommand failed.
```https://gitlab.freedesktop.org/mesa/mesa/-/issues/6801Bluestacks 5 64-bit Android Pie instance on Windows host - black screen in-ga...2023-04-14T14:55:47ZProdea Alexandru-LiviuBluestacks 5 64-bit Android Pie instance on Windows host - black screen in-game or crash on boot depending on Mesa3D OpenGL driver used### Reproduced with
- [Bluestacks 5](https://www.bluestacks.com/download.html) 64-bit Android Pie instance using OpenGL graphics renderer
- Mesa Version: 22.1.3-ceb5c0f5 built with MSVC 17.2.5 and LLVM 14.0.6
- Windows 11 v10.0.22000
- G...### Reproduced with
- [Bluestacks 5](https://www.bluestacks.com/download.html) 64-bit Android Pie instance using OpenGL graphics renderer
- Mesa Version: 22.1.3-ceb5c0f5 built with MSVC 17.2.5 and LLVM 14.0.6
- Windows 11 v10.0.22000
- Game: [Old School Runescape](https://play.google.com/store/apps/details?id=com.jagex.oldscape.android&gl=US)
- [Swiftshader Subzero](https://dev.azure.com/bontarka/swiftshader-dist-win/_build?definitionId=1)*
*: Look for runs that lasted more than 10 minutes. Other don't have artifacts because the build script exits early if both itself and Swiftshader source code did not change from previous run.
### Results
- llvmpipe and GLonD3D12 over WARP = black screen with audio in-game
- zink over lavapipe or swiftshader = [crash on Bluestacks engine boot](/uploads/871cdccc6468aa780230286b149c8bfc/ReportArchive.zip)
### Extra info
- [Downstream issue report](https://github.com/pal1000/mesa-dist-win/issues/107)
- Original issue reporter wanted to use software rendering on purpose
- Bluestacks default executable location: %ProgramFiles%\BlueStacks_nxt
- It doesn't seam to matter if Interface renderer is OpenGL or software
- Bluestacks reports GPU in use in instance settings - Graphics so you can easily tell if any Mesa3D driver is in usehttps://gitlab.freedesktop.org/mesa/mesa/-/issues/6755llvmpipe: blit cts fails2022-06-29T08:16:23ZMike Blumenkrantzllvmpipe: blit cts failsWith #6659 on the way to being resolved, these are the only GLES CTS failures remaining:
```
dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_mag,Fail
dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_mag_reverse_dst_x,Fail...With #6659 on the way to being resolved, these are the only GLES CTS failures remaining:
```
dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_mag,Fail
dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_mag_reverse_dst_x,Fail
dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_mag_reverse_src_dst_x,Fail
dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_mag_reverse_src_dst_y,Fail
dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_mag_reverse_src_x,Fail
dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_min,Fail
dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_min_reverse_dst_x,Fail
dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_min_reverse_src_dst_x,Fail
dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_min_reverse_src_dst_y,Fail
dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_min_reverse_src_x,Fail
```
I haven't dug in much, but the name does imply there's something wrong with nearest filtering in blits.https://gitlab.freedesktop.org/mesa/mesa/-/issues/6658lavapipe: weird cts fail2022-06-15T05:05:33ZMike Blumenkrantzlavapipe: weird cts failI discovered this bizarre failure case:
`LIBGL_ALWAYS_SOFTWARE=1 MESA_LOADER_DRIVER_OVERRIDE=zink ./glcts --deqp-surface-type=window --deqp-gl-context-type=egl -n KHR-GL45.shaders.uniform_block.single_basic_type.packed.highp_float`
Run...I discovered this bizarre failure case:
`LIBGL_ALWAYS_SOFTWARE=1 MESA_LOADER_DRIVER_OVERRIDE=zink ./glcts --deqp-surface-type=window --deqp-gl-context-type=egl -n KHR-GL45.shaders.uniform_block.single_basic_type.packed.highp_float`
Running with `LIBGL_ALWAYS_SOFTWARE=1 MESA_LOADER_DRIVER_OVERRIDE=zink ./glcts --deqp-surface-type=window -n KHR-GL45.shaders.uniform_block.single_basic_type.packed.highp_float` passes, and the same test passes on plain llvmpipe.
Digging in deeper, it looks like somehow the FS input is never actually being loaded? I put prints all over it, and the value is exported correctly from the VS, but then somehow by the time it leaves `generate_fs_loop()` it's broken; prints in that function didn't even trigger, so I'm wondering if somehow the part of the shader that loads the FS input isn't even being triggered?https://gitlab.freedesktop.org/mesa/mesa/-/issues/6505llvmpipe: build failure with LLVM 15.0.02022-12-13T13:07:23ZLuc Mallvmpipe: build failure with LLVM 15.0.0# Build Options
```
meson build -Dprefix=~/.local -Dplatforms=x11 -Ddri-drivers= -Dvulkan-drivers= -Dgallium-drivers=swrast -Dcpp_rtti=false
```
# `ninja -C build`
...
/usr/bin/ld: src/gallium/auxiliary/libgallium.a(gallivm_lp_bld_ini...# Build Options
```
meson build -Dprefix=~/.local -Dplatforms=x11 -Ddri-drivers= -Dvulkan-drivers= -Dgallium-drivers=swrast -Dcpp_rtti=false
```
# `ninja -C build`
...
/usr/bin/ld: src/gallium/auxiliary/libgallium.a(gallivm_lp_bld_init.c.o): in function `gallivm_compile_module': /home/luc/gh/mesa/build/../src/gallium/auxiliary/gallivm/lp_bld_init.c:628: undefined reference to `LLVMCreatePassBuilderOptions' /usr/bin/ld: /home/luc/gh/mesa/build/../src/gallium/auxiliary/gallivm/lp_bld_init.c:629: undefined reference to `LLVMRunPasses' /usr/bin/ld: /home/luc/gh/mesa/build/../src/gallium/auxiliary/gallivm/lp_bld_init.c:636: undefined reference to `LLVMRunPasses' /usr/bin/ld: /home/luc/gh/mesa/build/../src/gallium/auxiliary/gallivm/lp_bld_init.c:637: undefined reference to `LLVMDisposePassBuilderOptions' collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
# `llvm-config --version`
15.0.0git
# `llvm-config --components`
aggressiveinstcombine all all-targets analysis asmparser asmprinter binaryformat bitreader bitstreamreader bitwriter cfguard codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker dwp engine executionengine extensions filecheck frontendopenacc frontendopenmp fuzzmutate globalisel instcombine instrumentation interfacestub interpreter ipo irreader jitlink libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mirparser native nativecodegen objcarcopts objcopy object objectyaml option orcjit orcshared orctargetprocess passes profiledata remarks runtimedyld scalaropts selectiondag support symbolize tablegen target textapi transformutils vectorize windowsdriver windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86targetmca xray
If I try to append llvm component **passes** to `llvm_modules` in `meson.build`, that will be okay. I'm not sure whether this is a issue or just environment-specific problem.
``` diff
diff --git a/meson.build b/meson.build
index 9f93ad52be7..2693798c585 100644
--- a/meson.build
+++ b/meson.build
@@ -1666,7 +1666,7 @@ if dep_libudev.found()
pre_args += '-DHAVE_LIBUDEV'
endif
-llvm_modules = ['bitwriter', 'engine', 'mcdisassembler', 'mcjit', 'core', 'executionengine', 'scalaropts', 'transformutils', 'instcombine']
+llvm_modules = ['bitwriter', 'engine', 'mcdisassembler', 'mcjit', 'core', 'executionengine', 'scalaropts', 'transformutils', 'instcombine', 'passes']
llvm_optional_modules = ['coroutines']
if with_amd_vk or with_gallium_radeonsi or with_gallium_r600
llvm_modules += ['amdgpu', 'native', 'bitreader', 'ipo']
```
[meson-log.txt](/uploads/e214b6804ca875be3ce043e4eb0bb9b4/meson-log.txt)https://gitlab.freedesktop.org/mesa/mesa/-/issues/6438llvmpipe: segfault when trying to render to imported prime buffer2023-03-12T13:10:02ZJulian Orthllvmpipe: segfault when trying to render to imported prime bufferThe llvmpipe EGL interface allows importing prime buffers from other DRM devices. When trying to render to them, llvmpipe uses DRM_IOCTL_MODE_MAP_DUMB to map them. This will always fail but llvmpipe does not check the return value for NU...The llvmpipe EGL interface allows importing prime buffers from other DRM devices. When trying to render to them, llvmpipe uses DRM_IOCTL_MODE_MAP_DUMB to map them. This will always fail but llvmpipe does not check the return value for NULL and will then segfault when trying to dereference the pointer.
llvmpipe should either support mapping arbitrary imported buffers (maybe via GBM) or it should reject such images at import time.https://gitlab.freedesktop.org/mesa/mesa/-/issues/6402llvmpipe/lp_state_cs.c:1398:41: error: passing 'const void *const' to paramet...2023-03-12T13:10:27ZThomas Debessellvmpipe/lp_state_cs.c:1398:41: error: passing 'const void *const' to parameter of type 'void *' discards qualifiers### System information
- OS: Ubuntu 21.10 impish
- Mesa version: `main`
- LLVM: `master`
- Clang: `master`
### Describe the issue
I get the error while building `rusticl/wip` (!15439) branch **but the bug lies in a file from `main` no...### System information
- OS: Ubuntu 21.10 impish
- Mesa version: `main`
- LLVM: `master`
- Clang: `master`
### Describe the issue
I get the error while building `rusticl/wip` (!15439) branch **but the bug lies in a file from `main` not touched by this branch**.
```bat
../src/gallium/drivers/llvmpipe/lp_state_cs.c:1398:41: error: passing 'const void *const' to parameter of type 'void *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
llvmpipe_cs_update_derived(llvmpipe, info->input);
^~~~~~~~~~~
../src/gallium/drivers/llvmpipe/lp_state_cs.c:1278:69: note: passing argument to parameter 'input' here
llvmpipe_cs_update_derived(struct llvmpipe_context *llvmpipe, void *input)
```
I compile Mesa using latest LLVM/Clang I built.
I use my [`user-rusticl`](https://gitlab.com/illwieckz/i-love-compute/-/blob/master/scripts/user-rusticl) build script to build LLVM, Clang and Mesa using the `rusticl/wip` branch (see !15439).
For some unknown reason when I build Mesa using my [`user-mesa`](https://gitlab.com/illwieckz/i-love-compute/-/blob/master/scripts/user-mesa) build script (`main`) branch I don't get the error but the `rusticl/wip` branch is just based on `main` and doesn't modify this file. When I build the whole Mesa from `main` I enable more Mesa component so maybe there is a side effect in disabling or enabling components?
In all case the problematic code lives in `main` branch.
I noticed such workaround makes the build continue but this is just hiding the problem:
```patch
diff --git a/src/gallium/drivers/llvmpipe/lp_state_cs.c b/src/gallium/drivers/llvmpipe/lp_state_cs.c
index 230004d799f..ebb6d1288dd 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_cs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_cs.c
@@ -1395,7 +1395,7 @@ static void llvmpipe_launch_grid(struct pipe_context *pipe,
memset(&job_info, 0, sizeof(job_info));
- llvmpipe_cs_update_derived(llvmpipe, info->input);
+ llvmpipe_cs_update_derived(llvmpipe, (void *) info->input);
fill_grid_size(pipe, info, job_info.grid_size);
```https://gitlab.freedesktop.org/mesa/mesa/-/issues/6309VTK volumetric rendering issue upgrading from MESA 20 to 212022-04-15T15:28:23ZEric LarsonVTK volumetric rendering issue upgrading from MESA 20 to 21When I build a complicated scene with volumetric rendering plus surfaces plus glyphs (as VTK calls them) on Ubuntu 18.04, which has
```
OpenGL 3.3 (Core Profile) Mesa 20.0.8 via llvmpipe (LLVM 10.0.0, 256 bits)
```
on [CircleCI](https://...When I build a complicated scene with volumetric rendering plus surfaces plus glyphs (as VTK calls them) on Ubuntu 18.04, which has
```
OpenGL 3.3 (Core Profile) Mesa 20.0.8 via llvmpipe (LLVM 10.0.0, 256 bits)
```
on [CircleCI](https://app.circleci.com/pipelines/github/mne-tools/mne-python/13648/workflows/aa538b66-51fb-49eb-9ad2-13477e39bf1f/jobs/43333/parallel-runs/0/steps/0-118), I get a correct rendering. But on Ubuntu 20.04, which has
```
OpenGL 4.5 (Core Profile) Mesa 21.2.6 via llvmpipe (LLVM 12.0.0, 256 bits)
```
I get on [CircleCI](https://app.circleci.com/pipelines/github/mne-tools/mne-python/13679/workflows/8ce55b14-444f-47c7-a9c2-2c602fdd4229/jobs/43401/parallel-runs/0/steps/0-117) an incorrect rendering (ignore the bottom quarter, that's `matplotlib` -- the top brain is VTK+Mesa):
| Mesa 20.0.8 (Ubuntu 18.04) | Mesa 21.2.6 (Ubuntu 20.04) |
| -- | -- |
| ![18.04](/uploads/4fc865422a59290c9a8e4840dab8c58d/18.04.png) | ![20.04](/uploads/27130c9d07f79248b962f3c8497bc6b3/20.04.png) |
I have tried setting `MESA_GL_VERSION_OVERRIDE=3.3` on the Mesa 21 / Ubuntu 20.04 build, and forcing it to use `vtkFixedPointRayCastMapper` (rather than `vtkSmartVolumeMapper` variant, which might have decided to use `vtkGPUVolumeRayCastMapper` under the hood with Mesa 21) but neither made any difference. Both 20.04 and 18.04 make use of the same Python 3.8 VTK 9.1 wheel.
My plan to continue diagnosis is:
1. Create a minimal example that uses just Python3.8+VTK to reproduce
2. `git clone` Mesa locally, get it built+installed, reproduce with `xvfb-run`, and then bisect (including one with the latest `main` to make sure it's not fixed there)
But I'm happy for other advice, or to hear about other potential workarounds (if any) here!https://gitlab.freedesktop.org/mesa/mesa/-/issues/6214llvmpipe: RFE -- add missing subgroup operation "SHUFFLE"2022-04-22T16:02:29ZAllan MacKinnonllvmpipe: RFE -- add missing subgroup operation "SHUFFLE"I'd like to bring up my compute-heavy libraries on llvmpipe but need `SUBGROUP_FEATURE_SHUFFLE_BIT`.
The rest would be nice to have too.
Not implemented:
```
SUBGROUP_FEATURE_SHUFFLE_BIT
SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT
SUBGROUP_...I'd like to bring up my compute-heavy libraries on llvmpipe but need `SUBGROUP_FEATURE_SHUFFLE_BIT`.
The rest would be nice to have too.
Not implemented:
```
SUBGROUP_FEATURE_SHUFFLE_BIT
SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT
SUBGROUP_FEATURE_CLUSTERED_BIT
SUBGROUP_FEATURE_QUAD_BIT
```