Social-Evolution-and-Behavior / anTraX

anTraX: high throughput tracking of color-tagged insects
https://antrax.readthedocs.io/
GNU General Public License v3.0
17 stars 3 forks source link

anTraX with MATLAB 2019a freezes on Ubuntu 20.04 unless ran remotely #5

Closed janamach closed 3 years ago

janamach commented 3 years ago

I have a very strange issue on my Ubuntu 20.04 computer: anTraX does not load GUI's unless I run it remotely (from another computer with ssh -X). I thought this might be a graphics problem, so I purged all nvidia software from the computer. That didn't help.

Here is how it looks locally:

Screenshot from 2021-02-02 17-10-19

And remotely:

2021-02-02_17-05-15

The content for the matlab-antrax.sh file (the first two lines are unnecessary, it loads without them through ssh as well):

alias matlab="LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6 matlab"
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
export ANTRAX_PATH=/home/jana/src/anTraX
export ANTRAX_USE_MCR=False
export ANTRAX_DEBUG_MODE=True

The GUIs (at least most of them) load fine with MCR, so this issue is not critical for me. I thought I should document this peculiarity here in case somebody else runs into this weird problem.

asafgal commented 3 years ago

Thats weird. Can you load matlab itself from the same terminal?

janamach commented 3 years ago

Yes, it loads normally

asafgal commented 3 years ago

Can you try launching the app from the matlab prompt?

antrax('path-to-JS16')
janamach commented 3 years ago

Can you try launching the app from the matlab prompt?

antrax('path-to-JS16')

The GUI loads from the MATLAB prompt, but does not find the session: Screenshot from 2021-02-03 12-34-22

I then realized I've seen this before in #4. Here I thought this issue was fixed because I tried running antrax from home with X forwarding, which worked then and works now for some bizarre reason.

asafgal commented 3 years ago

Let me get it straight:

Is that correct?

janamach commented 3 years ago

I just found the problem... Since it would load properly through ssh -X, I took out the graphics card and booted the computer using its on-board graphics. The GUI loaded properly. In case this can be useful for you in the future I took screenshots to track the "symptoms". Each screenshot shows an attempt to load antrax graph-explorer JS16/:

GeForce GTX 550 Ti + nvidia-driver-390

Screenshot from 2021-02-03 15-27-15

GeForce GTX 550 Ti + generic driver (all nvidia software purged)

Screenshot from 2021-02-03 15-05-38

On-board graphics + generic driver

Screenshot from 2021-02-03 15-16-48

Sorry I bothered you with this all along, the problem was on my side. Thank you again for all your help!

janamach commented 3 years ago

I decided to test the above and installed anTraX on another computer with newer hardware (GeForce GTX 1650, nvidia-driver-430), but older software (Ubuntu 16.04). It loads fine with MATLAB R2019a full installation, but unlike what was discussed in #4 works with libstdc++.so.6 that MATLAB came with.

Do you happen to have an idea why an older GPU/driver is enough for MCR, but not for the full MATLAB installation? I am quite curious now.

asafgal commented 3 years ago

Sorry, no... this is probably a question for for matlab support, but unless it will come up again I'll probably let it be for now. Hopefully at some point in the future I will convert the code to be pure python.

janamach commented 3 years ago

Hopefully at some point in the future I will convert the code to be pure python.

I am not sure if it is worth the effort. I think many of the weird problems I was dealing with were specific to my computers, rewriting the matlab code might just create a different set of problems.

And here's a dramatic turn: if I ssh -X to the Ubuntu 16.04 machine with the better hardware that has MATLAB installed, the matlab GUIs are very unhappy, but if ran locally they are fine. To reiterate -- this computer is the exact opposite to the computer from the first post. The computer that I use to ssh from does not make a difference.

I didn't have any such problems with MCR, it seems to load on all computer both locally and remotely.

janamach commented 3 years ago

Just a quick update on this issue: I swapped GeForce GTX 550 Ti with GeForce GTX 1050 Ti and the problem I described here in the first post persisted with nvidia-driver-390. However, when I upgraded to nvidia-driver-460, the problem went away.

Looks like the old nvidia-driver-390 was causing the weird issues in this case, GeForce GTX 550 Ti is not compatible with newer drivers.