Close

Page 1 of 4 123 ... LastLast
Results 1 to 10 of 34
  1. #1
    Super-Moderator epigramx's Avatar
    Join Date
    13.09.2017
    Posts
    330

    Mesa-mild manual compilation instructions (to avoid docker and the like)



    For people already familiar with linux' ways, compiling mesa is relatively straightforward (it's a standard ./configure; make; make install thing), however, it does have some caveats mainly during ./configure and keeping it sandboxed from main system mesa and final launching options hence this little guide.

    The guide assumes debian sid, but it should be easily equivalent in all distros since the building and launching are basically identical everywhere

    1. Get mesa mild: (enter a working dir ideally to not spam your home dir; e.g. mkdir ~/mesa_source; cd ~/mesa_source)

    git clone --depth 1 https://github.com/mikakev1/mesa_mild_compatibility.git

    (--depth 1 kills the git history to get it faster; if it fails, omit that)

    If you don't have git, get it from your distro, e.g. sudo apt-get install git

    2. Get the dependencies to build it e.g. on sid:

    sudo apt-get build-dep mesa

    Note: for a few other distros the equivalent command can be found under "1.2 Requirements" here (ignore the rest of that page).

    3. Enter mesa_mild_compatibility/ and prepare it with autogen

    ./autogen.sh

    It may fail at first configure (it launches it without asking) but don't care, we need other options anyway

    4. Configure it, but not with just a ./configure, it needs some options and to be "sandboxed" with a --prefix to not disrupt system's mesa (it may fail to bring up a windows environment otherwise)

    a) Make sure you have:

    latest libdrm/libdrm-dev
    latest llvm/llvm-dev: preferably version 7 (currently) (it solves bugs with latest AMDs)

    b) If you installed any of the tools required to /usr/local/lib (with a standard ./configure; make; make install, e.g. for libdrm if your system didn't have the latest) you might need to point ./configure to it with LD_LIBRARY_PATH.

    c) A complete ./configure line as an example:

    LD_LIBRARY_PATH=/usr/local/lib ./configure --with-llvm-prefix=/usr/lib/llvm-7/ --with-gallium-drivers=radeonsi --with-dri-drivers=radeon,swrast --enable-texture-float --prefix=$HOME/mesa_mild --with-vulkan-drivers=radeon

    ($HOME instead of "~" above is usually a requirement)

    That line basically "sandboxes" mesa later on to ~/mesa_mild/ so it doesn't disrupt the main mesa (we'll tell wine/cemu where to find it later), it instructs it to use llvm-7 (try to install the latest in any case), it compiles only the radeonsi gallium driver (old AMD cards may need another), dri drivers are included, and it includes the buggy (currently) vulkan driver as a bonus (unnecessary for Cemu but you may want it).

    Note: To detect llvm on some systems, it might be only a matter of not using --with-llvm-prefix=[..] at all since llvm-config might reside in the expected path (/usr/bin/) (even if it's the latest).

    Absolutely crucial (on current mesa at least) is that --enable-texture-float is included(at least BotW will fail to render properly without it) (the above line includes it). In case you wonder why the hell isn't that the default, it's apparently because of patenting issues.

    Scroll up slightly after configuration to make sure it got what you need:

    (e.g. here we see llvm 7 being properly detected, as well as radeonsi gallium will be built for newer AMD cards)

    5. Just build and install now

    make -j 8 install (not even root is needed because we install to a --prefix that points to home in this example; -j 8 instructs it to use 8 threads).

    (Note: if you hit a quirk that the above line restarts a vanilla ./configure, cancel it and do 'make -j 8' and 'make install' separately)

    Now, before final launching:

    6. You may need a new-ish linux kernel (ideally) and in the case of newer AMD cards to restrict it to using AMDGPU instead of the radeon module if your distro doesn't do that otherwise already.

    e.g. for an R9 290, and with grub on sid edit /etc/default/grub, and edit/make the line:

    GRUB_CMDLINE_LINUX="radeon.si_support=0 radeon.cik_support=0 amdgpu.si_support=1 amdgpu.cik_support=1"

    and then

    update-grub

    and reboot (which will instruct the kernel to only go with amdgpu instead of radeon)

    7. In case you haven't done that already or your distro hasn't, you may need to get a firmware-amd-graphics (or equivalent) package

    In the case of debian sid that is required to be done manually at some point because it considers it "non-free".

    so install firmware-amd-graphics, after you have included non-free in apt's sources list (google how)/reboot.

    8. If you haven't done that already, edit Cemu.exe from #version 420 to #version 450 (search "version 420" in a text editor) per the main mesa mild readme and while you're at it keep in mind the info of that readme in general.

    9. And a magic line to launch Cemu (this line includes the required driconf settings on top so no need to fiddle with those either and you may want to not fiddle with .drirc at all to begin with to not disrupt the main system).

    allow_minus_one_index_uniform=true allow_extended_primitive_type=true allow_gl_extensions_in_core=true allow_relaxed_vbo_validation=true mesa_glthread=true force_glsl_extensions_warn=true allow_relaxed_core_profile=true allow_higher_compat_version=true LD_LIBRARY_PATH=~/mesa_mild/lib/ MESA_GL_VERSION_OVERRIDE=4.5COMPAT wine64 Cemu.exe

    The first few variables are basically a replacement to a .drirc/driconf in the form of env vars, then there is a LD_LIBRARY_PATH to point to our "sandboxed" mesa

    You can obviously turn that line into a script by putting it into an .sh and chmod +x that .sh, but if you do, you might want to also add on top a "cd <PATH TO CEMU>"(change that to a path to cemu) so that you don't have to run it only when inside that dir.

    This guide assumes you already had a recent wine, but if you don't e.g. for debian get it from here https://wiki.winehq.org/Debian (But in general Cemu isn't very picky about wine versions, it works with the stable version too, no need for staging or -devel etc.).

    10. Enjoy. If you didn't 'enjoy', just go through the steps carefully and change what you need for your system (e.g. user name and paths and dependencies needed to be installed) because this guide isn't meant to show the basics of linux (that can be googled very easily) but the quirks specifically about Cemu and mesa mild that can't be googled almost at all.

    PS. For information regarding specific GPU models and specific games see this reply.
    Last edited by epigramx; 18.06.2018 at 20:08.

  2. #2
    New user
    Join Date
    20.01.2018
    Posts
    8
    Excellent guide! Thanks for that!

  3. #3
    Hey, thanks for the guide!
    However, how did you get llvm-7 installed? I am on latest Manjaro Distro.

    Thanks!

  4. #4
    Super-Moderator epigramx's Avatar
    Join Date
    13.09.2017
    Posts
    330
    See if there is a package available or compile it yourself (but that might be daunting). I'm gonna be honest here; I don't get why people use novel distros like that and not something very established like debian sid before going there. Is it because they were told by the mesa mild maintainer in this case?

    In any case, it's linux, even if it doesn't exist precompiled, it's compilable.

    Granted, in this case it is cutting edge, since 7 is unreleased.

  5. #5
    Super-Moderator
    Join Date
    13.09.2017
    Posts
    262
    Quote Originally Posted by Zacharybinx34 View Post
    Hey, thanks for the guide!
    However, how did you get llvm-7 installed? I am on latest Manjaro Distro.

    Thanks!
    IIRC Add the following to pacman.conf. And install llvm-svn.
    [mesa-git]
    Server = http://pkgbuild.com/~lcarlier/$repo/$arch
    SigLevel = Never

    Quote Originally Posted by epigramx View Post
    I don't get why people use novel distros like that ...
    Welcome to Linux. And no he only advises to use arch.

  6. #6
    Super-Moderator epigramx's Avatar
    Join Date
    13.09.2017
    Posts
    330
    I've been using linux for many years. The comment is mainly in reference to new users of it that seem to often go to very immature distros, when they could start first on something more established.

    Main problem is I guess that they don't know often what is more established and go with what is (ephemerally) popular or what they are told to.


    There's often also the misconception that linux has "very easy" and "very hard" distros only when most of the established ones are similarly easy to use anyway but at the same time ALL distros require from their users to become eventually power users in order to take full advantage of it anyway. So, one would ideally want the widest support of packaging from a well established distro community and shouldn't rely much on what is "easy to install at first" because that's a very small part of it.
    Last edited by epigramx; 02.03.2018 at 07:45.

  7. #7
    Quote Originally Posted by epigramx View Post
    I've been using linux for many years. The comment is mainly in reference to new users of it that seem to often go to very immature distros, when they could start first on something more established.

    Main problem is I guess that they don't know often what is more established and go with what is (ephemerally) popular or what they are told to.


    There's often also the misconception that linux has "very easy" and "very hard" distros only when most of the established ones are similarly easy to use anyway but at the same time ALL distros require from their users to become eventually power users in order to take full advantage of it anyway. So, one would ideally want the widest support of packaging from a well established distro community and shouldn't rely much on what is "easy to install at first" because that's a very small part of it.
    When running the command

    LD_LIBRARY_PATH=/usr/local/lib ./configure --with-llvm-prefix=/usr/lib/llvm-7/ --with-gallium-drivers=radeonsi --with-dri-drivers=radeon,swrast --enable-texture-float --prefix=/home/Zach/mesa_mild --with-vulkan-drivers=radeon

    I get the error:
    configure: error: --enable-llvm selected but llvm-config is not found

    Any ideas?

  8. #8
    Super-Moderator epigramx's Avatar
    Join Date
    13.09.2017
    Posts
    330
    Quote Originally Posted by Zacharybinx34 View Post
    When running the command

    LD_LIBRARY_PATH=/usr/local/lib ./configure --with-llvm-prefix=/usr/lib/llvm-7/ --with-gallium-drivers=radeonsi --with-dri-drivers=radeon,swrast --enable-texture-float --prefix=/home/Zach/mesa_mild --with-vulkan-drivers=radeon

    I get the error:
    configure: error: --enable-llvm selected but llvm-config is not found

    Any ideas?
    Yes, that's simply that it doesn't find llvm at /usr/lib/llvm-7/ which is the location debian sid installs llvm 7 (if those packages are installed). If what Xalphenos suggested to you does work, it might be at another location.

    By a quick look at a URL included in his post, it seems to be at /usr/lib (so you could replace to that at the ./configure line you posted here) but I can't be certain it's enough.


    edit: If it resides in /usr/lib, it's probably that that arch set simply overrides the system llvm entirely. Kinda crude if you ask me but it might work without side-effects.
    Last edited by epigramx; 03.03.2018 at 06:03.

  9. #9
    Quote Originally Posted by epigramx View Post
    Yes, that's simply that it doesn't find llvm at /usr/lib/llvm-7/ which is the location debian sid installs llvm 7 (if those packages are installed). If what Xalphenos suggested to you does work, it might be at another location.

    By a quick look at a URL included in his post, it seems to be at /usr/lib (so you could replace to that at the ./configure line you posted here) but I can't be certain it's enough.


    edit: If it resides in /usr/lib, it's probably that that arch set simply overrides the system llvm entirely. Kinda crude if you ask me but it might work without side-effects.

    I am on Manjaro, and to be honest, I'm not sure what you're suggesting. Could you be a little more specific plz?

    Thanks

  10. #10
    Super-Moderator epigramx's Avatar
    Join Date
    13.09.2017
    Posts
    330
    If you read the ./configure line you'll notice it includes a --with-llvm-prefix=/usr/lib/llvm-7 which points to llvm's installation location. Try to point it to /usr/lib instead in your case.

    Read also what Xalphenos said to you in case you haven't (it will probably install latest llvm in /usr/lib).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •