Running Tobii Pro Eye Tracker on Linux - possible xorg file conflict?

NJU739EE- 2022520114942:01f960c54c9ad357c32d17714aaa8fa8ea0a07f592d5cd5afa54092162e72bb3

Hi all,

I have recently purchased a Tobii Pro Spectrum eye tracker and am trying to set it up to run on my Ubuntu 22.04 setup (Ubuntu 22.04.5 64-bit with GNOME Version 42.9 and X11 windowing). As the very first step, I have downloaded the Tobii Pro Eye Tracker Manager for Linux from their website, but it will not run! I keep getting this error:

libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)

The Tobii support people say it’s an error with libva rather than with their software, and pointed me towards this Github issue:

https://github.com/intel/libva/issues/278

However, I could not find a solution there that worked.

Further googling of the error message led me to this:

https://askubuntu.com/questions/455861/va-getdrivername-failed-with-unknown

… which mentions the xorg.conf file, which I recall I had to specifically create earlier to run the ViewPixx correctly on my setup. I have a strong suspicion that this may be the culprit, but am unsure how to fix it.

Any ideas?

Thanks!

Deborah.

Hi Deborah and happy new year!

This is not really a Psychtoolbox related issue, so not sure how much help I could be, I can only speculate. Actually I’d expect that Tobii customer support is there to help fix Tobii issues, regardless if it is a direct problem of their software or not, given the price of the system and that most of the value is in software and expertise.

The xorg.conf file doesn’t seem likely, but if that would be somehow related then moving the file out of the /etc/X11/xorg.conf.d/ folder, followed by a logout + login, should fix it. XOrgConfSelector + selecting option 0 does delete the file.

I’m not sure why that error would prevent a startup of an eye tracker app. libva is used for hardware accelerated video encoding and decoding, ie. recording or playback of eye movies? I could see that interfering with some eye recording, but why it would prevent startup of such an app, as opposed to just hw accelerated recording, I don’t know. Even then, one would expect the application to just fall back to slower/less efficient software encoding.

Maybe some video acceleration drivers are missing? What graphics cards does this machine have? Output of xrandr --listproviders?
What is the terminal output of vainfo? Is the package va-driver-all installed, ie. sudo apt install va-driver-all?

[16 minutes out of 30 minutes paid support used - L328]

Hi Mario,

Thanks so much for your reply. Yes, I know, it’s not really a PTB problem except that I hope eventually to use the tracker in conjunction with my PTB/Linux setup, and that I thought perhaps it was my PTB xorg setup interfering. But also you are one of the most knowledgeable people I know on Ubuntu/Linux setups, and you also respond to queries with lightning speed, so thank you again!

$ xrandr --listproviders
Providers: number : 1
Provider 0: id: 0x1b7 cap: 0x1, Source Output crtcs: 3 outputs: 7 associated providers: 0 name:NVIDIA-0

Yes, the va-driver-all package is installed, but output of vainfo is this:

$ vainfo
libva info: VA-API version 1.14.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/nvidia_drv_video.so
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

So it looks as if the nvidia drivers are missing? Do I need to install the proprietary drivers? Shouldn’t this just be the libva drivers that should have been installed with the package?

I’ll try moving the xorg.conf.d folder and report back. [UPDATE: I tried this and it made no difference to the error messages, just stuffed up my windowing. So I moved it back.]

I agree that this should not stop the software working - I also agree that the support is disappointing. The latest response was this: "As the Eye Tracker Manager is successfully installed, and the current issue is with how the libva library is causing issues with the GPU processes. Alternatively, it could also be an issue with how libva is interacting with Chromium components, as you mentioned Google Chrome is also encountering errors. " So maybe this is something to do with Chromium? They also say, “As we have received no other reports of issues with Eye Tracker Manager and Ubuntu, I would suggest reviewing if there are any permissions issues on your machine and verify if the libva library is correctly set up.”

However, Diederick Niehorster tells me they know there are issues with the Tobii on Linux (he has been very helpful with advice on the Titta toolbox), so I think they are being a little disingenuous here.

Thanks again

Deborah.

You don’t need to move the whole xorg.conf.d folder, just the one .conf file inside to a name not ending on .conf.

Ok, so this is a desktop machine with only a NVidia graphics card (the NVidia GeForce GTX 1060?), nothing else, not that hybrid graphics Dell laptop of yours with Intel+NVidia from a previous issue?

Does the file /usr/lib/x86_64-linux-gnu/dri/nvidia_drv_video.so exist, e.g., if you try ls /usr/lib/x86_64-linux-gnu/dri/nvidia_drv_video.so to list it in a terminal?

What output if you run LIBVA_TRACE=1 vainfo?

Hi Deborah,

They have known issues with discovering eye trackers through the SDK on Ubuntu, at least on the 1.xx SDK series that i still use (I have to come up with some shenanigans to also support 2.x [which should include fixes for this] as it drops support for any non-current eye tracker). Hence in our email i suggested to hardcode the address of the eye tracker. I am not familiar with any issues with eye tracker manager. But its an electron app, so if Chromium doesn’t work, it may be the same issue.

Cheers,
Dee

Thanks Dee,

I have discovered that Chromium DOES work! So it’s not that.

I think I have the latest SDK but that also isn’t helping. I tried hard coding the address in the Titta code but also no dice. I can’t help feeling it’s still something to do with X11 and/or the nVidia drivers, but I am not enough of an expert to work out how.

Thanks for your help, much appreciated! We will get to the bottom of this and then it will help others (and future me, when I forget all of this).

Cheers

Deborah.

Have you seen the other questions I asked in my last post?

My suspicion (after looking at libva source code and the error messages, and some more web search) for the VAAPI / libva failure is that NVidia graphics cards under the proprietary NVidia driver do not support VAAPI at all, so the mentioned required nvidia_drv_video.so driver file will be missing. NVidia seems to have no interest in supporting this properly with their proprietary drivers.

Apparently there is a community developed driver for hardware accelerated VAAPI video playback decoding, not video encoding though:

This driver is available - in a very outdated version with various known bugs and limitations - in Ubuntu 24.04-LTS. On older Ubuntu versions, or for the most capable driver, you would have to follow the instructions on that website to manually download+compile+install the driver yourself.

Another option might be to install the open-source nouveau driver for NVidia graphics, which seems to support VAAPI on NVidia. The downside being that achievable graphics performance would fall down to ~5% of that of the proprietary driver on half-way non-ancient NVidia gpu’s at least on anything sold during at least the last 10 years - only suitable for simple visual stimulation tasks with low performance requirements.

So in the end it might boil down to my usual “Avoid NVidia graphics unless you have a good reason” recommendation, as NVidia is often the special snowflake. There are other video de/encoding acceleration api’s on Linux as well, e.g., NVidia’s NVEnc/NVDec and NVidia’s older VDPAU, which is stuff that would get used by Psychtoolbox itself indirectly via GStreamer for movie playback and encoding. But if Tobii Pro Eye Tracker Manager does not support these and requires VAAPI, then that obviously doesn’t help you.

Intel and AMD graphics cards generally support VAAPI video acceleration, see also:
https://wiki.archlinux.org/title/Hardware_video_acceleration

The other question would be if the “libva error” is really the actual reason that Tobii Eye Tracker Manager fails to start, or if this is just a red herring and the reason for failure is a different one, and you could do without the VAAPI support for your use cases. Only Tobii support would know for sure, or if one can work around it.

Or if the machine also has a built-in Intel graphics chip like one of your dual-gpu Dell laptops, if one could trick the software into using the Intel gpu for VAAPI purposes. Don’t know, but a command like LIBVA_DRIVER_NAME=i965 vainfo or LIBVA_DRIVER_NAME=iHD vainfo would force VAAPI to try to use an Intel gpu if any, replacing vainfo with the start command for Tobii Eye Tracker Manager if vainfo at least succeeds.

Various options. In a PC you could replace the NVidia gpu by a AMD gpu if push comes to shove and other cheaper options fail and if that is really the obstacle to using the Tobii software.

[Over 90 minutes out of 30 minutes paid support used - paid support completely exhausted - L328]

Hi Mario,

Sorry, missed this yesterday. The nvidia_drv_video.so does not exist. The output of LIBVA_TRACE=1 vainfo is vainfo: symbol lookup error: /lib/x86_64-linux-gnu/libva-x11.so.2: undefined symbol: va_fool_postp

I’ll reply to your more recent post below.

Thanks!

Deborah.

Also, yeah it only has the nVidia card as it’s a custom build desktop.

I installed the latest libva via github as recommended on their github, and this seems to have included some noveau drivers, and now I’m no longer getting the libva error. However, I’m getting another mysterious error, so I think the problem isn’t really libva but something else. I will go back to the Tobii support people with this error, since I’ve now used up more of your time than I have paid for!

Thanks

Deborah.

Ok, so it is NVidia or nothing.

Not what I would have tried at that point, but sure, shouldn’t hurt if done properly. The latest versions do use additional/refined detection logic (based on DRI3 instead of the older DRI2 method) for the VAAPI driver to choose. In any case, one can always override the driver to choose with the LIBVA_DRIVER_NAME= environment variable. E.g., LIBVA_DRIVER_NAME=nouveau vainfo to execute the vainfo command while trying to use a installed nouveau VAAPI driver instead of whatever libva - usually correctly - decided to choose automatically.

libva does not ship any backend VAAPI drivers, but the already installed va-drivers-all package does include nouveau. However, your machine seems to have the proprietary NVidia graphics and display driver installed, and that driver and the open-source nouveau driver are normally mutually exclusive, so it would be surprising if the nouveau VAAPI driver would work while NVidia graphics+display driver is installed and active, or that it would be chosen by libva, given that libva checks which kernel display driver is active and then chooses a corresponding VAAPI driver that is compatible with that kernel driver.
In theory, nouveau VAAPI might get loaded, but I would expect it then to fail to initialize with a different libva error message or warning.

What is the output of vainfo now?

What error message do you get now in the end?

Hi Deborah, I don’t have much to add other than Tobii Eye Tracker Manager (ETM) works fine with Ubuntu under several different AMD GPUs, we have two Tobii Spectrum Pro’s on different Ubuntu systems with different cards and ETM runs on both.

We don’t use ETM for much at all, as Dee’s awesome toolbox Titta is soooooooo much better for calibration and validation. ETM requires standard extended display mode for two monitors, which is opposite to PTB’s optimal XOrg to make a dedicated X display (so you needs to log out / in / out / in to run ETM to calibrate alongside PTB. But for updating the firmware it is indeed the only option available.

AMD GPUs cause far less problems for most other aspects of PTB functioning too, so even an old AMD GPU works more reliably than a top-line NVIDIA one…

Hi Ian,

One problem Deborah is having is that she can’t connect to the eye tracker with Titta through discovery, and since she can’t find the address of the eye tracker since ETM doesn’t run, she can’t connect that way either. Would you happen to have another solution to find the eye tracker’s address?

Cheers,
Dee

Hi Mario,

I tried LIBVA_DRIVER_NAME=noveau vainfo but i got the same error message as before - vainfo: symbol lookup error: /lib/x86_64-linux-gnu/libva-x11.so.2: undefined symbol: va_fool_postp.

The error message in the end after calling tobiiproeyetrackermanager is the same as before:

2025-01-12T23:53:17.774Z] ERROR: Main/4431 on tobii-pro-spectrum: 
    Child process encountered an error: pid: [4497] id: [EtmModule.SdkService] type: [EtmProcess.Executable] SDK:: Recieved unhandled message from parent process: <Buffer@0x75354b0 7b 22 65 76 65 6e 74 22 3a 22 61 6c 6c 2d 65 73 73 65 6e 74 69 61 6c 2d 6d 6f 64 75 6c 65 73 2d 6c 6f 61 64 65 64 22 7d>
    
[4431:0113/105318.383111:FATAL:gpu_data_manager_impl_private.cc(415)] GPU process isn't usable. Goodbye.
Trace/breakpoint trap (core dumped)

I don’t know if that’s informative to you? I also tried selecting zero in XOrgConfSelector() and logging back in, as Ian’s post made me think it might be something to do with that configuration. However this has not made any difference to the issue.

I am wondering whether I need to run XOrgConfCreator again to get the configuration for all the screens including the Tobii monitor, in order to get Dee’s toolbox working?

My student is here today with a Windows laptop, so I’m going to try hooking the system up to that and seeing if we can make it go. That should also help us find the correct IP address for the Tobii.

Thanks!

Deborah.

Hi Ian,

AHHH so how do you switch the configuration - do you run XOrgConfSelector and select 0 and log out and in again, as Mario suggested above?

Sadly I tried this and it did not work. I’m beginning to think the problem may well be the NVidia graphics card.

The next step, today, is to plug it all into my student’s Windows machine to see if I can get Eye Tracker Manager going on that and at least check that the hardware is working correctly, update the firmware if needed and see if I can locate the correct IP address for the Tobii. If I can get Dee’s toolbox working then it looks as if I won’t need Eye Tracker Manager at all - but I can’t get that going at all, nor can I get the SDK from Tobii to work either. (That one says it can’t find the mex file, even though I can see it is there and has been added to the path.)

Tobii = EyeTrackingOperations()
Error using EyeTrackingOperations
Could not find the mex file: tobiiresearch

So I’m really stumped at the moment with the Linux system.

I will update later today when we get it going on Windows (hopefully).

Cheers

Deborah.

I just wanted to say that I also tried to install the nvidia-vaapi-driver from the source above, but after following the instructions for installation I encountered this error:

meson.build:16:0: ERROR: Dependency "egl" not found, tried pkgconfig and cmake

Googling this error message has been entirely unhelpful although I gather it’s something to do with the mesa package.

Cheers

Deborah.

This suggests you broke your systems libva installation when you replaced half of the original Ubuntu 22.04 libva components with your self-built latest one from GitHub, but not the other half, so now you have a dysfunctional mix and VAAPI is broken:

Maybe you can fix it following the advice starting here:

Or maybe try to reinstall the original libva of Ubuntu, maybe via
sudo apt-get install --reinstall libva

Nope, but it doesn’t sound immediately related to vaapi errors. But googling that error message suggests it has something to do with ETM being an Electron app and Electron being probably overly complex and fragile…

Some posts suggest launching the app with command line options like --disable-gpu-sandbox may help some broken applications that crash with similar error messages. Or maybe --in-process-gpu or maybe both.

If Electron uses separate processes for sandboxing and security isolation between the GUI frontend process and some main process, a communication failure between both, as somewhat hinted by the error message, would explain a launch failure. Beats me though why an eyetracker manager application would need that kind of sandboxing? It makes a lot of sense for a webbrowser like chrome to increase resilience to attacks by malicious websites though.

Yes, if you wanted to use ETM for calibration that is the optimal way to run alongside PTB. The calibration will hold. But as I mentioned, I strongly recommend to use Dee’s toolbox. But as you found out, Tobii have an annoying discovery bug with MATLAB, both the MATLAB SDK and Titta cannot connect unless you know the address of the tracker, and catch-22 you can’t get the address without connecting :upside_down_face:. The solution is to run the Python SDK (Python - Tobii Pro SDK documentation) and from there you can get the address to use with Titta:

>>> import tobii_research as tr
>>> e=tr.find_all_eyetrackers()
>>> e[0].model
'Tobii Pro Spectrum'
>>> e[0].address
'tet-tcp://169.254.7.39'

See Cannot reliably find Spectrum Pro · Issue #72 · dcnieho/Titta · GitHub for more details.

Launching ETM with the DISPLAY environment variable set to default to X-Screen 1 might also trick it into displaying on the stimulus X-Screen if that would be needed for calibration. E.g., if echo DISPLAY says :0.0 or :0 then one could launch with DISPLAY=:0.1 ETM or if echo DISPLAY says :1.0 or :1, one could launch with DISPLAY=:1.1 ETM, ie. copy the server number before the . but set the x-screen number after it to 1 to select X-Screen 1 as display for ETM. May or may not work ok without a window manager running on that “stimulus only” X-Screen.

Seems the required EGL development files are not installed. Probably sudo apt install libegl-dev to get them installed. The Github repo lists various dependencies, this is one of them.

Hmmm, I actually went with updating Ubuntu to Version 24, since you said there were some basic drivers in there - but I’m still getting the same error messages.

HOWEVER! I now have my student here, so we plugged everything into EyeTrackerManager on his Windows box, and updated the firmware and found the correct IP address, and now Dee’s toolbox Titta is working!!! Or at least it can find the eye tracker.

I also ran XOrgConfCreator and made an X-configuration for the three screens (ViewPixx, Dell monitor and Tobii screen), and am now using that. The Tobii Screen seems to be set as Screen 1, so when I call that screen from Dee’s toolbox I do get the calibration screen, but it’s currently much bigger than the actual display so that the calibration display goes off the side of the screen. I think maybe I did something wrong in the XOrgConfCreator? Or would this be something in the code?

I’m also getting some PTB sync errors and sometimes crashing MATLAB, but at least we’re making some progress.

I think I need to give up on libva, but it seems as if I don’t really need the Eye Tracker Manager now that I’m able to run the Titta toolbox.

$ sudo apt-get install --reinstall libva
[sudo] password for deborah: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package libva is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Yeah I already tried --disable-gpu-sanbox and it said Invalid arguments: [disable-gpu-sandbox]

… so that didn’t help.

Actually my son is visiting soon and he’s worked on Electron so he might know. But for now I think let’s stop worrying about this because I think we can make the Titta toolbox work.

Cheers

Deborah.