Running a program that uses MPI gives me an "Invalid MIT-MAGIC-COOKIE-1 key" warning on Ubuntu 20.04. I only recently upgraded; I was having no such issues when I was using 19.10.
I want to know what's going wrong.
Here are some system results:
$ xauth list
Yantra5/unix: MIT-MAGIC-COOKIE-1 d27adab3ff430390b17c59fb0f6e7e28
#ffff#59616e74726135#: MIT-MAGIC-COOKIE-1 d27adab3ff430390b17c59fb0f6e7e28
$ hostnamectl status
Static hostname: Yantra5
Icon name: computer-laptop
Chassis: laptop
Machine ID: 42b9dd9e9200409c81515ce51e5f9d52
Boot ID: 42be2b4557bf4d29934673457c4560b2
Operating System: Ubuntu 20.04.1 LTS
Kernel: Linux 5.4.0-42-generic
Architecture: x86-64
I'm running openmpi on Ubuntu 20.04. All programs with MPI_Init() is giving me the same warning.
This may be a related question.
Did the problem persist? I had the same as you or the one you mention and fixed it ("it fixed itself" would be more accurate).
I had installed a NVIDIA driver to use OpenCL and CUDA before installing MPI on my local computer and had the same warning. I switched back to X.Org driver (my way of doing it: Software & Updates -> Settings -> Additional Drivers -> Using X.Org), rebooted and warning messages had disappeared.
I tried to switch again to my NVIDIA driver, rebooted and the warning didn't reappear, so eventually just changing driver may solve the problem. It's not elegant and doesn't explain much, but it is worth trying. Also, as I fail to reproduce the problem, it is possible that simply "turn it off and on again" was what did the magic, which is why I asked if your problem persisted.
This was done out of total despair after an hour or more of looking for an answer to similar problems.
xhost +local:
,xhost +
,unset DISPLAY
orexport DISPLAY=whatever:X.X
didn't change anything, nor did it work to specify DISPLAY in the mpirun options (as stated in the official documentation). I had also rebooted (before changing the driver), andgrep xauth ~/.bash*
didn't give any result (so my .Xauthority file had not been modified from the terminal).Another way I found to avoid the problem while I had it was to disable the graphic interface and go with only the command line (ctrl+alt+F3), but I believe the warning is a minor inconvenience compared to no graphic interface.
Clues for people who are far more knowledgeable than little me about mpi and Xserver and somehow want to tackle this:
mpich
solves the problem, while when I compiled a small c script withmpicc
I had the warning.Clues for people who would have this, and for whom changing driver + rebooting didn't work and are as clueless as I was about xauth and .Xauthority:
echo $XAUTHORITY
.xauth
. I was about to try to manually change MIT-MAGIC-COOKIE-1 as a last resort, although I believe at this point it would probably be easier to install older versions of mpi and switch between them withupdate-alternatives