Office of Research Computing

How do I run graphics applications when on the cluster

The most common reason for getting the error message

 _tkinter.TclError: couldn't connect to display "localhost:10.0"

 Tkinter.tclerror: no display name and no $display environment variable  

when you attempt to run a graphics application while on the cluster is a failure to ssh with the -X option [ X11 forwarding ]. Log out and then log back in including the -X option as 

 ssh -X <NetID>@argo.orc.gmu.edu 

If your application uses such packages as Matplotlib, Tensorflow and Pytorch, you can use the Agg (Anti-Grain Geometry) rendering engine instead of X11. To do this, include the following code in your Python script

import matplotlib 

matplotlib.use('Agg')

The same effect can be achieved by including the following in your script

import os 

import matplotlib as matpl 

if os.environ.get('DISPLAY','') == '': 

    print('Currently no display found. Using the non-interactive Agg backend') 

    matpl.use('Agg') 

import matplotlib.pyplot as plot