Re: How do I use Mesa drivers on macOS?

John Klimek <[email protected]> Tue, 26 Dec 2023 11:01:01 -0500
Newsgroups gmane.comp.video.mesa3d.user
Message-ID <CAOEv1kYmWXivLf6U39Pbp=9cJsoEsojeV4aqdsddxJq4cazXkg@mail.gmail.com>
--000000000000afa34f060d6bca10
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Thanks very much for the information!

Is it possible to link to the Mesa drivers without modifying the code?

For example, I'm hoping to link EDuke32 (game engine) to Mesa but I'm not
familiar with the code and I thought maybe I could just change the makefile
(or linker flags?) to link Mesa instead of the Apple OpenGL framework.

On Fri, Dec 22, 2023 at 8:05=E2=80=AFAM Randall Frank <randall-frank@outloo=
k.com>
wrote:

> For several of the apps I=E2=80=99ve worked on, the approach has been to =
isolate
> the application OpenGL code into a separate shared library and build it
> twice.  Once vs the system OpenGL and once vs Mesa with name mangling
> enabled, isolating the bindings into two separate shared libraries.  At
> runtime, you can generally load both shared libraries because of the
> namespace isoloation and pick the renderer on the fly as you see fit, or
> just select to load one or the other.  I=E2=80=99ve used Apple OpenGL for=
 onscreen
> and Mesa for batch mode in driver bug cases, printing, etc.  My Mesa
> pipeline usually targets OSMesa contexts in this configuration.
>
>
>
> The approach depends a lot on how your code it structured, but it is an
> approach I=E2=80=99ve used.
>
>
>
> FWIW.
>
>
>
> *From:* mesa-users <[email protected]> *On Behalf
> Of *John Klimek
> *Sent:* Wednesday, December 20, 2023 3:56 PM
> *To:* Martin Pernollet <[email protected]>
> *Cc:* [email protected]
> *Subject:* Re: How do I use Mesa drivers on macOS?
>
>
>
> Yeah I saw that too.  I guess the first step is having somebody confirm
> that Mesa (software drivers at least) work on macOS applications that
> aren't X11 and then proceed to figure out how to use them...
>
>
>
> On Wed, Dec 20, 2023 at 3:31=E2=80=AFPM Martin Pernollet <
> [email protected]> wrote:
>
> This was suggested but I am not sure about this.
>
>
>
> When reading my discussion again I can see that adding X11 library to the
> path did not fixed anything.
>
>
>
>
>
> Le mercredi 20 d=C3=A9cembre 2023 =C3=A0 21:24, John Klimek <jklimek@gmai=
l.com> a
> =C3=A9crit :
>
>
> Thanks very much for the help! I was actually reading that thread as well=
.
>
>
>
> Is it true that Mesa on macOS requires X11 (Xquartz)? If so it's a
> dead-end for me unfortunately.
>
>
>
> On Wed, Dec 20, 2023 at 3:22=E2=80=AFPM Martin Pernollet <
> [email protected]> wrote:
>
> Hi John,
>
>
>
> I built and use Mesa on macOS in the past. You can find my notes here
>
>
>
> https://github.com/jzy3d/vtk-java-wrapper/blob/master/MESA.md
>
>
>
> I however had issues loading Mesa on macOS 11+ which I discussed here
>
>
>
>
> https://community.khronos.org/t/failing-to-load-mesa3d-on-macos-instead-o=
f-macos-provided-opengl-library
> <https://community.khronos.org/t/failing-to-load-mesa3d-on-macos-instead-=
of-macos-provided-opengl-library/108408>
>
>
>
> Maybe that will help you a bit !
>
>
>
> Cheers,
>
>
>
> Martin
>
> Le mercredi 20 d=C3=A9cembre 2023 =C3=A0 19:38, John Klimek <jklimek@gmai=
l.com> a
> =C3=A9crit :
>
>
> Can anybody give me any information on using Mesa under macOS?
>
>
>
> I see that Homebrew also contains prebuilt Mesa binaries but I'm unsure
> how to use them. I know with Windows you simply place the Mesa DLLs
> (opengl32.dll, etc) next to the application executable and it works but I=
'm
> not sure with macOS.
>
>
>
> My goal is to use eduke32 [game engine] with the llvmpipe driver. I can
> compile eduke32 under macOS but again I'm unsure how to implement Mesa.
>
>
>
> Thanks for any help!
>
>
>
>
>
>

--000000000000afa34f060d6bca10
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">Thanks very much for the information!<div=
><br></div><div>Is it possible to link to the Mesa drivers without modifyin=
g the code?</div><div><br></div><div>For example, I&#39;m hoping to link ED=
uke32 (game engine) to Mesa but I&#39;m not familiar with the code and I th=
ought maybe I could just change the makefile (or linker flags?) to link Mes=
a instead of the Apple OpenGL framework.</div></div><br><div class=3D"gmail=
_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, Dec 22, 2023 at 8:05=
=E2=80=AFAM Randall Frank &lt;<a href=3D"mailto:[email protected]">=
[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmai=
l_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;border-lef=
t-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div cla=
ss=3D"msg-3207651698140208476">





<div lang=3D"EN-US" style=3D"overflow-wrap: break-word;">
<div class=3D"m_-3207651698140208476WordSection1">
<p class=3D"MsoNormal">For several of the apps I=E2=80=99ve worked on, the =
approach has been to isolate the application OpenGL code into a separate sh=
ared library and build it twice.=C2=A0 Once vs the system OpenGL and once v=
s Mesa with name mangling enabled, isolating the
 bindings into two separate shared libraries.=C2=A0 At runtime, you can gen=
erally load both shared libraries because of the namespace isoloation and p=
ick the renderer on the fly as you see fit, or just select to load one or t=
he other.=C2=A0 I=E2=80=99ve used Apple OpenGL for
 onscreen and Mesa for batch mode in driver bug cases, printing, etc.=C2=A0=
 My Mesa pipeline usually targets OSMesa contexts in this configuration.<u>=
</u><u></u></p>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
<p class=3D"MsoNormal">The approach depends a lot on how your code it struc=
tured, but it is an approach I=E2=80=99ve used.<u></u><u></u></p>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
<p class=3D"MsoNormal">FWIW.=C2=A0=C2=A0 <u></u><u></u></p>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
<div style=3D"border-width:1pt medium medium;border-style:solid none none;b=
order-color:rgb(225,225,225) currentcolor currentcolor;padding:3pt 0in 0in"=
>
<p class=3D"MsoNormal"><b>From:</b> mesa-users &lt;<a href=3D"mailto:mesa-u=
[email protected]" target=3D"_blank">mesa-users-bounces@li=
sts.freedesktop.org</a>&gt;
<b>On Behalf Of </b>John Klimek<br>
<b>Sent:</b> Wednesday, December 20, 2023 3:56 PM<br>
<b>To:</b> Martin Pernollet &lt;<a href=3D"mailto:martin.pernollet@protonma=
il.com" target=3D"_blank">[email protected]</a>&gt;<br>
<b>Cc:</b> <a href=3D"mailto:[email protected]" target=3D"_b=
lank">[email protected]</a><br>
<b>Subject:</b> Re: How do I use Mesa drivers on macOS?<u></u><u></u></p>
</div>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
<div>
<p class=3D"MsoNormal">Yeah I saw that too.=C2=A0 I guess the first step is=
 having somebody confirm that Mesa (software drivers at least) work on macO=
S applications that aren&#39;t X11 and then proceed to figure out how to us=
e them...<u></u><u></u></p>
</div>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
<div>
<div>
<p class=3D"MsoNormal">On Wed, Dec 20, 2023 at 3:31=E2=80=AFPM Martin Perno=
llet &lt;<a href=3D"mailto:[email protected]" target=3D"_blan=
k">[email protected]</a>&gt; wrote:<u></u><u></u></p>
</div>
<blockquote style=3D"border-width:medium medium medium 1pt;border-style:non=
e none none solid;border-color:currentcolor currentcolor currentcolor rgb(2=
04,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in">
<div>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt;font-family:Arial,sa=
ns-serif">This was suggested but I am not sure about this.<u></u><u></u></s=
pan></p>
</div>
<div>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt;font-family:Arial,sa=
ns-serif"><u></u>=C2=A0<u></u></span></p>
</div>
<div>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt;font-family:Arial,sa=
ns-serif">When reading my discussion again I can see that adding X11 librar=
y to the path did not fixed anything.<u></u><u></u></span></p>
</div>
<div>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt;font-family:Arial,sa=
ns-serif"><u></u>=C2=A0<u></u></span></p>
</div>
<div>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt;font-family:Arial,sa=
ns-serif"><u></u>=C2=A0<u></u></span></p>
</div>
<div>
<p class=3D"MsoNormal">Le mercredi 20 d=C3=A9cembre 2023 =C3=A0 21:24, John=
 Klimek &lt;<a href=3D"mailto:[email protected]" target=3D"_blank">jklimek@=
gmail.com</a>&gt; a =C3=A9crit=C2=A0:<br>
<br>
<br>
<u></u><u></u></p>
<blockquote style=3D"margin-top:5pt;margin-bottom:5pt">
<div>
<p class=3D"MsoNormal">Thanks very much for the help! I was actually readin=
g that thread as well.<u></u><u></u></p>
<div>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
</div>
<div>
<p class=3D"MsoNormal">Is it true that Mesa on macOS requires X11 (Xquartz)=
? If so it&#39;s a dead-end for me unfortunately.<u></u><u></u></p>
</div>
</div>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
<div>
<div>
<p class=3D"MsoNormal">On Wed, Dec 20, 2023 at 3:22=E2=80=AFPM Martin Perno=
llet &lt;<a href=3D"mailto:[email protected]" target=3D"_blan=
k">[email protected]</a>&gt; wrote:<u></u><u></u></p>
</div>
<blockquote style=3D"border-width:medium medium medium 1pt;border-style:non=
e none none solid;border-color:currentcolor currentcolor currentcolor rgb(2=
04,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in">
<div>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt;font-family:Arial,sa=
ns-serif">Hi John,<u></u><u></u></span></p>
</div>
<div>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt;font-family:Arial,sa=
ns-serif"><u></u>=C2=A0<u></u></span></p>
</div>
<div>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt;font-family:Arial,sa=
ns-serif">I built and use Mesa on macOS in the past. You can find my notes =
here<u></u><u></u></span></p>
</div>
<div>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt;font-family:Arial,sa=
ns-serif"><u></u>=C2=A0<u></u></span></p>
</div>
<div>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt;font-family:Arial,sa=
ns-serif"><a href=3D"https://github.com/jzy3d/vtk-java-wrapper/blob/master/=
MESA.md" target=3D"_blank">https://github.com/jzy3d/vtk-java-wrapper/blob/m=
aster/MESA.md</a><u></u><u></u></span></p>
</div>
<div>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt;font-family:Arial,sa=
ns-serif"><u></u>=C2=A0<u></u></span></p>
</div>
<div>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt;font-family:Arial,sa=
ns-serif">I however had issues loading Mesa on macOS 11+ which I discussed =
here<u></u><u></u></span></p>
</div>
<div>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt;font-family:Arial,sa=
ns-serif"><u></u>=C2=A0<u></u></span></p>
</div>
<div>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt;font-family:Arial,sa=
ns-serif"><a href=3D"https://community.khronos.org/t/failing-to-load-mesa3d=
-on-macos-instead-of-macos-provided-opengl-library/108408" target=3D"_blank=
">https://community.khronos.org/t/failing-to-load-mesa3d-on-macos-instead-o=
f-macos-provided-opengl-library</a><u></u><u></u></span></p>
</div>
<div>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt;font-family:Arial,sa=
ns-serif"><u></u>=C2=A0<u></u></span></p>
</div>
<div>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt;font-family:Arial,sa=
ns-serif">Maybe that will help you a bit !
<u></u><u></u></span></p>
</div>
<div>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt;font-family:Arial,sa=
ns-serif"><u></u>=C2=A0<u></u></span></p>
</div>
<div>
<div>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt;font-family:Arial,sa=
ns-serif">Cheers,<u></u><u></u></span></p>
</div>
<div>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt;font-family:Arial,sa=
ns-serif"><u></u>=C2=A0<u></u></span></p>
</div>
<div>
<p class=3D"MsoNormal"><span style=3D"font-size:10.5pt;font-family:Arial,sa=
ns-serif">Martin<u></u><u></u></span></p>
</div>
</div>
<div>
<p class=3D"MsoNormal">Le mercredi 20 d=C3=A9cembre 2023 =C3=A0 19:38, John=
 Klimek &lt;<a href=3D"mailto:[email protected]" target=3D"_blank">jklimek@=
gmail.com</a>&gt; a =C3=A9crit :<br>
<br>
<br>
<u></u><u></u></p>
<blockquote style=3D"margin-top:5pt;margin-bottom:5pt">
<div>
<p class=3D"MsoNormal">Can anybody give me any information on using Mesa un=
der macOS?<u></u><u></u></p>
<div>
<div>
<div>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
</div>
<div>
<p class=3D"MsoNormal">I see that Homebrew also contains prebuilt Mesa bina=
ries but I&#39;m unsure how to use them. I know with Windows you simply pla=
ce the Mesa DLLs (opengl32.dll, etc) next to the application executable and=
 it works but I&#39;m not sure with macOS.<u></u><u></u></p>
</div>
<div>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
</div>
<div>
<p class=3D"MsoNormal">My goal is to use eduke32 [game engine] with the llv=
mpipe driver. I can compile eduke32 under macOS but again I&#39;m unsure ho=
w to implement Mesa.<u></u><u></u></p>
</div>
<div>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
</div>
<div>
<p class=3D"MsoNormal">Thanks for any help!<u></u><u></u></p>
</div>
</div>
</div>
</div>
</blockquote>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
</div>
</blockquote>
</div>
</blockquote>
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p>
</div>
</blockquote>
</div>
</div>
</div>

</div></blockquote></div></div>

--000000000000afa34f060d6bca10--