Search Unity

Running Linux Editor on Dedicated Graphics

Discussion in 'Linux Editor' started by Revilix, Aug 5, 2019.

  1. Revilix

    Revilix

    Joined:
    Apr 13, 2016
    Posts:
    3
    Hello guys, I only recently switched over from Windows to Debian 10, so I'm inclined to believe that the solution to my problem may be obvious. In that case, this may prevent other noobs from asking in the future.

    I've spent the last two days on finding a solution for using dedicated graphics in Unity. Bumblebee and Primus work well for other programs already. And one of the older threads from before Unity-Hub times showed a solution by simply running optirun on the Unity executable. This seems to work differently since Unity-Hub.

    • I run the hub from the Appimage and everything works perfectly with intel graphics. Yet, when I attempt to optirun that same file the terminal tells me: Gtk-Message: 20:11:17.582: Failed to load module "canberra-gtk-module".
    • I naturally also asked myself, whether running unity-hub through optirun would even be sensible, since it is only the launcher of the actual editor, which wouldn't be run on dedicated graphics. Is that reasoning wrong?
    • Lastly, I attempted to avoid hub and run the Unity file directly from ~/Programs/Unity3D/2019.2.0f1/Editor/Unity. This did not work for me and returned: error while loading shared libraries: libgconf-2.so.4: cannot open shared object file: No such file or directory.
    As you can see, I have no idea how to launch Unity via optirun. Please save me.
     
  2. Muhamad_Faizol

    Muhamad_Faizol

    Joined:
    Jan 21, 2017
    Posts:
    40
    Hi,

    As for "camberra-gtk-module", have you tried to reinstall the package?
    https://askubuntu.com/questions/342...ule-canberra-gtk-module-but-already-installed

    I am using Fedora with KDE desktop, and the way I do is to run UnityHubSetup.AppImage using primusrun. So far the experience is pretty smooth, except for some minor issues (like lagging in Unity's panel resizing and dragging. Panel resizing is more responsive using Intel's integrated gpu). Hope that helps.
     
    Revilix likes this.
  3. Revilix

    Revilix

    Joined:
    Apr 13, 2016
    Posts:
    3
    Thanks a bunch! I had read on some other thread that there would be issues if I installed that library, but it worked for me!
    I also modified my .desktop file to always execute Unity-Hub via optirun. Unfortunately, after closing the Unity-Editor some processes keep running and my dedicated graphics card isn't switched off. By running ps -ax I got this:

    4464 tty2 S+ 0:00 optirun /home/dom/Downloads/UnityHubSetup.AppImage
    4466 ? Ssl 0:00 /usr/lib/xorg/Xorg :8 -config /etc/bumblebee/xorg.con
    4471 ? S 0:00 [nvidia-modeset]
    4476 tty2 Sl+ 0:02 /tmp/.mount_UnityHpui3R8/unityhub
    4479 ? Ssl 0:01 /home/dom/Downloads/UnityHubSetup.AppImage
    4495 tty2 S+ 0:00 /tmp/.mount_UnityHpui3R8/unityhub --type=zygote --no-
    4524 tty2 Sl+ 0:00 /tmp/.mount_UnityHpui3R8/unityhub --type=gpu-process
    4538 tty2 Sl+ 0:01 /tmp/.mount_UnityHpui3R8/unityhub --type=renderer --n

    Did you maybe experience a similar issue?
     
  4. Muhamad_Faizol

    Muhamad_Faizol

    Joined:
    Jan 21, 2017
    Posts:
    40
    Have you tried running Unity using primusrun? I didn't use optirun coz optirun used to be less stable than primusrun before, but I don't know if that is still the case. So far I don't have any problem in switching between using integrated gpu and dedicated gpu when I run Unity using primusrun.

    Why don't you try primusrun first, and report back if the problem is still there?
     
    Revilix likes this.
  5. Revilix

    Revilix

    Joined:
    Apr 13, 2016
    Posts:
    3
    Alright, I tried out a few cases. Since my initial goal was to get Unity to work from the Gnome Applications shortcut, I tried passing optirun/primusrun as arguments of the "Exec="-line within the .desktop file. Both let me start and use Unity with dedicated graphics. Unfortunately, once I closed the application, the processes kept running and the Nvidia card wasn't turned off (comp. my post above).

    This outcome does not occur when (opti-/primus-)running UnityHubSetup.AppImage directly from command line. In this case you have a terminal open in parallel, which properly kills all unity processes, once closed.

    So, for me this is a good enough solution. If anyone got the .desktop file to work, please tell me :)