Skip to content Skip to sidebar Skip to footer

Using Matplotlib On Non-0 MPI Rank Causes "QXcbConnection: Could Not Connect To Display"

I have written a program that uses mpi4py to do some job (making an array) in the node of rank 0 in the following code. Then it makes another array in the node of rank 1. Then I pl

Solution 1:

This error is by no means bizarre. "Could not connect to display" means that something fails to do some graphics stuff. Given that MPI processes can run on separate compute nodes, you have no guarantee that any rank can do just that. According to this answer, you should be able to force matplotlib into using a different backend:

import matplotlib
matplotlib.use('Agg')

Post a Comment for "Using Matplotlib On Non-0 MPI Rank Causes "QXcbConnection: Could Not Connect To Display""