Sign up ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I use Mathematica 9 on Ubuntu 12.04 LTS x86 (64-bit). My computer has an Nvidia graphics card, for which I installed primus and bumblebee. If anyone is in a similar situation, I would like to know if they have solutions to the following two related problems:

  1. Mathematica does not need OpenGL when it's not rendering any 3D graphics. For this reason I find it convenient to run the program without optirun mathematica or primusrun mathematica most of the time. However, I noticed that if I do make a Plot3D or related command, Mathematica will crash. Is it possible to set the program up in a way so that it doesn't crash, but rather shows an error message, or just doesn't show output, if no 3D rendering is possible?

  2. primusrun extends optirun functionality by saving power when the graphics card is not in use. I suppose that for this reason, if I'm not actively rotating a 3D graphic, it goes blank in a session of primusrun mathematica rather than optirun mathematica. When using the less efficient optirun, all functionality is available and runs as expected. Did anyone figure out a workaround for this?

I'm asking on this site rather than AskUbuntu because the solution, if it exists, probably lies in changing Mathematica preferences rather than primus'.

share|improve this question
There's a misconception about the power saving. To clarify, primusrun avoids powering on the discrete GPU as long as the application does not load the OpenGL library; after that, power saving compared to optirun/virtualgl may come from obeying vsync, but that probably wouldn't matter for Mathematica. As noted below, consider filing a bug with reproduction steps for the blank 3D figure in primus. –  amonakov Feb 1 '14 at 10:54
@amonakov - yes, like I said, this was only my guess as to why the blank graphics occur. I agree it's due to some more complicated bug. I already filed a report to Wolfram support but I seriously doubt they would be able to help such a niche use case (i.e. Linux users with Optimus). –  VF1 Feb 1 '14 at 15:50

3 Answers 3

up vote 2 down vote accepted

You must adjust the Antialiasing Quality to solve that issue. Go to menu Edit -> Preferences -> Appearance -> Graphics.. then adjust it.. That worked for me. I have Ubuntu 14.04 and Mathematica V9.

Other solution is open a terminal and run: mathematica -mesa when opening.

share|improve this answer
Hi ! Can you edit your post to clarify it ? As it is currently written it is hard to tell exactly which issue/s you are trying to solve. –  Sektor Jul 13 '14 at 6:58
Yep. This solution works on Linux Mint 17.1 as well. +1 –  shivams Jun 18 at 14:16

Problem 1 should be a distribution specific bug. I cannot reproduce this problem on Archlinux.

I can reproduce problem 2. I think primusrun is still experimental. You may report a bug to them (but the developers may not have Mathemataica though).

share|improve this answer
If you can provide reproduction steps for the trial version, or capture the problem with apitrace, I will look into fixing it. Consider filing a bug at –  amonakov Feb 1 '14 at 10:42
Thanks! I filed a bug at github. –  Yi Wang Feb 1 '14 at 13:56
What happens for Problem 1 for you? –  VF1 Feb 1 '14 at 15:52
On my computer, Mathematica works well, no crash, and displays Plot3D figures correctly when started directly using integrated graphics (i.e. without optirun or primusrun) –  Yi Wang Feb 1 '14 at 16:29
Problem 2 is a limitation in primus, it doesn't support GLX pixmaps and front buffer rendering: Regarding problem 1, you may be seeing a segfault in graphics drivers: 12.04 is quite old. –  amonakov Feb 1 '14 at 20:34

After talking with Wolfram tech support, it seems problem 1 is really just this issue resolved by running Mathematica by the mathematica -mesa command.

Problem 2 is unresolved. I suppose I should keep this question open, though I don't know if a fix will come soon.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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