ORCAView

Table of Contents

1. Keybindings

Tab Key Description
3D Viewer C-d open drawer
  C-1 … C-4, C-` select mode

2. Dependencies

  • avodagro2-bin (AUR)
  • multiwfn-bin (AUR)
  • xtb-git (AUR)
  • orcaqm (AUR)
  • Gaussian 16 (Manual)
  • rdkit (pacman extra)

3. Gaussian 16 on AMD Zen 2+ (g16-kvm wrapper)

Added 2026-10-08.

3.1. Symptom

Gaussian 16 Rev A.03 (/opt/Gaussian-16, the "AVX2" build, PGI compiled) started from ORCAView or the shell dies silently: the log stops right after the Symbolic Z-matrix block, no Error termination line, and formchk segfaults too.

3.2. Cause

The PGI runtime inside every link (l101.exe …) dispatches on the CPUID vendor string. On AuthenticAMD it selects AMD FMA4 code paths (vfmaddsd with four operands). FMA4 was dropped in Zen 2, so the Ryzen 5 5600 raises SIGILL. Check with:

coredumpctl list | grep Gaussian          # SIGILL in l101.exe
coredumpctl debug <pid> --debugger-arguments="-batch -ex 'x/1i \$pc'"
# => vfmaddsd %xmm1,%xmm5,%xmm2,%xmm1   (FMA4)
grep -o -w fma4 /proc/cpuinfo             # empty on Zen 2+

Real fix: Gaussian Rev C.01 or the "Legacy" SSE4.2 build. Until then the wrapper below is used.

3.3. Wrapper: /usr/local/bin/g16

  • Source staged at ~/.local/bin/g16-kvm (identical file). Install with

    sudo install -m 755 ~/.local/bin/g16-kvm /usr/local/bin/g16
    
  • /usr/local/bin precedes /opt/Gaussian-16/ (appended by /etc/profile.d/gaussian.sh), so g16 resolves to the wrapper for the shell and for ORCAView.
  • Usage is unchanged: g16 input.gjf [output.log] or g16 < input.gjf > output.log. Exit code, stdout and stderr are relayed.

3.3.1. How it works

  1. Boots the host's own kernel (/usr/lib/modules/<ver>/vmlinuz) in QEMU/KVM with -cpu host,vendor=GenuineIntel,pmu=off,kvm-pv-ipi=off,kvm-pv-unhalt=off,kvm-pv-sched-yield=off. With an Intel vendor id the PGI runtime takes the FMA3/AVX2 path and the unmodified binaries run at near-native speed.
  2. A 7 MB initramfs (mkinitcpio, hooks base, modules 9p 9pnet_virtio) is built once per kernel version into ~/.cache/g16-kvm/<ver>-<hash>/ and rebuilt automatically after a kernel update. No root needed.
  3. The guest init (busybox ash, rdinit) mounts over virtio-9p:

    • host / read-only (hostroot, cache=loose, multidevs=remap)
    • current directory read-write (work, cache=none so the log is live on the host)
    • $GAUSS_SCRDIR read-write (scr, cache=loose)
    • a per-job control dir $GAUSS_SCRDIR/kvm-ctl.XXXXXX (ctl) holding job.env, stage2.sh, captured stdin, stdout, stderr, exit_code, console.log.

    tmpfs is put on /tmp, /run, /var/tmp unless the job dir lives there.

  4. chroot /newroot bash stage2.sh exports the host's GAUSS_*, OMP_*, KMP_*, HOME, PATH, sets ulimit -s unlimited, cds to the work dir and runs the real $GAUSS_EXEDIR/g16 with the original arguments.
  5. Guest powers off; the wrapper tails stdout/stderr live, reads the exit code and deletes the control dir.

3.3.2. Environment knobs

Variable Effect
G16_KVM_NATIVE=1 bypass the VM, exec the real binary
G16_KVM_MEM=12G guest RAM (default: host RAM minus 2 GiB)
G16_KVM_CPUS=8 guest vCPUs (default: nproc)
G16_KVM_DEBUG=1 print guest console, keep the control dir
G16_KVM_REBUILD=1 force rebuilding the initramfs
G16_REAL=/path real launcher (default $GAUSS_EXEDIR/g16)

3.3.3. Pitfalls met while building it

  • A tmpfs over /tmp hid a work directory under /tmp; overlays are now skipped when the job or scratch dir is inside them.
  • With vendor GenuineIntel the guest kernel emits vmcall; KVM on AMD tries to patch it in read-only kernel text and the guest oopses in kvm_hypercall4. Hence the kvm-pv-*=off flags and oops=panic panic-1= with -no-reboot so a crash exits instead of hanging.
  • pkill -f qemu... inside a shell whose own command line contains the pattern kills the shell. Use pkill -x or pkill -f "[q]emu".

3.3.4. Verified 2026-10-08

Benzene B3LYP/6-31G(d) SP: Normal termination in 3.0 s wall including VM boot, in file mode, stdin mode and with the work dir nested inside ~/.gaussian. A bad basis set returns exit 1 with Error termination.

3.3.5. Not covered

formchk, cubegen and the other utilities are not wrapped and still SIGILL natively. ORCAView's fchk step therefore still fails until a Zen- compatible Gaussian build is installed.

Author: Jeemin Kim

Created: 2026-10-27 Tue 05:56