Menu

virtualgl just won't work (debian 8)

Help
2016-10-31
2016-12-06
  • harshvardhan

    harshvardhan - 2016-10-31

    I am trying to get opengl work for one of my projects.
    I have done
    /opt/VirtualGL/bin/vglserver_config
    then chose all recommended settings

    Choose:
    1
    
    Restrict 3D X server access to vglusers group (recommended)?
    [Y/n]
    y
    
    Restrict framebuffer device access to vglusers group (recommended)?
    [Y/n]
    y
    
    Disable XTEST extension (recommended)?
    [Y/n]
    y
    ... Creating vglusers group ...
    groupadd: group 'vglusers' already exists
    Could not add vglusers group (probably because it already exists.)
    ... Granting read permission to /etc/opt/VirtualGL/ for vglusers group ...
    ... Creating /etc/modprobe.d/virtualgl.conf to set requested permissions for
        /dev/nvidia* ...
    ... Adding vglgenkey to /etc/kde4/kdm/Xsetup script ...
    ... Adding display-setup-script=vglgenkey to /etc/lightdm/lightdm.conf ...
    ... Disabling XTEST extension in /etc/kde4/kdm/kdmrc ...
    
    Done. You must restart the display manager for the changes to take effect.
    

    then i logged in using vglconnect -x user:pass as described. Then in that same ssh session , i did vglrun glxgears, and it just wont run . This is the output of vglrun +v glxgears :

    [VGL] Shared memory segment ID for vglconfig: 360448
    [VGL] VirtualGL v2.3.2 64-bit (Build 20121002)
    [VGL] Opening local display :0
    Error: couldn't open display 129.21.147.40:0

    Somebody help :/

     
  • DRC

    DRC - 2016-10-31
    • Are you actually running LightDM or KDM, or are you using another display manager?
    • Did you add yourself to the vglusers group, log out, then log back in (as described in the User's Guide: https://cdn.rawgit.com/VirtualGL/virtualgl/2.5.1/doc/index.html#hd006)?
    • Did you follow the "Sanity Check" procedure described in the User's Guide (https://cdn.rawgit.com/VirtualGL/virtualgl/2.5.1/doc/index.html#hd006, under "Sanity Check")?
     

    Last edit: DRC 2016-10-31
  • harshvardhan

    harshvardhan - 2016-11-28

    I am sorry for the late reply.
    I boot into the console , and when I want , i do sudo kdm to start a display manager.
    I ran sudo /opt/VirtualGL/bin/vglserver_config

    the output is :
    Creating vglusers group ...
    groupadd: group 'vglusers' already exists
    Could not add vglusers group (probably because it already exists.)
    ... Granting read permission to /etc/opt/VirtualGL/ for vglusers group ...
    ... Creating /etc/modprobe.d/virtualgl.conf to set requested permissions for
    /dev/nvidia* ...
    ... Attempting to remove nvidia module from memory so device permissions
    will be reloaded ...
    rmmod: ERROR: Module nvidia is in use by: nvidia_modeset
    ... Modifying /etc/X11/xorg.conf to enable DRI permissions for
    vglusers group ...
    ... Adding vglgenkey to /etc/kde4/kdm/Xsetup script ...
    ... Adding display-setup-script=vglgenkey to /etc/lightdm/lightdm.conf ...
    ... Enabling XTEST extension in /etc/kde4/kdm/kdmrc ...

    Done. You must restart the display manager for the changes to take effect.

    IMPORTANT NOTE: Your system uses modprobe.d to set device permissions. You
    must execute rmmod nvidia with the display manager stopped in order for the
    new device permission settings to become effective.

    Notice the error.
    How do I proceed ?
    Thanks a ton for your help!

     
  • DRC

    DRC - 2016-11-29

    That error is normal and is a result of you ignoring the instructions in the User's Guide that said to stop the display manager before running vglserver_config. The output of the script tells you exactly what to do to overcome it: stop the display manager and execute rmmod nvidia. I would suggest that you do the following:

    • Stop the display manager
    • Run rmmod nvidia
    • Re-run vglserver_config
    • Restart the display manager

    If VirtualGL still doesn't work, then I would suggest editing /etc/kde4/kdm/Xsetup and changing the vglgenkey line such that the output of vglgenkey is redirected to a file:

    {path_to}/vglgenkey >/tmp/out 2>&1

    Then stop/restart the display manager and see if /tmp/out contains any obvious errors.

     
  • harshvardhan

    harshvardhan - 2016-11-29

    what is my display manager ?
    I am not automatically running kdm, gdm or anything

     
  • DRC

    DRC - 2016-11-29

    That could be why VirtualGL isn't working. It assumes that you are running a display manager. The purpose of vglserver_config is to set up the display manager such that it will grant access to VirtualGL while the system is sitting at the login prompt.

     
  • harshvardhan

    harshvardhan - 2016-11-30

    I was able to get glxgears to display after installing xdm. But after a reboot when I do it , I am getting:
    Invalid MIT-MAGIC-COOKIE-1 key[VGL] ERROR: Could not open display :0
    If i reinstall again , then do vglconnect , it works . And then after reboot , i get the error i mentioned.

     
  • DRC

    DRC - 2016-11-30

    Let's focus on KDM first. Please follow the diagnostic procedure I outlined above so we can figure out whether vglgenkey is completing successfully. If it isn't, then there is no way that you'll ever be able to successfully use VirtualGL.

     
  • harshvardhan

    harshvardhan - 2016-11-30

    After installing xdm , i am able to run virtual gl . Thanks!
    I login using vglconnect , and when I do vglrun glxgears , it shows up.

    All I want to do now is be able to run a long going task , and be able to 'check in' on it to see the progress.
    So for eg, if i run vglrun glxgears, i want to 'detach' (much like screen) , and have it continue running in the server. And then at an arbitrary amount of time later, i want to reattach back.

    What should I do ?

     
  • DRC

    DRC - 2016-11-30

    Use TurboVNC. Start a TurboVNC session, connect to it with the TurboVNC Viewer, start your 3D application using vglrun inside of the TurboVNC session, then you can disconnect and leave the TurboVNC session running for as long as you want.

     
  • harshvardhan

    harshvardhan - 2016-12-05

    Thanks !!.
    Whatever I wanted is more or less accomplished.
    I just dont want to waste my resources starting up a desktop.
    is it possible to use turbovnc to just see one (or several) windows without the whole desktop?

     
  • DRC

    DRC - 2016-12-05

    "Seamless windows" (displaying one client-side window for every application window) is unfortunately not possible with any VNC solution, due to limitations in the protocol. However, you can greatly reduce the resource usage by using a stripped-down window manager such as OpenBox or TWM. You can also configure OpenBox to isolate individual applications so that only those applications are accessible within the TurboVNC session:

    http://www.turbovnc.org/Documentation/ApplicationIsolation

    If you need seamless windows, you might also look at Xpra. I don't have a lot of experience with it, and I doubt the performance will be as good as TurboVNC, but if my understanding is correct, it should also be a stateless solution (meaning you can disconnect from and reconnect to a running application.)

     

    Last edit: DRC 2016-12-05
  • harshvardhan

    harshvardhan - 2016-12-05

    thanks a lot!
    you have been very kind and helpful

    have a nice day!

     
  • harshvardhan

    harshvardhan - 2016-12-05

    I cant find how to change vncserver to load up twm instead of kdm :/

     
  • DRC

    DRC - 2016-12-05

    Just edit ~/.vnc/xstartup.turbovnc and delete everything except these lines near the bottom:

    if [ -f $HOME/.Xresources ]; then xrdb $HOME/.Xresources; fi
    xsetroot -solid grey
    xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
    twm
    
     

    Last edit: DRC 2016-12-05
  • DRC

    DRC - 2016-12-05

    Another option is to leave xstartup.turbovnc alone, copy those same lines into ~/.Xclients, then:

    chmod 700 ~/.Xclients
    
     
  • harshvardhan

    harshvardhan - 2016-12-05

    thanks a lot for that superfast reply.
    though adding the file Xclients didnt work for me.
    The first method (editing xstartup.turbovnc) worked

     
  • DRC

    DRC - 2016-12-05

    There's a dot in the filename. It's ".Xclients", not "Xclients".

     
  • harshvardhan

    harshvardhan - 2016-12-06

    Hey , i just noticed something.
    When I am running my long task via turbovnc , and I login from kdm(thats my display manager) via gnome , and after I log out , the job that was running earlier just crashes.

    Is this documented behaviour , or am I doing something wrong ?

     
  • DRC

    DRC - 2016-12-06

    If you log into Display :0 and log out again, it resets the display and disconnects any connected X clients. Since VGL is forwarding GLX calls to Display :0, it is an X client of that display. If you need to use the root display while using VGL, just leave the root display logged in. Or find me a financial sponsor to implement this:

    https://github.com/VirtualGL/virtualgl/issues/10