Solved mupdf "Cannot open display"

Hi all --

I'm having some issues getting mupdf to open a pdf; e.g.
Code:
> mupdf some-random.pdf
error: cannot open display
uncaught exception: cannot open display

on FreeBSD 11.1-RELEASE #0 r321309 on a Dell Precision Tower 5180. The GPU is an NVidia Quadro K420 (GK107). Here are (hopefully) all of the relevant bits of information:

Code:
> uname -a                                                                                                                               
FreeBSD ditrestle 11.1-RELEASE FreeBSD 11.1-RELEASE #0 r321309: Fri Jul 21 02:08:28 UTC 2017     root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64

Code:
> pkg info -E mupdf nvidia-driver                                                                                                        
mupdf-1.11_1,1                                                                                                                              
nvidia-driver-375.66

X11 is working great, except for this and one other minor issue. Any thoughts regarding a solution?

Thanks in advance for your help.

Edit: I forgot my /etc/X11/xorg.conf:
Code:
Section "ServerLayout"                                                 
    Identifier     "Layout0"                                           
    Screen      0  "Screen0" 0 0                                       
    InputDevice    "Keyboard0" "CoreKeyboard"                         
    InputDevice    "Mouse0" "CorePointer"                             
    Option         "AIGLX" "true"                                     
EndSection                                                             
                                                                       
Section "Files"                                                       
    ModulePath      "/usr/local/lib/xorg/modules"                     
    FontPath        "/usr/local/share/fonts/misc/"                     
    FontPath        "/usr/local/share/fonts/TTF/"                     
    FontPath        "/usr/local/share/fonts/OTF/"                     
    FontPath        "/usr/local/share/fonts/Type1/"                   
    FontPath        "/usr/local/share/fonts/100dpi/"                   
    FontPath        "/usr/local/share/fonts/75dpi/"                   
    FontPath        "/usr/local/share/font-ipa/"                       
    FontPath        "/usr/local/share/font-ipa-uigothic/"             
    FontPath        "/usr/local/share/font-ipaex/"                     
    FontPath        "/usr/local/share/font-kochi/"                     
    FontPath        "/usr/local/share/font-migmix/"                   
    FontPath        "/usr/local/share/font-migu/"                     
    FontPath        "/usr/local/share/font-mona-ipa/"                 
    FontPath        "/usr/local/share/font-mplus-ipa/"                 
    FontPath        "/usr/local/share/font-sazanami/"                 
    FontPath        "/usr/local/share/font-shinonome/"                 
    FontPath        "/usr/local/share/fonts/CharisSIL/"               
    FontPath        "/usr/local/share/fonts/CharisSILCompact/"         
    FontPath        "/usr/local/share/fonts/DoulosSIL/"               
    FontPath        "/usr/local/share/fonts/Droid/
    FontPath        "/usr/local/share/fonts/ecofont/"
    FontPath        "/usr/local/share/fonts/anonymous-pro/"
    FontPath        "/usr/local/share/fonts/artwiz-aleczapka-en/"
    FontPath        "/usr/local/share/fonts/cyrillic/"
    FontPath        "/usr/local/share/fonts/dejavu/"
    FontPath        "/usr/local/share/fonts/encodings/"
    FontPath        "/usr/local/share/fonts/inconsolata/"
    FontPath        "/usr/local/share/fonts/isabella-ttf/"
    FontPath        "/usr/local/share/fonts/junicode/"
    FontPath        "/usr/local/share/fonts/misc/"
    FontPath        "/usr/local/share/fonts/proggy_fonts/"
    FontPath        "/usr/local/share/fonts/proggy_fonts-ttf/"
    FontPath        "/usr/local/share/fonts/stix/"
    FontPath        "/usr/local/share/fonts/terminus-font/"
    FontPath        "/usr/local/share/fonts/ubuntu-font/"
    FontPath        "/usr/local/share/fonts/urwfonts-ttf/"
    FontPath        "/usr/local/share/fonts/util/"
    FontPath        "/usr/local/share/fonts/webfonts/"
    FontPath        "/usr/local/share/fonts/cantarell/"
    FontPath        "/usr/local/share/fonts/LinLibertineG/"
    FontPath        "/usr/local/share/fonts/Liberation/"
    FontPath        "/usr/local/share/fonts/GentiumBasic/"
    FontPath        "/usr/local/share/fonts/Carlito/"
    FontPath        "/usr/local/share/fonts/Caladea/"
    FontPath        "/usr/local/share/fonts/Paratype/"
    FontPath        "/usr/local/share/fonts/tmu/"
EndSection

Section "Module"
    Load           "dbe"
    Load           "dri2"
    Load           "extmod"
    Load           "record"
    Load           "freetype"
    Load           "bitmap"
    Load           "type1"
    Load           "glx"
EndSection

Section "InputDevice"

    # generated from default                                                                                                                 
    Identifier     "Mouse0"                                                                                                                   
    Driver         "mouse"                                                                                                                   
    Option         "Protocol" "auto"                                                                                                         
    Option         "Device" "/dev/sysmouse"                                                                                                   
    Option         "Emulate3Buttons" "no"                                                                                                     
    Option         "ZAxisMapping" "4 5 6 7"                                                                                                   
EndSection                                                                                                                                   
                                                                                                                                             
Section "InputDevice"                                                                                                                         
                                                                                                                                             
    # generated from default                                                                                                                 
    Identifier     "Keyboard0"                                                                                                               
    Driver         "keyboard"                                                                                                                 
EndSection                                                                                                                                   
                                                                                                                                             
Section "Monitor"                                                                                                                             
    Identifier     "Monitor0"                                                                                                                 
    VendorName     "Unknown"                                                                                                                 
    ModelName      "Unknown"                                                                                                                 
    HorizSync       28.0 - 33.0                                                                                                               
    VertRefresh     43.0 - 72.0                                                                                                               
    Option         "DPMS"                                                                                                                     
EndSection                                                                                                                                   
                                                                                                                                             
Section "Device"                                                                                                                             
    Identifier     "Device0"                                                                                                                 
    Driver         "nvidia"                                                                                                                   
    VendorName     "NVIDIA Corporation"                                                                                                       
EndSection                                                                                                                                   
                                                                                                                                             
Section "Screen"                                                                                                                             
    Identifier     "Screen0"                                                                                                                 
    Device         "Device0"                                                                                                                 
    Monitor        "Monitor0"                                                                                                                 
    DefaultDepth    24                                                                                                                       
    SubSection     "Display"                                                                                                                 
        Depth       24                                                                                                                       
        Modes      "1920x1080"                                                                                                               
    EndSubSection                                                                                                                             
EndSection
 
Are you perhaps starting it from a different user account than the one that started X?
 
Maxnix and SirDice -

Thank you both for the help!

Is the ${DISPLAY} variable set (it should be :0)? Usually that's what cause such problems.
This is exactly the problem. I don't recall having set this before, so I'm not sure about the correct invocation. When I log in to my system, I typically start X with the following command
> xinit /usr/local/bin/openbox-session.
Is a xinit -display 0.0 ... sufficient, or is this the sort of thing that should be added to my ~/.xinitrc?


Are you perhaps starting it from a different user account than the one that started X?
No, same user.

Again, many thanks to you both for your time and trouble.
 
I don't recall having set this before, so I'm not sure about the correct invocation. When I log in to my system, I typically start X with the following command
> xinit /usr/local/bin/openbox-session.
Is a xinit -display 0.0 ... sufficient, or is this the sort of thing that should be added to my ~/.xinitrc?
It's automatically set. To start openbox simply put /usr/local/bin/openbox-session in your ~/.xinitrc and use startx. In ~/.xinitrc you should put everything you want to start/set when you start X.
 
Maxnix -- hey, thanks a bunch. I updated my ~/.xinitrc and, using startx things are back to working the way I would expect.

Cheers!
 
Back
Top