Frogging-Family / mesa-git

Other
46 stars 22 forks source link

Build with rusticl #21

Open Etaash-mathamsetty opened 2 years ago

Etaash-mathamsetty commented 2 years ago

is this possible? I would really like to use rusticl and not have to use that crap show that is amd rocm (it doesn't work on 4000+ APUs that well) and clover opencl is really bad and doesn't meet my requirements

Tk-Glitch commented 2 years ago

Yes. Add -Dgallium-rusticl=true -Dopencl-spirv=true -Dshader-cache=true -Dllvm=true in the _additional_meson_flags_64="" array in customization.cfg. I cannot test it since my RX 5700 XT isn't supported, but if you hardware is supported it should work (with known stability issues).

Etaash-mathamsetty commented 2 years ago

Yes. Add -Dgallium-rusticl=true -Dopencl-spirv=true -Dshader-cache=true -Dllvm=true in the _additional_meson_flags_64="" array in customization.cfg. I cannot test it since my RX 5700 XT isn't supported, but if you hardware is supported it should work (with known stability issues).

lol I use this from the chaotic aur, guess I have to compile it myself now.

nutta-git commented 1 year ago

An update for anyone waning to add rusticl. sudo pacman -S rust-bindgen spirv-llvm-translator

Add the following to _additional_meson_flags_64="" in customization.cfg to enable rusticl and disable opencl -Dgallium-opencl=disabled -Dgallium-rusticl=true -Dllvm=enabled -Drust_std=2021

And the following to /etc/enviroment to enable rusctcl for your device RUSTICL_ENABLE=radeonsi

https://docs.mesa3d.org/rusticl.html https://docs.mesa3d.org/envvars.html#rusticl-env-var

QushyQushy commented 11 months ago

I just want to add that if you want to build with NAK support (which is already merged for nouveau-experimetnal you have to add --force-fallback-for=syn --wrap-mode=nofallback to the _additional_meson_flags_64="". So the full flags addition is:

-Dgallium-opencl=disabled -Dgallium-rusticl=true -Dllvm=enabled -Drust_std=2021 --force-fallback-for=syn --wrap-mode=nofallback.

derEremit commented 10 months ago

An update for anyone waning to add rusticl. sudo pacman -S rust-bindgen spirv-llvm-translator

Add the following to _additional_meson_flags_64="" in customization.cfg to enable rusticl and disable opencl -Dgallium-opencl=disabled -Dgallium-rusticl=true -Dllvm=enabled -Drust_std=2021

And the following to /etc/enviroment to enable rusctcl for your device RUSTICL_ENABLE=radeonsi

https://docs.mesa3d.org/rusticl.html https://docs.mesa3d.org/envvars.html#rusticl-env-var

for me the rusticl build fails with

Called: `rustc -C linker=gcc -C link-arg=-m32 -o /home/z3n/aurpackages/mesa-git/src/_build32/meson-private/rusttest /home/z3n/aurpackages/mesa-git/src/_build32/meson-private/sanity.rs` -> 1
stderr:
error: linking with `gcc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/usr/lib64/rustlib/x86_64-unknown-linux-gnu/bin:/usr/lib/ccache/bin:/home/z3n/temp/drupal/vendor/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl" VSLANG="1033" "gcc" "-m64" "/tmp/rustciD3sIT/symbols.o" "/home/z3n/aurpackages/mesa-git/src/_build32/meson-private/rusttest.sanity.7005ba2246a48314-cgu.0.rcgu.o" "/home/z3n/aurpackages/mesa-git/src/_build32/meson-private/rusttest.1sr1pehkcoxvenr2.rcgu.o" "-Wl,--as-needed" "-L" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libstd-2e78a7bc2eb1cbf1.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-386bb5d8fe757789.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libobject-f7f90a882219704e.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-e2b0ea1b0a36a0f1.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-b2fb1287f428423c.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-d759e97cd39088c4.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-8fc87f7b8682f112.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-40cd8c73aae072d4.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-3d224f3f9150b562.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-2844a4f43bae1aa7.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-97e8ab5c6800a97f.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libadler-c0b31298c4436277.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-80c6939036f51f90.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-001aed8354f9d92f.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-72c7d190d1af5f4c.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-04a78a57e8793d26.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-885d0c29dec65a6f.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libcore-613d407a82430235.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-fcf1fe7dc186f4ac.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/z3n/aurpackages/mesa-git/src/_build32/meson-private/rusttest" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "-m32"
  = note: /usr/bin/ld: i386:x86-64 architecture of input file `/tmp/rustciD3sIT/symbols.o' is incompatible with i386 output
          /usr/bin/ld: i386:x86-64 architecture of input file `/home/z3n/aurpackages/mesa-git/src/_build32/meson-private/rusttest.sanity.7005ba2246a48314-cgu.0.rcgu.o' is incompatible with i386 output
          /usr/bin/ld: i386:x86-64 architecture of input file `/home/z3n/aurpackages/mesa-git/src/_build32/meson-private/rusttest.1sr1pehkcoxvenr2.rcgu.o' is incompatible with i386 output
          /usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libstd-2e78a7bc2eb1cbf1.rlib(std-2e78a7bc2eb1cbf1.std.a6029aee51c3cccb-cgu.0.rcgu.o)' is incompatible with i386 output
          /usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-386bb5d8fe757789.rlib(panic_unwind-386bb5d8fe757789.panic_unwind.4381b57b6c47c6bd-cgu.0.rcgu.o)' is incompatible with i386 output
          /usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libobject-f7f90a882219704e.rlib(object-f7f90a882219704e.object.52a317a4b16d3c4e-cgu.0.rcgu.o)' is incompatible with i386 output
          /usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-e2b0ea1b0a36a0f1.rlib(memchr-e2b0ea1b0a36a0f1.memchr.c709467078f96df1-cgu.0.rcgu.o)' is incompatible with i386 output
          /usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-b2fb1287f428423c.rlib(addr2line-b2fb1287f428423c.addr2line.829aa52e5286145d-cgu.0.rcgu.o)' is incompatible with i386 output
          /usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-d759e97cd39088c4.rlib(gimli-d759e97cd39088c4.gimli.700e35c249a82870-cgu.0.rcgu.o)' is incompatible with i386 output
          /usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-8fc87f7b8682f112.rlib(rustc_demangle-8fc87f7b8682f112.rustc_demangle.5153057ea33d7a78-cgu.0.rcgu.o)' is incompatible with i386 output
          /usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-97e8ab5c6800a97f.rlib(miniz_oxide-97e8ab5c6800a97f.miniz_oxide.ff7da2d8e4cb7128-cgu.0.rcgu.o)' is incompatible with i386 output
          /usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libadler-c0b31298c4436277.rlib(adler-c0b31298c4436277.adler.6d7d72fb429f4e51-cgu.0.rcgu.o)' is incompatible with i386 output
          /usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-04a78a57e8793d26.rlib(alloc-04a78a57e8793d26.alloc.2ebc539667cfb7d0-cgu.0.rcgu.o)' is incompatible with i386 output
          /usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libcore-613d407a82430235.rlib(core-613d407a82430235.core.1d99b162ade4f8d2-cgu.0.rcgu.o)' is incompatible with i386 output
          /usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-fcf1fe7dc186f4ac.rlib(compiler_builtins-fcf1fe7dc186f4ac.compiler_builtins.993d7d174d527116-cgu.074.rcgu.o)' is incompatible with i386 output
          collect2: error: ld returned 1 exit status

error: aborting due to previous error
nutta-git commented 10 months ago

@derEremit I am not seeing this issue.

  1. I saw ccache in your log, can you try to uninstall it and see if it helps.
  2. Use clang instead of gcc, edit customization.cfg and change _compiler="gcc" to _compiler="clang" (line 23)
  3. If that doesn't work can you try with a fresh repo clone (delete your current mesa-git directory, and start anew).

I don't know how to further analyze the logs, so this is as far as I can help.

Etaash-mathamsetty commented 10 months ago

You can't use rusticl on 32 bit yet