Oscar Domingo - Software Engineer. Personal website of Oscar Domingo, a software engineer. Zola 2024-05-03T20:35:33.388313969+00:00 https://www.oscardomingo.com/feed.xml/ Installing Maya on a Rocky Linux 9 container 2024-05-03T00:00:00+00:00 2024-05-03T00:00:00+00:00 https://www.oscardomingo.com/blog/installing-maya-on-a-rocky-linux-9-container/ <p>I've recently crafted a <code>dockerfile</code> which will install Maya in an OCI compatible Rocky Linux 9.2 image, which then can be used to create <code>distrobox</code> (or <code>toolbx</code>) compatible containers, on the process I've learned a couple of &quot;tricks&quot; when it comes to debugging what a binary needs in order to work.</p> <p>As of this writing, the runtime packages needed to run Maya 2024 are the following:</p> <pre style="background-color:#282828;color:#fdf4c1aa;"><code><span>libpng libjpeg libtiff freetype libXpm libXi fontconfig libXinerama alsa-lib libXcomposite libXdamage libXrandr libXrender libXtst libxcrypt-compat libxkbcommon nspr nss nss-util pciutils-libs libnsl xcb-util-wm xcb-util-image xcb-util-image xcb-util-renderutil libxkbcommon-x11 libmng libXcursor </span></code></pre> <p>Historically, whenever I faced this situation, after installing the officially specified packages from the Maya Help page and still not getting it to launch (???), I would be running <code>maya</code> , note whatever <code>.so</code> failed to load, do a <code>dnf provides &lt;library-name&gt;.so</code>, then installing the package that had it, rinse and repeat.</p> <p>Well that is not fun isn't it? (Maybe the first time you do it yes, but when you had had to do this for the <code>n</code>th time you start wondering why Autodesk likes to punish their users this way).</p> <p>So some shortcuts I discovered this time around are <code>ldd</code> and <code>QT_DEBUG_PLUGINS=1</code>, I knew about the former, but never clicked that it would work for this, is you run: <code>ldd /path/to/maya.bin</code> notice the <code>bin</code> which is the actual binary run after some round trips following symbolic links and the python file that sets up some environment variables.</p> <p>If we chain it with grep: <code>ldd /path/to/maya.bin | grep not</code> we'll get a list of all missing libraries in our system, example:</p> <pre style="background-color:#282828;color:#fdf4c1aa;"><code><span>ldd /usr/autodesk/maya2024/bin/maya.bin | grep &quot;not found&quot; </span><span> libcrypt.so.1 =&gt; not found </span><span> libsmime3.so =&gt; not found </span><span> libnss3.so =&gt; not found </span><span> libnssutil3.so =&gt; not found </span><span> libplds4.so =&gt; not found </span><span> libplc4.so =&gt; not found </span><span> libnspr4.so =&gt; not found </span><span> libXcomposite.so.1 =&gt; not found </span><span> libXdamage.so.1 =&gt; not found </span><span> libXrender.so.1 =&gt; not found </span><span> libXrandr.so.2 =&gt; not found </span><span> libXtst.so.6 =&gt; not found </span><span> libxkbcommon.so.0 =&gt; not found </span><span> libpci.so.3 =&gt; not found </span><span> libasound.so.2 =&gt; not found </span></code></pre> <p>You can then come out with a list to pass to <code>dnf provides</code>, such as:</p> <pre style="background-color:#282828;color:#fdf4c1aa;"><code><span>dnf provides libcrypt.so.1 libsmime3.so libnss3.so libnssutil3.so libplds4.so libplc4.so libnspr4.so libXcomposite.so.1 libXdamage.so.1 libXrender.so.1 libXrandr.so.2 libXtst.so.6 libxkbcommon.so.0 libpci.so.3 libasound.so.2 </span></code></pre> <p>And then install every package that shows up in that command, pretty sure all this could be automated with either a <code>python</code> script or some <del>mad</del> brilliant bash one liner.</p> <p>Anyhow, we got all the things we need to launch maya, right? Right? I guess it would be too easy on IT/Pipe devs so once you launch you'll be greeted with the infamous:</p> <pre style="background-color:#282828;color:#fdf4c1aa;"><code><span>qt.qpa.plugin: Could not load the Qt platform plugin &quot;xcb&quot; in &quot;&quot; even though it was found. </span><span>This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. </span><span> </span><span>Available platform plugins are: linuxfb, minimal, offscreen, vnc, xcb. </span></code></pre> <p>Okay, what now then... you can google that, and chances is you'll end up installing a package that does fix it, but in the effort of keeping the <code>image</code> as slim as possible, I just want to install what's absolutely necessary for me to open maya, debug whatever esoteric self-inflicted issue, fix it, close it and hopefully never have to open it again (hah).</p> <p>Enter <code>QT_DEBUG_PLUGINS=1 maya</code> , <a rel="noopener" target="_blank" href="https://stackoverflow.com/a/76213596">credit to this SO answer</a>, this will dump a lot of <code>Qt</code> related information and errors, we can use grep again such as: <code>QT_DEBUG_PLUGINS=1 maya | grep cannot</code> which will provide us again a list of <code>x11</code> related libraries we need to install in order to get <code>maya</code> to open.</p> <p>There you have it, go and push some pixels; in an ideal world, Autodesk would have caught up by now with better ways to <a rel="noopener" target="_blank" href="https://forums.autodesk.com/t5/maya-ideas/appimage-flatpak-or-snap-for-linux/idi-p/9235510">distribute their Linux software</a> (please vote if you can?) or maybe declare the dependencies on their <code>rpms</code> (even tho vendored <code>tcl</code> and <code>tk</code> conflict with what you get when installing with <code>dnf</code> so go figure) but for the time being we'll left to suffer.</p> <p>I'll be that guy and tell you to push for <a rel="noopener" target="_blank" href="https://www.blender.org/">Blender</a> at your company, and if they can donate or contribute back the better :)</p> Hello World 2024-04-18T00:00:00+00:00 2024-04-18T00:00:00+00:00 https://www.oscardomingo.com/blog/hello-world/ <p>This might be the third or fourth attempt at kickstarting a blog, I intend to make this one stick by participating in <a rel="noopener" target="_blank" href="https://100daystooffload.com">100 Days To Offload</a>.</p> <h2 id="mynt">Mynt</h2> <p>The previous iteration of this site was generated using <a rel="noopener" target="_blank" href="https://github.com/uhnomoli/mynt">mynt</a> a Python static site generator, but I did not really follow through on writing, and after trying to publish again, experienced some paper cuts trying to get it to generate my site (syntax highlighting stopped working, for example), went through a couple of weeks of overthinking to update <code>mynt</code>, forking it or developing a whole new static site generator in Python in the spirit of <code>mynt</code>; long story short, I procrastinated on writing, whether if I end up doing any of these remains to be seen, but goes without saying it's not a problem that I am particularly interested in solving <a rel="noopener" target="_blank" href="https://jamstack.org/generators/">and it's pretty much solved</a>.</p> <h2 id="zola">Zola</h2> <p>Enter <a rel="noopener" target="_blank" href="https://www.getzola.org">zola</a>, version 18 at the time of this writing, is a Rust powered static site generator, which I can vendor the binary in the project itself, which should make it more portable and durable.</p> <p>The structure is not that different from what I had with <code>mynt</code> so transition has been quite easy, mostly reshuffling things around, so quite happy with that. Previous site used to have a &quot;projects&quot; section, with only two projects, which can be seen on my GitHub anyway, so decided to remove it, the other thing I am not adding in the first iteration are tags.</p> <h2 id="onwards">Onwards</h2> <p>I am not sure what to write really, I will keep the blog as open ended topic, but most likely will fall in the technology realm, I have some stuff written already, so will start by polishing those and publishing it.</p>