Immersive Visualization / IQ-Station Wiki

This site hosts information on virtual reality systems that are geared toward scientific visualization, and as such often toward VR on Linux-based systems. Thus, pages here cover various software (and sometimes hardware) technologies that enable virtual reality operation on Linux.

The original IQ-station effort was to create low-cost (for the time) VR systems making use of 3DTV displays to produce CAVE/Fishtank-style VR displays. That effort pre-dated the rise of the consumer HMD VR systems, however, the realm of midrange-cost large-fishtank systems is still important, and has transitioned from 3DTV-based systems to short-throw projectors.

Difference between revisions of "VMD"

From IQ-Station Wiki
Jump to navigation Jump to search
(Beginning the HPC system instructions)
(Added information about VMD with ANARI & did other format tweaking (added itals to angle-brackets))
 
(5 intermediate revisions by the same user not shown)
Line 2: Line 2:
'''Visual Molecular Dynamics (VMD)'''
'''Visual Molecular Dynamics (VMD)'''


[http://www.ks.uiuc.edu/Research/vmd/ VMD] is a good visualization tool for visualizing large molecular systems (typically used for large biomolecular systems).  VMD has a long history of being interfaced to immersive technologies, including haptic devices and CAVE VR displays.  There is also a section on the usage of VMD for HPC systems.
[http://www.ks.uiuc.edu/Research/vmd VMD] is a good visualization tool for visualizing large molecular systems (typically used for large biomolecular systems).  VMD has a long history of being interfaced to immersive technologies, including haptic devices and CAVE VR displays.  There is also a section on the usage of VMD for HPC systems.


=Immersive Mode VMD=
=Immersive Mode VMD=
Information specific to the usage and setup of VMD for immserive systems such as the
Information specific to the usage and setup of VMD for immserive systems such as the
[http://en.wikipedia.org/wiki/Cave_automatic_virtual_environment CAVE virtual reality display].
[http://en.wikipedia.org/wiki/Cave_automatic_virtual_environment CAVE virtual reality display].


==How to Run VMD in Immersive Mode==
==How to Run VMD in Immersive Mode==
Line 12: Line 13:
If VMD with the FreeVR interface is installed and properly configured, follow these steps to run in immersive mode:
If VMD with the FreeVR interface is installed and properly configured, follow these steps to run in immersive mode:


#<CODE>% vmd -dispdev freevrforms ../proteins/brH.pdb</CODE>
#<CODE>% module load freevr vmd</CODE>
#<CODE>% vmd -dispdev freevrforms &LT;path&GT;/proteins/brH.pdb</CODE>
#*This alone should be sufficient to render the molecule in the VR system, with joystick-controlled travel
# In order to grab and move an object, the <CODE>grab</CODE> tool must be initialized:
# In order to grab and move an object, the <CODE>grab</CODE> tool must be initialized:
#:# &rarr;<CODE>Graphics</CODE> &rarr;<CODE>Tools</CODE>
#:# &rarr;<CODE>Graphics</CODE> &rarr;<CODE>Tools</CODE>
Line 20: Line 23:
#:: The wand avatar will now appear in the scene
#:: The wand avatar will now appear in the scene
# Now touch an object with the wand avatar and press <CODE>Button-1</CODE> to move it.
# Now touch an object with the wand avatar and press <CODE>Button-1</CODE> to move it.
==How to Configure VMD for Immersive displays==
There are two stages of configuration required for the overall configuration of VMD for immersive displays.
The first step is to configure FreeVR for the specific hardware setup of the immersive facility.  This is explained in the FreeVR documentation.
The second stage is to link the FreeVR inputs to VMD "sensors devices".
VMD "sensor devices" are specified in the <CODE>.vmdsensors</CODE> file.
The format of this file is described in the [http://www.ks.uiuc.edu/Research/vmd/vmd-1.9.1/ug/node49.html VMD User's Guide: Tool Window] documentation.
* Create a <CODE>.vmdsensors</CODE> file in your <CODE>$HOME</CODE> directory or the local directory:
*: Here is a sample <CODE>.vmdsensors</CODE> file for use with FreeVR:
<BLOCKQUOTE>
<PRE>
###   
### Configuration for the FreeVR trackers
###   
device freevrtracker freevrtracker://local/freevr
scale 0.5
offset 0.9 -4.0 -1.0
device freevrbuttons freevrbuttons://local/freevr:0,1,2,3
## uncomment the following if you have more than one wand:
#device vrtracker2 freevrtracker://local/freevr:1
#scale 1.0
#offset 0.9 -4.0 -1.0
</PRE>
</BLOCKQUOTE>




Line 28: Line 58:
# Install missing dependencies
# Install missing dependencies
#: Commonly needed packages include:
#: Commonly needed packages include:
#:* tcl-devel (8.x -- perhaps 8.4 or greater)
#:* tcl-devel (8.5 -- 8.6 works with edits to <CODE>Makefile</CODE>)
#:* tk-devel (8.x -- perhaps 8.4 or greater)
#:* tk-devel (8.5 -- 8.6 works with edits to <CODE>Makefile</CODE>)
#:* fltk-devel
#:* fltk-devel
#:* netcdf-devel
#:* netcdf-devel
#:
#:
# Download the latest source (version 1.9.1 as of this writing [04/09/12])
# Download the latest source (version 1.9.4a57 as of this writing [12/21/23])
#:: [http://www.ks.uiuc.edu/Development/Download/download.cgi?PackageName=VMD http://www.ks.uiuc.edu/Development/Download/download.cgi?PackageName=VMD]
#:: [http://www.ks.uiuc.edu/Development/Download/download.cgi?PackageName=VMD http://www.ks.uiuc.edu/Development/Download/download.cgi?PackageName=VMD]
#: NOTE: there is a (free) registration process required
#: NOTE: there is a (free) registration process required
#: NOTE: the pre-built packages may not contain the Immersive features  
#: NOTE: the pre-built packages may not contain the Immersive features  
# Untar the source ball
# Untar the source ball
#: E.g. <CODE>% tar -zxf vmd-1.9.1.src.tar.gz</CODE>
#: E.g. <CODE>% tar -zxf vmd-<''version''>.src.tar.gz</CODE>
#::(As of this writing [12/21/23] <CODE>&LT;''version''&GT;</CODE> is <CODE>1.9.4a57</CODE>)
# Compile the plugins
# Compile the plugins
#: <CODE>% export PLUGINDIR=`pwd`/vmd-<''version''>/plugins</CODE>
#: <CODE>% cd plugins</CODE>
#: <CODE>% cd plugins</CODE>
#: <CODE>% make <architecture></CODE> &mdash; E.g. LINUXAMD64
#: Ensure the Makefiles are set for the proper version of Tcl/Tk:
#: <CODE>% export PLUGINDIR=`pwd`/../vmd-<version>/plugins</CODE>
#:: <CODE>% $EDITOR ./cionize/Makefile.specialbuilds ./Make-arch ./Make-arch.debug</CODE>
#::: CHANGE: edit <CODE>{{Con|tcl8.5}}</CODE> and <CODE>{{Con|tk8.5}}</CODE> to be <CODE>tcl8.6</CODE> and <CODE>tk8.6</CODE> respectively if that's the version of Tcl/Tk installed on your system
#: <CODE>% make <''architecture''></CODE> &mdash; E.g. LINUXAMD64
#: <CODE>% make distrib</CODE>
#: <CODE>% make distrib</CODE>
# Configure VMD
# Configure VMD
#: <CODE>% cd ../vmd-<version></CODE>
#: <CODE>% cd ../vmd-<''version''></CODE>
#: <CODE>% $EDITOR configure.options</CODE>
#: <CODE>% $EDITOR configure.options</CODE>
#::Enter a list of desired options -- make sure to include <CODE>FREEVR</CODE>
#::Enter a list of desired options -- make sure to include <CODE>FREEVR</CODE>
#::A sample list is:
#::A sample list is:
#::* <CODE>LINUXAMD64 OPENGL FREEVR FLTK TK TCL PTHREADS</CODE>
#::* <CODE>LINUXAMD64 OPENGL FREEVR FLTK TK TCL PTHREADS</CODE>
#::An expanded list is:
#::* <CODE>LINUXAMD64 OPENGL OPENGLPBUFFER FREEVR FLTK TK CXX11 XINERAMA XINPUT LIBPNG ZLIB VRPN NETCDF TCL PTHREADS SILENT</CODE>
#::(I don't necessarily know what all those do and whether they help or not)
#::(As of this writing [12/21/23] I was unable to get the <CODE>CUDA</CODE>, <CODE>Optix</CODE> or <CODE>Python</CODE> options to build.)
#: <CODE>% $EDITOR configure</CODE>
#:: CHANGE: <CODE>install_bin_dir=&LT;''installation-path''&GT;/bin</CODE>
#:: CHANGE: <CODE>install_library_dir=&LT;''installation-path''&GT;/lib/$install_name</CODE>
#: <CODE>% ./configure</CODE>
#: <CODE>% ./configure</CODE>
# Compile VMD
# Compile VMD
#: <CODE>% cd <path>/vmd-<''version''></CODE>
#: <CODE>% export PLUGINDIR=`pwd`/plugins</CODE> &mdash; only if you're in a different shell from where this happened in step 4
#: <CODE>% export PLUGINDIR=`pwd`/plugins</CODE> &mdash; only if you're in a different shell from where this happened in step 4
#: <CODE>% cd src</CODE>
#: <CODE>% cd src</CODE>
#: <CODE>% $EDITOR Makefile</CODE>
#: <CODE>% $EDITOR Makefile</CODE>
#::NOTE: you will need to edit the values for <CODE>INCDIRS</CODE> and <CODE>LIBDIRS</CODE> to point to the correct directory for the '''FreeVR''' includes and library.
#:: CHANGE: edit the values for <CODE>INCDIRS</CODE> and <CODE>LIBDIRS</CODE> to point to the correct directory for the '''FreeVR''' includes and library.
#: <CODE>* make veryclean</CODE>
#::* (UNLESS: you've configured <CODE>$CPATH</CODE> and <CODE>$LPATH</CODE>, perhaps through the "modules" system.)
#:: CHANGE: edit <CODE>{{Con|tcl8.5}}</CODE> and <CODE>{{Con|tk8.5}}</CODE> to be <CODE>tcl8.6</CODE> and <CODE>tk8.6</CODE> respectively if that's the version of Tcl/Tk installed on your system
#::* NOTE: Ideally the VMD build system would just specify <CODE>tcl8</CODE> and <CODE>tk8</CODE>.
#: <CODE>% make veryclean</CODE>
#: <CODE>% make -j 8</CODE>
#: <CODE>% make -j 8</CODE>
#::NOTE: you will get several compiler warnings.  As long as they are only warnings, you should be fine.
#:: NOTE: you will get a handful compiler warnings.  As long as they are only warnings, you should be fine.
# Install VMD
# Install VMD
#: <CODE>% sudo make install</CODE>
#: <CODE>% sudo make install</CODE>
# &#91;Optional&#93; Create a ''module'' file for VMD
#: <CODE>% $EDITOR &LT;''module-path''&GT;/vmd/&LT;''vmd-version''&GT;</CODE>
#:: Set all the appropriate environment variables for VMD (<CODE>PATH</CODE>).


At this point you can now run VMD in standard desktop mode.
At this point you can now run VMD in standard desktop mode.
Line 67: Line 115:




==How to Configure VMD for Immersive displays==
=General Usage=
==Usage Tidbits==
 
* To place the FLTK menu interface on a screen separate from the immersive displays, use the <CODE>DISPLAY</CODE> environment variable prior to running the <CODE>vmd</CODE> command.
 
* To change the overall world transformation via the Tcl command shell, try these options:
** <CODE>vmd > '''scale to .5'''</CODE>
** <CODE>vmd > '''translate to 0 0 -3'''</CODE>
** <CODE>vmd > '''rotate y by 5'''</CODE>
 
* To modify the atomic/molecular representation:
** <CODE>vmd > '''mol modstyle 0 0 CPK; puts "CPK"'''</CODE>
** <CODE>vmd > '''mol modstyle 0 0 Licorice; puts "Licorice"'''</CODE>


There are two stages of configuration required for the overall configuration of VMD for immersive displays.
* To modify selected objects:
The first step is to configure FreeVR for the specific hardware setup of the immersive facility.  This is explained in the FreeVR documentation.
** <CODE>vmd > '''set a [atomselect 0 all]'''</CODE>
The second stage is to link the FreeVR inputs to VMD "sensors devices".
** <CODE>vmd > '''set xval 4'''</CODE>
** <CODE>vmd > '''set yval 2'''</CODE>
** <CODE>vmd > '''$a moveby [list $xval $yval 0]'''</CODE>


VMD "sensor devices" are specified in the <CODE>.vmdsensors</CODE> file.
* To connect VR and other inputs to TCL scripts:
The format of this file is described in the [http://www.ks.uiuc.edu/Research/vmd/vmd-1.9.1/ug/node49.html VMD User's Guide: Tool Window] documentation.
** <CODE>vmd > '''user add key Aux-5 { scale by 1.3 }'''</CODE>
** <CODE>vmd > '''user add key Aux-7 { scale by 0.7 }'''</CODE>
** <CODE>vmd > '''user add key Aux-6 { animate forward; puts "play" }'''</CODE>
** <CODE>vmd > '''user add key Aux-8 { animate forward; puts "pause" }'''</CODE>
** <CODE>vmd > '''user add key Aux-0 { mol modstyle 0 0 CPK; puts "CPK" }'''</CODE>
** <CODE>vmd > '''user add key Aux-1 { mol modstyle 0 0 Licorice; puts "Licorice"'''</CODE>


* Create a <CODE>.vmdsensors</CODE> file:
* To add new objects/annotations into the world:
*: Here is a sample <CODE>.vmdsensors</CODE> file for use with FreeVR:
** <CODE>vmd > '''graphics top text {  0 0 0 } "hello"'''</CODE>
<BLOCKQUOTE>
** <CODE>vmd > '''graphics top cone { 40 0 0 } { 40 0 10 } radius 10 resolution 60'''</CODE>
<PRE>
** <CODE>vmd > '''graphics top line { 10 0 0 } {  0 0 0 } width 5 style dashed'''</CODE>
###   
** <CODE>vmd > '''graphics top list'''</CODE> &mdash; output a list of object IDs ''(I think)''
### Configuration for the FreeVR trackers
** <CODE>vmd > '''graphics top info 1'''</CODE> &mdash; or any of the ID numbers returned in the list
###   
device freevrtracker freevrtracker://local/freevr
scale 0.5
offset 0.9 -4.0 -1.0
device freevrbuttons freevrbuttons://local/freevr:0,1,2,3
## if you have more than one wand..
#device vrtracker2 freevrtracker://local/freevr:1
#scale 1.0
#offset 0.9 -4.0 -1.0
</PRE>
</BLOCKQUOTE>


=General Usage=
* Useful system commands:
==Usage Tidbits==
** <CODE>vmd > '''logfile console'''</CODE> &mdash start recording interactions as TCL commands ''(like ParaView's trace)''
** <CODE>vmd > '''logfile off'''</CODE> &mdash; stop the TCL command trace and output the results
** <CODE>vmd > '''menu main off'''</CODE> &mdash; or <CODE>on</CODE>
** <CODE>vmd > '''menu list'''</CODE> &mdash; list all the interface menus
** <CODE>vmd > '''user print keys'''</CODE> &mdash; list all the keyboard shortcuts


* To change the overall world transformation via the Tcl command shell, try these options:
* To get information about the environment:
** <CODE>scale to .5</CODE>
** <CODE>vmd > '''vmdinfo arch'''</CODE>
** <CODE>translate to 0 0 -3</CODE>
** <CODE>vmd > '''echo $auto_path'''</CODE> &mdash; lists the path whence plugins are searched


* To place the FLTK menu interface on a screen separate from the immersive displays, use the <CODE>DISPLAY</CODE> environment variable.
* Commands that aren't useful in Immersive Mode:
** <CODE>vmd > '''display resize 1920 1080'''</CODE>
** <CODE>vmd > '''display projection orthographic'''</CODE>




==Usage Issues==
==Usage Issues==


[NOTE: these issues are from tests with VMD version 1.9.2a15.]
[NOTE: these issues are from tests with VMD version 1.9.2a15. (And need to be re-tested with version 1.9.4a57)]


* I still need to figure out the proper scale and offset (this would/will be easier if we can avoid the use of Euler angles in <CODE>P_GrabTool.C</CODE>).
* I still need to figure out the proper scale and offset (this would/will be easier if we can avoid the use of Euler angles in "<CODE>P_GrabTool.C</CODE>").
* The <CODE>grab</CODE> tool only grabs one molecule object at a time, so multiple molecules won't stay together.
* The <CODE>grab</CODE> tool only grabs one molecule object at a time, so multiple molecules won't stay together.
* The <CODE>grab</CODE> tool requires that the wand avatar be touching an object before it can be moved.
* The <CODE>grab</CODE> tool requires that the wand avatar be touching an object before it can be moved.
Line 118: Line 180:
* Changes in representations seem to only have an effect on a single screen.
* Changes in representations seem to only have an effect on a single screen.


==Build Issues==
* VMD should compile with Tcl/Tk 8.6 (as mentioned above), probably better to just use the major version number
* The CUDA option did not compile for me as it's hard-coded to Cuda version 10.2, and I have version 12.3.
* Some of the plugins report as being broken when starting VMD -- but some of them work, so it's not a matter of improperly building/installing the "plugins".


==Development Issues==
==Development Issues==
===Immersive-mode development issues===
This section is for issues that are of interest to those working directly on the VMD code-base as it relates to immersive interfaces.
This section is for issues that are of interest to those working directly on the VMD code-base as it relates to immersive interfaces.


* '''DONE:''' Need to figure out how to pass <CODE>RenderInfo *</CODE> argument to <CODE>FreeVRScene::draw()</CODE> in order to add the navigation controls to where the virtual world is rendered.
* '''DONE:''' Need to figure out how to pass <CODE>RenderInfo *</CODE> argument to <CODE>FreeVRScene::draw()</CODE> in order to add the navigation controls to where the virtual world is rendered.
* Need to go over the source code in <CODE>P_GrabTool.C</CODE> so that I can know how to improve it (and I'll add comments as we go.)  My goal is to avoid the use of Euler angles, since there are gimble lock issues in the interface.
* Need to go over the source code in "<CODE>P_GrabTool.C</CODE>" so that I can know how to improve it (and I'll add comments as we go.)  My goal is to avoid the use of Euler angles, since there are gimble lock issues in the interface.
* Consider adding a <CODE>grab-world</CODE> tool that allows the entire world to be grabbed with the wand.  '''An alternative was done &mdash; an always active "Grab-World" operation.'''  
* Consider adding a <CODE>grab-world</CODE> tool that allows the entire world to be grabbed with the wand.  '''An alternative was done &mdash; an always active "Grab-World" operation.'''  
* Determine whether there is a mechanism to enable an X11 window always-on-top property for the FLTK control menu.
* Determine whether there is a mechanism to enable an X11 window always-on-top property for the FLTK control menu.
** Alternatively, a command that returns the X11 id of a menu's window could be used by a tool like <CODE>xdotool</CODE> to manipulate the window however is desired.
===Non-immersive development issues===
* Can FLTK menus work without OPENGL enabled?
* Running <CODE>./configure</CODE> should report installation directories &mdash; since those are options we may want to change (otherwise one may not know where these can be configured).
* Is there a command (if not, can one be added) that reports the configuration options of the compiled VMD?
* <S>"Lines" and "Points" representations don't seem to work when rendering from BigRedII to the desktop.</S>
** (I don't care about the BigRedII HPC system anymore, but this issue may also exist when using VNC, etc.)
===ANARI development issues===
* Using the "standard" <CODE>ANARI_LIBRARY</CODE> environment variable to specify the backend would be preferred.
* Outputting a still-render to ''ImageMagick'' at the end of a <CODE>ANARI (interactive)</CODE> session should be optional &mdash; perhaps generated by a keyboard shortcut.
=VMD with ANARI=
NOTE: presently the VMD ANARI build is under development, but if you happen to have a working binary, here are some instructions:
==Running VMD with ANARI==
# <CODE>% module load cuda anari vmd</CODE>
# <CODE>% export VMDANARIDEVICE=&LT;''backend-library''&GT;</CODE> (e.g. <CODE>visrtx</CODE>)
#* NOTE: It would be better if VMD used the "standard" <CODE>ANARI_LIBRARY</CODE> environment variable.
# <CODE>% vmd &LT;''options''&GT;</CODE>
# Start ANARI rendering:
#* File Menu -> Render
#*# Select: Render the current scene using: <CODE>ANARI (interactive)</CODE>
#*# Use mouse to interact
#*# To end interactive session: Type <CODE>q</CODE> in the window
#*# This will render and display a still image using ''ImageMagick''
#*# Again type <CODE>q</CODE> to quit ''ImageMagick'' window


=HPC Usage of VMD=
=HPC Usage of VMD=
Line 131: Line 227:
on HPC systems such as the Indiana University [http://kb.iu.edu/data/bcqt.html BigRedII supercomputer].
on HPC systems such as the Indiana University [http://kb.iu.edu/data/bcqt.html BigRedII supercomputer].


==Interactive Running VMD on BigRedII==
==Running VMD via command-driving interactions on BigRedII==
Presently, the VMD installed on BigRedII can be used interactively via the TCL command language.
Presently, the VMD installed on BigRedII can be used interactively via the TCL command language.
Once running in an interactive shell, a molecule can be loaded and rendered with this simple
Once running in an interactive shell, a molecule can be loaded and rendered with these simple
commands:
commands:


Line 141: Line 237:
#:<CODE>% vmd</CODE>
#:<CODE>% vmd</CODE>
#Load an example molecule:
#Load an example molecule:
#:<CODE>vmd &gt; mol new &lt;path&gt;/brH.pdb</CODE>
#:<CODE>vmd &gt; mol new &lt;''path''&gt;/brH.pdb</CODE>
#Render the current "view" to an image file:
#Render the current "view" to an image file:
#:<CODE>vmd &gt; render TachyonInternal &lt;filename&Ggt;.ppm</CODE>
#:<CODE>vmd &gt; render TachyonInternal &lt;''filename''&gt;.ppm</CODE>
#Quit VMD
#Quit VMD
#:<CODE>vmd &gt; quit</CODE>
#:<CODE>vmd &gt; quit</CODE>


==Batch VMD on BigRedII==
Then, perhaps in another shell, an image viewer program can be used to see the rendered text.
[NOTE: this requires logging on from an X11-cabable desktop system and using the <CODE>-X</CODE>
flag to <CODE>ssh</CODE>.]
* Use the FEH image viewer:
*:<CODE>% module load imlib2 feh</CODE>
*:<CODE>% feh --reload 1 &lt;''filename''&gt;.ppm</CODE>
* or use the Eye-of-Gnome viewer:
*:<CODE>% eog &lt;''filename''&gt;.ppm</CODE>
 
 
==Links to Old Immersive Mode VMD wiki pages==
Here are links to previous versions of this page that were designed for older VMD releases:
* [https://wiki.iq-station.com/index.php?title=VMD&oldid=197 VMD 1.9.1 instructions (April 2014)]
* [https://wiki.iq-station.com/index.php?title=VMD '''Return to current version''']

Latest revision as of 11:04, 22 December 2023

Visual Molecular Dynamics (VMD)

VMD is a good visualization tool for visualizing large molecular systems (typically used for large biomolecular systems). VMD has a long history of being interfaced to immersive technologies, including haptic devices and CAVE VR displays. There is also a section on the usage of VMD for HPC systems.

Immersive Mode VMD

Information specific to the usage and setup of VMD for immserive systems such as the CAVE virtual reality display.


How to Run VMD in Immersive Mode

If VMD with the FreeVR interface is installed and properly configured, follow these steps to run in immersive mode:

  1. % module load freevr vmd
  2. % vmd -dispdev freevrforms <path>/proteins/brH.pdb
    • This alone should be sufficient to render the molecule in the VR system, with joystick-controlled travel
  3. In order to grab and move an object, the grab tool must be initialized:
    1. GraphicsTools
    2. Create a grab style tool
    3. set Position to FreeVRTracker
    4. set Buttons to FreeVRButtons
    The wand avatar will now appear in the scene
  4. Now touch an object with the wand avatar and press Button-1 to move it.

How to Configure VMD for Immersive displays

There are two stages of configuration required for the overall configuration of VMD for immersive displays. The first step is to configure FreeVR for the specific hardware setup of the immersive facility. This is explained in the FreeVR documentation. The second stage is to link the FreeVR inputs to VMD "sensors devices".

VMD "sensor devices" are specified in the .vmdsensors file. The format of this file is described in the VMD User's Guide: Tool Window documentation.

  • Create a .vmdsensors file in your $HOME directory or the local directory:
    Here is a sample .vmdsensors file for use with FreeVR:
###     
### Configuration for the FreeVR trackers
###     
device freevrtracker freevrtracker://local/freevr
scale 0.5
offset 0.9 -4.0 -1.0
device freevrbuttons freevrbuttons://local/freevr:0,1,2,3
## uncomment the following if you have more than one wand:
#device vrtracker2 freevrtracker://local/freevr:1
#scale 1.0
#offset 0.9 -4.0 -1.0


How to Build VMD w/ Immersive features

This section specifically instructs on how to compile VMD using the FreeVR immersive interface library.

  1. Install missing dependencies
    Commonly needed packages include:
    • tcl-devel (8.5 -- 8.6 works with edits to Makefile)
    • tk-devel (8.5 -- 8.6 works with edits to Makefile)
    • fltk-devel
    • netcdf-devel
  2. Download the latest source (version 1.9.4a57 as of this writing [12/21/23])
    http://www.ks.uiuc.edu/Development/Download/download.cgi?PackageName=VMD
    NOTE: there is a (free) registration process required
    NOTE: the pre-built packages may not contain the Immersive features
  3. Untar the source ball
    E.g. % tar -zxf vmd-<version>.src.tar.gz
    (As of this writing [12/21/23] <version> is 1.9.4a57)
  4. Compile the plugins
    % export PLUGINDIR=`pwd`/vmd-<version>/plugins
    % cd plugins
    Ensure the Makefiles are set for the proper version of Tcl/Tk:
    % $EDITOR ./cionize/Makefile.specialbuilds ./Make-arch ./Make-arch.debug
    CHANGE: edit tcl8.5 and tk8.5 to be tcl8.6 and tk8.6 respectively if that's the version of Tcl/Tk installed on your system
    % make <architecture> — E.g. LINUXAMD64
    % make distrib
  5. Configure VMD
    % cd ../vmd-<version>
    % $EDITOR configure.options
    Enter a list of desired options -- make sure to include FREEVR
    A sample list is:
    • LINUXAMD64 OPENGL FREEVR FLTK TK TCL PTHREADS
    An expanded list is:
    • LINUXAMD64 OPENGL OPENGLPBUFFER FREEVR FLTK TK CXX11 XINERAMA XINPUT LIBPNG ZLIB VRPN NETCDF TCL PTHREADS SILENT
    (I don't necessarily know what all those do and whether they help or not)
    (As of this writing [12/21/23] I was unable to get the CUDA, Optix or Python options to build.)
    % $EDITOR configure
    CHANGE: install_bin_dir=<installation-path>/bin
    CHANGE: install_library_dir=<installation-path>/lib/$install_name
    % ./configure
  6. Compile VMD
    % cd <path>/vmd-<version>
    % export PLUGINDIR=`pwd`/plugins — only if you're in a different shell from where this happened in step 4
    % cd src
    % $EDITOR Makefile
    CHANGE: edit the values for INCDIRS and LIBDIRS to point to the correct directory for the FreeVR includes and library.
    • (UNLESS: you've configured $CPATH and $LPATH, perhaps through the "modules" system.)
    CHANGE: edit tcl8.5 and tk8.5 to be tcl8.6 and tk8.6 respectively if that's the version of Tcl/Tk installed on your system
    • NOTE: Ideally the VMD build system would just specify tcl8 and tk8.
    % make veryclean
    % make -j 8
    NOTE: you will get a handful compiler warnings. As long as they are only warnings, you should be fine.
  7. Install VMD
    % sudo make install
  8. [Optional] Create a module file for VMD
    % $EDITOR <module-path>/vmd/<vmd-version>
    Set all the appropriate environment variables for VMD (PATH).

At this point you can now run VMD in standard desktop mode.

  • For example:
    % vmd ../proteins/brH.pdb


General Usage

Usage Tidbits

  • To place the FLTK menu interface on a screen separate from the immersive displays, use the DISPLAY environment variable prior to running the vmd command.
  • To change the overall world transformation via the Tcl command shell, try these options:
    • vmd > scale to .5
    • vmd > translate to 0 0 -3
    • vmd > rotate y by 5
  • To modify the atomic/molecular representation:
    • vmd > mol modstyle 0 0 CPK; puts "CPK"
    • vmd > mol modstyle 0 0 Licorice; puts "Licorice"
  • To modify selected objects:
    • vmd > set a [atomselect 0 all]
    • vmd > set xval 4
    • vmd > set yval 2
    • vmd > $a moveby [list $xval $yval 0]
  • To connect VR and other inputs to TCL scripts:
    • vmd > user add key Aux-5 { scale by 1.3 }
    • vmd > user add key Aux-7 { scale by 0.7 }
    • vmd > user add key Aux-6 { animate forward; puts "play" }
    • vmd > user add key Aux-8 { animate forward; puts "pause" }
    • vmd > user add key Aux-0 { mol modstyle 0 0 CPK; puts "CPK" }
    • vmd > user add key Aux-1 { mol modstyle 0 0 Licorice; puts "Licorice"
  • To add new objects/annotations into the world:
    • vmd > graphics top text { 0 0 0 } "hello"
    • vmd > graphics top cone { 40 0 0 } { 40 0 10 } radius 10 resolution 60
    • vmd > graphics top line { 10 0 0 } { 0 0 0 } width 5 style dashed
    • vmd > graphics top list — output a list of object IDs (I think)
    • vmd > graphics top info 1 — or any of the ID numbers returned in the list
  • Useful system commands:
    • vmd > logfile console &mdash start recording interactions as TCL commands (like ParaView's trace)
    • vmd > logfile off — stop the TCL command trace and output the results
    • vmd > menu main off — or on
    • vmd > menu list — list all the interface menus
    • vmd > user print keys — list all the keyboard shortcuts
  • To get information about the environment:
    • vmd > vmdinfo arch
    • vmd > echo $auto_path — lists the path whence plugins are searched
  • Commands that aren't useful in Immersive Mode:
    • vmd > display resize 1920 1080
    • vmd > display projection orthographic


Usage Issues

[NOTE: these issues are from tests with VMD version 1.9.2a15. (And need to be re-tested with version 1.9.4a57)]

  • I still need to figure out the proper scale and offset (this would/will be easier if we can avoid the use of Euler angles in "P_GrabTool.C").
  • The grab tool only grabs one molecule object at a time, so multiple molecules won't stay together.
  • The grab tool requires that the wand avatar be touching an object before it can be moved.
  • The rotate tool does not work
  • I don't know how to use the joystick tool — does it work with the VR interfaces?
  • I need to learn whether (and if so what) the command-line and/or tcl-shell options for setting up the graphics tools w/o the need for the interactive menu.
  • There are gimble lock issues when the wand points up or down.
  • The material colors of some/all of the objects in the scene are not always present.
  • Changes in representations seem to only have an effect on a single screen.

Build Issues

  • VMD should compile with Tcl/Tk 8.6 (as mentioned above), probably better to just use the major version number
  • The CUDA option did not compile for me as it's hard-coded to Cuda version 10.2, and I have version 12.3.
  • Some of the plugins report as being broken when starting VMD -- but some of them work, so it's not a matter of improperly building/installing the "plugins".

Development Issues

Immersive-mode development issues

This section is for issues that are of interest to those working directly on the VMD code-base as it relates to immersive interfaces.

  • DONE: Need to figure out how to pass RenderInfo * argument to FreeVRScene::draw() in order to add the navigation controls to where the virtual world is rendered.
  • Need to go over the source code in "P_GrabTool.C" so that I can know how to improve it (and I'll add comments as we go.) My goal is to avoid the use of Euler angles, since there are gimble lock issues in the interface.
  • Consider adding a grab-world tool that allows the entire world to be grabbed with the wand. An alternative was done — an always active "Grab-World" operation.
  • Determine whether there is a mechanism to enable an X11 window always-on-top property for the FLTK control menu.
    • Alternatively, a command that returns the X11 id of a menu's window could be used by a tool like xdotool to manipulate the window however is desired.

Non-immersive development issues

  • Can FLTK menus work without OPENGL enabled?
  • Running ./configure should report installation directories — since those are options we may want to change (otherwise one may not know where these can be configured).
  • Is there a command (if not, can one be added) that reports the configuration options of the compiled VMD?
  • "Lines" and "Points" representations don't seem to work when rendering from BigRedII to the desktop.
    • (I don't care about the BigRedII HPC system anymore, but this issue may also exist when using VNC, etc.)

ANARI development issues

  • Using the "standard" ANARI_LIBRARY environment variable to specify the backend would be preferred.
  • Outputting a still-render to ImageMagick at the end of a ANARI (interactive) session should be optional — perhaps generated by a keyboard shortcut.


VMD with ANARI

NOTE: presently the VMD ANARI build is under development, but if you happen to have a working binary, here are some instructions:

Running VMD with ANARI

  1. % module load cuda anari vmd
  2. % export VMDANARIDEVICE=<backend-library> (e.g. visrtx)
    • NOTE: It would be better if VMD used the "standard" ANARI_LIBRARY environment variable.
  3. % vmd <options>
  4. Start ANARI rendering:
    • File Menu -> Render
      1. Select: Render the current scene using: ANARI (interactive)
      2. Use mouse to interact
      3. To end interactive session: Type q in the window
      4. This will render and display a still image using ImageMagick
      5. Again type q to quit ImageMagick window


HPC Usage of VMD

This section describes specific usage and compiling issues related the VMD on HPC systems such as the Indiana University BigRedII supercomputer.

Running VMD via command-driving interactions on BigRedII

Presently, the VMD installed on BigRedII can be used interactively via the TCL command language. Once running in an interactive shell, a molecule can be loaded and rendered with these simple commands:

  1. Load the vmd module:
    % module load vmd
  2. Start VMD:
    % vmd
  3. Load an example molecule:
    vmd > mol new <path>/brH.pdb
  4. Render the current "view" to an image file:
    vmd > render TachyonInternal <filename>.ppm
  5. Quit VMD
    vmd > quit

Then, perhaps in another shell, an image viewer program can be used to see the rendered text. [NOTE: this requires logging on from an X11-cabable desktop system and using the -X flag to ssh.]

  • Use the FEH image viewer:
    % module load imlib2 feh
    % feh --reload 1 <filename>.ppm
  • or use the Eye-of-Gnome viewer:
    % eog <filename>.ppm


Links to Old Immersive Mode VMD wiki pages

Here are links to previous versions of this page that were designed for older VMD releases: