wiki:VirtualGL_UsageNote

Version 22 (modified by rider, 16 years ago) (diff)

--

VirtualGL Usage Note

TurboVNC

Part1 - Basic Setting

rock@gpfs-server:~$ /opt/TurboVNC/bin/vncpasswd (Enter Your Passwd - The password is saved in ~/.vnc/passwd)
rock@gpfs-server:~$ sudo apt-get install xfs xinetd libimlib*
rock@gpfs-server:~$ sudo apt-get install xserver-xorg-core xserver-xorg-dev xorg xorg-dev xserver-xorg-input* xserver-xorg-video*
rock@gpfs-server:~/.vnc$ sudo vim /etc/gdm/gdm.conf

DisallowTCP=false

rock@gpfs-server:~$ sudo vim /etc/services

# Make the following settings by checking /etc/X11/xorg.conf

vnc-640x480x8 5950/tcp
vnc-800x600x8 5951/tcp
vnc-1024x768x8 5952/tcp
vnc-1152x864x8 5953/tcp
vnc-1280x1024x8 5954/tcp
vnc-640x480x16 5960/tcp
vnc-800x600x16 5961/tcp
vnc-1024x768x16 5962/tcp
vnc-1152x864x16 5963/tcp
vnc-1280x1024x16 5964/tcp
vnc-640x480x24 5970/tcp
vnc-800x600x24 5971/tcp
vnc-1024x768x24 5972/tcp
vnc-1152x864x24 5973/tcp
vnc-1280x1024x24 5974/tcp
vnc-640x480x32 5980/tcp
vnc-800x600x32 5981/tcp
vnc-1024x768x32 5982/tcp
vnc-1152x864x32 5983/tcp
vnc-1280x1024x32 5984/tcp

rock@gpfs-server:~$ sudo vim /etc/xinetd.d/xvncserver

service vnc-640x480x8
  {
    protocol = tcp
    socket_type = stream
    wait = no
    user = nobody
    server = /usr/bin/Xvnc
    server_args = -inetd -query localhost -once -geometry 640x480 -depth 8
  }
  
  service vnc-800x600x8
  {
    protocol = tcp
    socket_type = stream
    wait = no
    user = nobody
    server = /usr/bin/Xvnc
    server_args = -inetd -query localhost -once -geometry 800x600 -depth 8
  }
  
  service vnc-1024x768x8
  {
    protocol = tcp
    socket_type = stream
    wait = no
    user = nobody
    server = /usr/bin/Xvnc
    server_args = -inetd -query localhost -once -geometry 1024x768 -depth 8
  }

  service vnc-1152x864x8
  {
    protocol = tcp
    socket_type = stream
    wait = no
    user = nobody
    server = /usr/bin/Xvnc
    server_args = -inetd -query localhost -once -geometry 1280x1024 -depth 8
  } 
  
  service vnc-1280x1024x8
  {
    protocol = tcp
    socket_type = stream
    wait = no
    user = nobody
    server = /usr/bin/Xvnc
    server_args = -inetd -query localhost -once -geometry 1280x1024 -depth 8
  } 
  
  service vnc-640x480x16
  {
    protocol = tcp
    socket_type = stream
    wait = no
    user = nobody
    server = /usr/bin/Xvnc
    server_args = -inetd -query localhost -once -geometry 640x480 -depth 16
  }
  
  service vnc-800x600x16
  {
    protocol = tcp
    socket_type = stream
    wait = no
    user = nobody
    server = /usr/bin/Xvnc
    server_args = -inetd -query localhost -once -geometry 800x600 -depth 16
  }
  
  service vnc-1024x768x16
  {
    protocol = tcp
    socket_type = stream
    wait = no
    user = nobody
    server = /usr/bin/Xvnc
    server_args = -inetd -query localhost -once -geometry 1024x768 -depth 16
  }

  service vnc-1152x864x16
  {
    protocol = tcp
    socket_type = stream
    wait = no
    user = nobody
    server = /usr/bin/Xvnc
    server_args = -inetd -query localhost -once -geometry 1280x1024 -depth 16
  } 
  
  service vnc-1280x1024x16
  {
    protocol = tcp
    socket_type = stream
    wait = no
    user = nobody
    server = /usr/bin/Xvnc
    server_args = -inetd -query localhost -once -geometry 1280x1024 -depth 16
  }
  
  service vnc-640x480x24
  {
    protocol = tcp
    socket_type = stream
    wait = no
    user = nobody
    server = /usr/bin/Xvnc
    server_args = -inetd -query localhost -once -geometry 640x480 -depth 24
  }
  
  service vnc-800x600x24
  {
    protocol = tcp
    socket_type = stream
    wait = no
    user = nobody
    server = /usr/bin/Xvnc
    server_args = -inetd -query localhost -once -geometry 800x600 -depth 24
  }
  
  service vnc-1024x768x24
  {
    protocol = tcp
    socket_type = stream
    wait = no
    user = nobody
    server = /usr/bin/Xvnc
    server_args = -inetd -query localhost -once -geometry 1024x768 -depth 24
  }

  service vnc-1152x864x24
  {
    protocol = tcp
    socket_type = stream
    wait = no
    user = nobody
    server = /usr/bin/Xvnc
    server_args = -inetd -query localhost -once -geometry 1280x1024 -depth 24
  } 
  
  service vnc-1280x1024x24
  {
    protocol = tcp
    socket_type = stream
    wait = no
    user = nobody
    server = /usr/bin/Xvnc
    server_args = -inetd -query localhost -once -geometry 1280x1024 -depth 24
    # port = 5973
  }
  
  service vnc-640x480x32
  {
    protocol = tcp
    socket_type = stream
    wait = no
    user = nobody
    server = /usr/bin/Xvnc
    server_args = -inetd -query localhost -once -geometry 640x480 -depth 32
  }
  
  service vnc-800x600x32
  {
    protocol = tcp
    socket_type = stream
    wait = no
    user = nobody
    server = /usr/bin/Xvnc
    server_args = -inetd -query localhost -once -geometry 800x600 -depth 32
  }
  
  service vnc-1024x768x32
  {
    protocol = tcp
    socket_type = stream
    wait = no
    user = nobody
    server = /usr/bin/Xvnc
    server_args = -inetd -query localhost -once -geometry 1024x768 -depth 32
  }

  service vnc-1152x864x32
  {
    protocol = tcp
    socket_type = stream
    wait = no
    user = nobody
    server = /usr/bin/Xvnc
    server_args = -inetd -query localhost -once -geometry 1280x1024 -depth 32
  } 
  
  service vnc-1280x1024x32
  {
    protocol = tcp
    socket_type = stream
    wait = no
    user = nobody
    server = /usr/bin/Xvnc
    server_args = -inetd -query localhost -once -geometry 1280x1024 -depth 32
  }
  

Part2 - X Font Server

@ Server rock@gpfs-server:~$ sudo vim /etc/X11/fs/config

#no-listen = tcp

rock@gpfs-server:~$ sudo /etc/init.d/xfs restart
rock@gpfs-server:~$ sudo /etc/init.d/gdm restart

@ Client rider@350z:~$sudo vim /etc/X11/xorg.conf

FontPath "tcp/ServerIP_Address:7100"

## Client can get fonts support from x font server (xfs)

xrdb Bug Fixed:
Bug1:
## Put the RGB Database (rgb.txt - attached file)to the path /usr/X11R6/lib/X11/
rock@gpfs-server:~$ sudo cp /home/rock/rgb.txt /usr/X11R6/lib/X11/

Bug2:
## Adding an empty file named: .Xresources at PATH:///home/rock to fix " xrdb: can't open file '/home/rock/.Xresources' "

Part3 - TurboVNC Server Activation

@Server
rock@gpfs-server:~$ /opt/TurboVNC/bin/vncserver

New 'X' desktop is gpfs-server:1

Creating default startup script /home/rock/.vnc/xstartup
Starting applications specified in /home/rock/.vnc/xstartup
Log file is /home/rock/.vnc/gpfs-server:1.log

@Client
rider@350z:~$ /opt/TurboVNC/bin/vncconnect [-display Xvnc-display] ServerIP[:port]
rider@350z:~$ /opt/TurboVNC/bin/vncviewer [Enter ServerIP & Passwd]

PS1:

Individual users can provide both user and view-only passwords. These should be different. Users can give the view-only password to someone so that they can see the remote session, but not interact.TurboVNC assigns access based on which password is used. The user password lets you provide mouse and keyboard input.

PS2:

I set 2 passwords for both user & view-only,and passwords are different for all-level users.

PS3:

Clients should also install turbovnc to run "vncconnect" & "vncview"

VirtualGL

Mesa 3D GL Driver

Step1 System Check

#Pre-Requirement
rock@gpfs-server:~$ sudo apt-get install mesa-utils libgl1-mesa-dev libgl1-mesa-dri libgl1-mesa-glx libdrm-dev libdrm2

rock@gpfs-server:~$ lsmod | grep drm

drm                    73748  3 i915
agpgart                30408  3 drm,intel_agp

rock@gpfs-server:~$ dmesg | grep drm

[drm] Initialized drm 1.1.0 20060810
[drm] Initialized i915 1.6.0 20060119 on minor 0

rock@gpfs-server:~/intel_Q965/mesa$ dmesg | grep agp

Linux agpgart interface v0.101 (c) Dave Jones
agpgart: Detected an Intel 965Q Chipset.
agpgart: Unknown page table size, assuming 512KB
agpgart: Detected 7676K stolen memory.
agpgart: AGP aperture is 256M @ 0xe0000000
PS1: Some of the DRM messages should like that! If DRM module can't be found, then you can try to do something below.

rock@gpfs-server:~$ sudo modprobe i810
rock@gpfs-server:~$ sudo modprobe drm

PS2: You can skip "Building DRM module" when your DRM works well.

Caution:
You can also make related kernel modules (mark as module) below without building DRM & Mesa Driver. The latest Mesa 3D driver needs at least libdrm 3.5.0, and 2.6.20 kernel may not support very well for some missing symbols.

CONFIG_AGP=m
CONFIG_AGP_ALI=m
CONFIG_AGP_ATI=m
CONFIG_AGP_AMD=m
CONFIG_AGP_AMD64=m
CONFIG_AGP_INTEL=m
CONFIG_AGP_NVIDIA=m
CONFIG_AGP_SIS=m
CONFIG_AGP_SWORKS=m
CONFIG_AGP_VIA=m
CONFIG_AGP_EFFICEON=m
CONFIG_DRM=m
CONFIG_DRM_TDFX=m
CONFIG_DRM_R128=m
CONFIG_DRM_RADEON=m
CONFIG_DRM_I810=m
CONFIG_DRM_I830=m
CONFIG_DRM_I915=m
CONFIG_DRM_MGA=m
CONFIG_DRM_SIS=m
CONFIG_DRM_VIA=m
CONFIG_DRM_SAVAGE=m

Step2 Getting DRM & Mesa

rock@gpfs-server:~/intel_Q965$ sudo apt-get install git git-core cogito

# DRM kernel module
The DRM kernel modules are available from the public DRM git repository:

rock@gpfs-server:~/intel_Q965$ git-clone git://anongit.freedesktop.org/git/mesa/drm

# Mesa 3D GL driver
The GL drivers are available from the public Mesa git repository:

rock@gpfs-server:~/intel_Q965$ git-clone git://anongit.freedesktop.org/git/mesa/mesa

Step2 Building DRM module & Mesa 3D drivers --- Manual Configuration

The DRM (Direct Rendering Manager) provides kernel and library interfaces to clients wanting access to kernel managed resources like interrupts, buffer swaps, DMA memory mapping and graphics memory management.

# DRM & LibDRM

rock@gpfs-server:~/intel_Q965/drm$ ./autogen.sh --prefix=/usr --exec-prefix=/
rock@gpfs-server:~/intel_Q965/drm$ make
rock@gpfs-server:~/intel_Q965/drm$ sudo make install
rock@gpfs-server:/usr/include/drm$ sudo vim /home/rock/intel_Q965/drm/linux-core/drm_compat.c

/*
        err = drm_bo_wait(bo, 0, 1, 0);
        if (err) {
                data->type = (err == -EAGAIN) ?
                        VM_FAULT_MINOR : VM_FAULT_SIGBUS;
                goto out_unlock;
        }
*/

rock@gpfs-server:~/intel_Q965/drm$ cd linux-core
rock@gpfs-server:~/intel_Q965/drm$ make -C linux-core
rock@gpfs-server:~/intel_Q965/drm$ sudo make install
rock@gpfs-server:~/intel_Q965/drm$ sudo depmod -a
rock@gpfs-server:~/intel_Q965/drm$ sudo cp linux-core/*.ko /lib/modules/2.6.20.gpfs/kernel/drivers/char/drm/
rock@gpfs-server:/lib/modules/2.6.20.gpfs/kernel/drivers/char/drm$ ls

drm.ko   i830.ko  mach64.ko  nouveau.ko  r128.ko    savage.ko  tdfx.ko  xgi.ko
i810.ko  i915.ko  mga.ko     nv.ko       radeon.ko  sis.ko     via.ko

# Mesa 3D GL driver

rock@gpfs-server:~/intel_Q965/mesa$ ./autogen.sh --prefix=/opt/mesa --with-driver=dri --disable-glut
rock@gpfs-server:~/intel_Q965/mesa$ make
rock@gpfs-server:~/intel_Q965/mesa$ sudo make install
rock@gpfs-server:~/intel_Q965/mesa$ sudo mkdir -p /opt/mesa/bin
rock@gpfs-server:~/intel_Q965/mesa$ install -m755 progs/xdemos/{glxinfo,glxgears} /opt/mesa/bin/

Step3 Intel Q963/Q965 3D Acceleration check

@Clinet
rider@350z:~$ /opt/TurboVNC/bin/vncviewer (Enter ServerIP & Passwd)

@Server
rock@gpfs-server:~$ glxinfo | more (You should install mesa-utils first)

name of display: :0.0
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.2
server glx extensions:
    GLX_ARB_multisample, GLX_EXT_visual_info, GLX_EXT_visual_rating, 
    GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_OML_swap_method, 
    GLX_SGI_make_current_read, GLX_SGIS_multisample, GLX_SGIX_hyperpipe, 
    GLX_SGIX_swap_barrier, GLX_SGIX_fbconfig, GLX_MESA_copy_sub_buffer
client glx vendor string: SGI
client glx version string: 1.4
client glx extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context, 
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_allocate_memory, 
    GLX_MESA_copy_sub_buffer, GLX_MESA_swap_control, 
    GLX_MESA_swap_frame_usage, GLX_OML_swap_method, GLX_OML_sync_control, 
    GLX_SGI_make_current_read, GLX_SGI_swap_control, GLX_SGI_video_sync, 
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, 
    GLX_SGIX_visual_select_group, GLX_EXT_texture_from_pixmap
GLX version: 1.2
GLX extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context, 
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer, 
    GLX_MESA_swap_control, GLX_MESA_swap_frame_usage, GLX_OML_swap_method, 
    GLX_SGI_make_current_read, GLX_SGI_video_sync, GLX_SGIS_multisample, 
    GLX_SGIX_fbconfig
OpenGL vendor string: Tungsten Graphics, Inc
OpenGL renderer string: Mesa DRI Intel(R) 965Q 4.1.3002
OpenGL version string: 1.4 Mesa 6.5.1
OpenGL extensions:
    GL_ARB_depth_texture, GL_ARB_fragment_program, GL_ARB_imaging, 
    GL_ARB_multisample, GL_ARB_multitexture, GL_ARB_point_parameters, 
    GL_ARB_shadow, GL_ARB_texture_border_clamp, GL_ARB_texture_compression, 
    GL_ARB_texture_cube_map, GL_ARB_texture_env_add, 
    GL_ARB_texture_env_combine, GL_ARB_texture_env_crossbar, 
    GL_ARB_texture_env_dot3, GL_ARB_texture_mirrored_repeat, 
    GL_ARB_texture_rectangle, GL_ARB_transpose_matrix, 
    GL_ARB_vertex_buffer_object, GL_ARB_vertex_program, GL_ARB_window_pos, 
    GL_EXT_abgr, GL_EXT_bgra, GL_EXT_blend_color, 
    GL_EXT_blend_equation_separate, GL_EXT_blend_func_separate, 
    GL_EXT_blend_logic_op, GL_EXT_blend_minmax, GL_EXT_blend_subtract, 
    GL_EXT_clip_volume_hint, GL_EXT_cull_vertex, GL_EXT_compiled_vertex_array, 
    GL_EXT_convolution, GL_EXT_copy_texture, GL_EXT_draw_range_elements, 
    GL_EXT_fog_coord, GL_EXT_histogram, GL_EXT_multi_draw_arrays, 
    GL_EXT_packed_pixels, GL_EXT_point_parameters, GL_EXT_polygon_offset, 
    GL_EXT_rescale_normal, GL_EXT_secondary_color, 
    GL_EXT_separate_specular_color, GL_EXT_shadow_funcs, GL_EXT_stencil_wrap, 
    GL_EXT_subtexture, GL_EXT_texture, GL_EXT_texture3D, 
    GL_EXT_texture_edge_clamp, GL_EXT_texture_env_add, 
    GL_EXT_texture_env_combine, GL_EXT_texture_env_dot3, 
    GL_EXT_texture_filter_anisotropic, GL_EXT_texture_lod_bias, 
    GL_EXT_texture_object, GL_EXT_texture_rectangle, GL_EXT_vertex_array, 
    GL_3DFX_texture_compression_FXT1, GL_APPLE_client_storage, 
    GL_APPLE_packed_pixels, GL_ATI_blend_equation_separate, 
    GL_IBM_rasterpos_clip, GL_IBM_texture_mirrored_repeat, 
    GL_INGR_blend_func_separate, GL_MESA_pack_invert, GL_MESA_ycbcr_texture, 
    GL_MESA_window_pos, GL_NV_blend_square, GL_NV_light_max_exponent, 
    GL_NV_texture_rectangle, GL_NV_texgen_reflection, GL_OES_read_format, 
    GL_SGI_color_matrix, GL_SGI_color_table, GL_SGIS_generate_mipmap, 
    GL_SGIS_texture_border_clamp, GL_SGIS_texture_edge_clamp, 
    GL_SGIS_texture_lod, GL_SGIX_depth_texture, GL_SUN_multi_draw_arrays
glu version: 1.3
glu extensions:
    GLU_EXT_nurbs_tessellator, GLU_EXT_object_space_tess

PS: Check your "direct rendering". If it says "Yes", then you can use vncviewer with 3D acceleration now.

Step4 VGL configuration

@Server

rock@gpfs-server:~$ sudo /opt/VirtualGL/bin/vglserver_config

1) Configure server for use with VirtualGL in GLX mode
2) Unconfigure server for use with VirtualGL in GLX mode
X) Exit

Choose:
1
Restrict local X server access to vglusers group (recommended)?
[Y/n]
n
Restrict framebuffer device access to vglusers group (recommended)?
[Y/n]
n
Disable XTEST extension (recommended)?
[Y/n]
n
... Granting write permission to /dev/nvidia* for all users ...
chmod: cannot access `/dev/nvidia*': No such file or directory
chown: cannot access `/dev/nvidia*': No such file or directory
... Adding xhost +localhost to /etc/gdm/Init/Default script ...
... Setting default run level to 5 (enabling graphical login prompt) ...

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


1) Configure server for use with VirtualGL in GLX mode
2) Unconfigure server for use with VirtualGL in GLX mode
X) Exit

Choose:
X

rock@gpfs-server:~$ sudo vim /etc/profile

### Using GLP by Default in VirtualGL

VGL_DISPLAY=glp
export VGL_DISPLAY

rock@gpfs-server:~$ source /etc/profile

IvIsee + VirtualGL + TurboVNC + GPFS

@Client

rider@350Z:~$ ssh rock@gpfs-server
rock@gpfs-server:~$ /opt/TurboVNC/bin/vncserver

rock@gpfs-server:~$ ps aux | grep X
rock     15771  0.0  1.0  34208 31776 pts/5    S    11:37   0:00 /opt/TurboVNC/bin/Xvnc :1 -desktop X -httpd /opt/TurboVNC/bin/../vnc/classes -auth /home/rock/.Xauthority -dontdisconnect -geometry 1240x900 -depth 24 -rfbwait 120000 -rfbauth /home/rock/.vnc/passwd -rfbport 5901 -fp unix/:7100 -deferupdate 1
rock     15783  0.0  0.1   9940  5200 pts/5    S    11:37   0:00 xterm -geometry 80x24+10+10 -ls -title X Desktop
root     19675 13.6  0.3  20044 12156 tty8     Ss+  13:55   9:03 /usr/bin/X :0 -dpi 96 -audit 0 -auth /var/lib/gdm/:0.Xauth -nolisten tcp vt8
rock     21501  0.0  0.0   2852   720 pts/3    S+   15:02   0:00 grep X

rider@350z:~$ /opt/TurboVNC/bin/vncviewer gpfs-server IP:0 (Enter Passwd)

Connected to RFB server, using protocol version 3.7
Performing standard VNC authentication
Password: 
Authentication successful
Desktop name "LibVNCServer"
VNC server default format:
  32 bits per pixel.
  Least significant byte first in each pixel.
  True colour: max red 255 green 255 blue 255, shift red 16 green 8 blue 0
Using TrueColor visual, depth 24.  Pixel format:
  32 bits per pixel.
  Least significant byte first in each pixel.
  True colour: max red 255 green 255 blue 255, shift red 16 green 8 blue 0
Using shared memory PutImage

@GPFS-Server

# Without GPFS

rock@gpfs-server:~$ cd ./3D_model/
rock@gpfs-server:~/3D_model$ /opt/VirtualGL/bin/vglrun IvIsee 3D_model_files

# With GPFS: Put the 3D_model_files to GPFS Partition

rock@gpfs-server:~$ cd ../gpfs_mount/
rock@gpfs-server:/home/gpfs_mount$ /opt/VirtualGL/bin/vglrun IvIsee 3D_model_files

Reference:
http://www.virtualgl.org/vgldoc/2_1final/
http://www.intellinuxgraphics.org/
http://www.lslnet.com/linux/f/docs1/i46/big5320722.htm
http://phi.sinica.edu.tw/aspac/reports/94/94025/xintro2.html

Attachments (3)

Download all attachments as: .zip