I am trying to plot a TH3D in root with a very simple macro:
void Draw(string inputFile)
{
TFile* pf = new TFile(inputFile.c_str(),"READ");
TH3D* h = (TH3D*)pf->Get("CUORE");
gStyle->SetCanvasPreferGL(kTRUE);
h->Draw("glcolz");
}
but as soon as I run it interactively from an SSH session
ssh -XY <myusername>@cuore-login.lngs.infn.it
I get this weird error. I tried googling that but didn’t get any useful info
root [0] .L CuoreRate3D.C
root [1] Draw("../out/CuoreRate3D.root");
libGL error: failed to load driver: swrast
Info in <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
Error in <RootX11ErrorHandler>: GLXBadContext (XID: 6291743, XREQ: 149)
It looks also someone else on this forum had this kind of issues but when I was going through the other posts I couldn’t really understand what was the problem. Can someone explain me what’s happening?
Thanks a lot!
Cheers
Guido
ROOT Version: Not Provided Platform: Not Provided Compiler: Not Provided
Is OpenGl properly installed on this machine ? can you run some standard app like “glxgears” ? I searched in google: “swrast opengl fail” and got several answers which might help you.
[gfantini@cuore-login1 gfantini]$ glxgears
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 149 (GLX)
Minor opcode of failed request: 3 (X_GLXCreateContext)
Value in failed request: 0x0
Serial number of failed request: 21
Current serial number in output stream: 23
This can be fixed by adding the +iglx option to the line that starts the X server on the local machine. There is currently no configuration file option (it will be added to xorg-1.19 and probably backported to older versions).
What do they mean by “the line that starts the X server on the local machine”?
Anyway, in my root macro I forgot to gSystem->Load("libGL");
and that sent away the first two errors but I still get
Error in <RootX11ErrorHandler>: GLXBadContext (XID: 12583199, XREQ: 149)
Thank you very much for your suggestions. They really speed up my debug process!
And sorry if I ask dumb questions, I am sort of noob about this.
The “local machine” means the computer on which you actually display your graphics (i.e. the computer with the graphics card to which your monitor / screen is directly connected).
I think I got the solution. On mac OSX one should just kill the X server (go to activity monitor, look for the xquartz processes and kill them all), then open a shell and give