4
$\begingroup$

I recently purchased and downloaded Mathematica. I'm on Linux, so I ran the provided installer script as root. I've activated it with my activation key, and installation reported success.

Prior to installing, I made sure to install the avahi and inetutils packages, as recommended here in the section for Mathematica 12. I installed Mathematica 13, but I imagine those packages are still needed.

When I run Mathematica, the UI contains a lot of $Failed markers where various UI components are supposed to go.

enter image description here

Mousing over one of red squares indicating an error, I see the following message: enter image description here

Things like notebooks still work, but lots of UI components display the $Failed message too:

enter image description here

Any guidance with regard to solving this problem would be greatly appreciated.

Edit:

System information:

  • Desktop Environment: Gnome 41.3
  • Windowing System: X11
  • OS Name: Manjaro Linux
  • Processor: 17-8550U
  • Graphics: UHD Graphics 620
$\endgroup$
3
  • 1
    $\begingroup$ May be someone with a similar experience would like to share tips and tricks with you, but I would suggest that you contact WRI support directly. $\endgroup$
    – Syed
    Mar 25, 2022 at 4:10
  • $\begingroup$ An older/similar unresolved thread. $\endgroup$
    – Syed
    Mar 25, 2022 at 5:46
  • $\begingroup$ Some resolution here and probably related to High-DPI screens. $\endgroup$
    – Syed
    Mar 25, 2022 at 5:57

1 Answer 1

4
$\begingroup$

I reached out to Customer Support. They weren't able to identify the root of the problem directly, but they suggested I try using KDE instead of Gnome.

At this point I was somewhat desperate for a solution, as threads like this one and also this one still hadn't received a satisfactory answer, so I decided to try it, and surprisingly, it worked. Not... perfectly. Plots were still pixelated for some reason, but the "$Failed" messages that had previously littered the UI were gone.

This was a good start, but I don't want to shift my entire workflow over to KDE, and I'm otherwise perfectly happy with gnome, so I started digging. What was different between KDE and gnome that caused Mathematica to work in one but not the other? I knew that Mathematica should work in gnome - it did so under operating systems like Ubuntu - which meant something on my system was wrong.

I know much of the Mathematica UI is based on QT, so that's where I decided to start.

Here's the environment variables for QT under gnome, obtained with env | grep QT:

QT_IM_MODULE=ibus
QT_AUTO_SCREEN_SCALE_FACTOR=1
QT_QPA_PLATFORMTHEME=qt5ct

And here are the QT environment variables under KDE:

QT_AUTO_SCREEN_SCALE_FACTOR=0
QT_STYLE_OVERRIDE=kvantum
QT_SCREEN_SCALE_FACTORS=eDP-1=2;DP-1=2;HDMI-1=2;DP-2=2;

At this point, the only thing to do was to start running Mathematica with various combinations of environment variables, to see what worked.

The answer was QT_AUTO_SCREEN_SCALE_FACTOR. When set to 1, Mathematica broke, but when set to 0, Mathematica handled everything correctly. This didn't even have to be a system wide setting - you could just do it by using env QT_AUTO_SCREEN_SCALE_FACTOR=0 on the command line:

enter image description here

To make the change "permanent" without interfering with other parts of the system, I added the following line to the mathematica executable (it's a shell script that runs the actual program):

#!/bin/sh
#
#  Mathematica 13.0 Front End command file
#  Copyright 1988-2022 Wolfram Research, Inc.

#  Determine the SystemID by examining the output of `uname -s` and 
#  `uname -m`. Failsafe to SystemIDList=Unknown.

# Needed so things work on Manjaro
export QT_AUTO_SCREEN_SCALE_FACTOR=0

Editing this file can be done via sudo <editor of your choice> "$(which mathematica)". Also do that for Mathematica, as usually mathematica (lowercase) and Mathematica (uppercase) are identical but separate scripts. Just add it at the top of the file. In my case, this was:

sudo nvim $(which mathematica)

# Add in `export QT_AUTO_SCREEN_SCALE_FACTOR=0`

The good news is that running on Gnome, this also resolved the issue with pixelated plots as described here. (The issue with pixelated plots was caused by having to enable High DPI screen compatibility mode as described in this workaround. The solution with QT_AUTO_SCREEN_SCALE_FACTOR=0 doesn't require high dpi screen compatibility mode, so there are no quality issues with plots:

enter image description here

Conclusion

It took a lot of work to debug this issue, but I'm posting it here in the hopes that other people with the same problem will be able to apply this solution! Please leave a comment if you have any questions.

Additional Info:

  • Gnome avoids the pixelated plots KDE had
  • DONT try to install KDE alongside gnome, it heck'd up my desktop environment and I had to roll back the system
  • Disable ScreenResolutionCompatibilityMode if it's set, as it's not needed with this solution
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.