Skip to main content

Overview

Testing drivers requires special care due to the potential for system instability. This guide covers safe testing practices, debugging techniques, and common testing scenarios.
Driver bugs can cause system crashes, blue screens, or hardware issues. Always test drivers on non-production systems or virtual machines.

Testing Environments

Priority order:
  1. Virtual Machine (Safest)
    • VMware Workstation, VirtualBox, or Hyper-V
    • Easy to snapshot and revert
    • Isolated from host system
    • Supports nested virtualization for testing
  2. Dedicated Test Machine
    • Secondary computer for driver testing
    • Can recover via Safe Mode if needed
    • Real hardware testing environment
  3. Dual Boot Configuration
    • Separate Windows installation for testing
    • Production OS remains safe
    • Requires disk partitioning
For initial development, use a Windows 11 VM with at least 4GB RAM and 2 CPU cores. Enable nested virtualization if your hypervisor supports it.

Environment Checklist

Before testing:
  • System snapshot or backup created
  • Test signing mode enabled (for development builds)
  • WinDbg or kernel debugger configured (optional but recommended)
  • All personal data backed up
  • Safe Mode boot option verified
  • Recovery USB or installation media available

Pre-Installation Testing

Static Analysis

PREfast Code Analysis: Enabled by default in the project:
<RunCodeAnalysis>true</RunCodeAnalysis>
<EnablePREfast>true</EnablePREfast>
Address all warnings before installation:
  • Memory leaks
  • Buffer overflows
  • Uninitialized variables
  • Invalid pointer usage
  • NTSTATUS handling errors

Driver Verifier (Static Check)

Before installing, verify the driver binary:
# Check for basic issues
verifier /query

# Analyze driver binary (static)
verifier /flags 0x209BB /driver MttVDD.dll
Common flags:
  • 0x209BB - Standard settings
  • 0xFFFFFFFF - All tests (very strict)

Signature Verification

Ensure driver is properly signed:
# Verify signature
signtool verify /v /pa MttVDD.cat
signtool verify /v /pa MttVDD.dll
See Driver Signing for details.

Installing Test Drivers

Enable Test Signing

Only enable test signing on test systems. This reduces security.
# Run as Administrator
bcdedit /set testsigning on
# Reboot required
Verify test mode is active:
  • “Test Mode” watermark appears on desktop
  • Check Settings → System → About → Windows specifications

Manual Driver Installation

Method 1: Device Manager
  1. Open Device Manager (devmgmt.msc)
  2. Click ActionAdd legacy hardware
  3. Select Install the hardware that I manually select
  4. Choose Display adapters
  5. Click Have Disk
  6. Browse to MttVDD.inf
  7. Follow installation wizard
Method 2: PnPUtil
# Run as Administrator
cd path\to\driver\output

# Install driver package
pnputil /add-driver MttVDD.inf /install

# Verify installation
pnputil /enum-drivers | findstr "MttVDD"

Verifying Installation

Check if driver loaded successfully:
# Check driver status
sc query MttVDD

# List loaded drivers
driverquery | findstr "MttVDD"

# Check Device Manager
# Look under "Display adapters" for "Virtual Display Driver"
Event Viewer (check for errors):
# Open Event Viewer
eventvwr.msc

# Navigate to:
# Windows Logs → System
# Filter for source: "MttVDD" or "DriverFrameworks-UserMode"

Runtime Testing

Basic Functionality Tests

1. Monitor Creation

Test: Verify virtual monitors appear
# Check display configuration
displayswitch /internal
displayswitch /external

# PowerShell: List all displays
Get-CimInstance -Namespace root\wmi -ClassName WmiMonitorBasicDisplayParams
Verify:
  • Virtual monitors appear in Display Settings
  • Correct number of monitors (based on vdd_settings.xml)
  • Monitors show as “Active” in Device Manager

2. Resolution Configuration

Test: Change virtual monitor resolution
  1. Open Settings → System → Display
  2. Select virtual monitor
  3. Try different resolutions from dropdown
  4. Apply and verify no crashes
Via PowerShell:
# Change resolution (requires third-party tool or API call)
# Example: Set to 1920x1080

3. Refresh Rate Testing

Test: Verify refresh rate options
  1. Display Settings → Advanced display
  2. Select virtual monitor
  3. Check available refresh rates
  4. Change to different rate (e.g., 60Hz → 144Hz)
  5. Verify smooth operation

4. HDR Capability

Test: HDR toggle (if configured)
  1. Display Settings → HDR
  2. Enable HDR for virtual monitor
  3. Verify no errors
  4. Test HDR content playback
HDR testing requires Windows 11 23H2+ and IddCx 1.10 driver build.

5. Multi-Monitor Configuration

Test: Multiple virtual displays
  1. Create 2+ virtual monitors
  2. Arrange displays in Settings
  3. Extend desktop across monitors
  4. Move windows between displays
  5. Test taskbar on each monitor

Application Compatibility Tests

Streaming Applications

Test with:
  • OBS Studio
  • Parsec
  • Moonlight
  • Steam Remote Play
  • Virtual Desktop (VR)
Verify:
  • Application detects virtual monitor
  • Can select virtual monitor as source
  • Streaming works without artifacts
  • Performance is acceptable

VR Applications

Test with:
  • Oculus/Meta Quest Link
  • SteamVR
  • Virtual Desktop
Verify:
  • VR app can use virtual monitor
  • No performance degradation
  • Display synchronization works

Recording Software

Test with:
  • OBS Studio
  • NVIDIA ShadowPlay (if applicable)
  • Windows Game Bar
Verify:
  • Can record from virtual display
  • No frame drops
  • Audio/video sync maintained

Stress Testing

1. Rapid Configuration Changes

# Script: Change resolution rapidly
for ($i=0; $i -lt 100; $i++) {
    # Toggle between resolutions
    # Monitor for crashes
}

2. Multiple Monitor Cycling

Test: Add/remove monitors repeatedly
  • Install driver → uninstall → reinstall
  • Create monitors → delete → recreate
  • Monitor system stability

3. Long-Duration Testing

Test: Leave driver running for extended period
  • 24+ hours continuous operation
  • Monitor for memory leaks
  • Check Event Viewer for errors
  • Verify performance doesn’t degrade

4. GPU Stress Testing

Test: Heavy GPU load while using virtual display
  • Run 3DMark or FurMark on physical display
  • Simultaneously stream from virtual display
  • Monitor temperatures and stability

GPU Adapter Testing

Test: GPU selection via vdd_settings.xml
<Adapter>
  <TargetGPU>NVIDIA GeForce RTX 3080,1</TargetGPU>
</Adapter>
Verify:
  1. Driver uses specified GPU
  2. Falls back to best GPU if name incorrect
  3. PCI bus number selection works
  4. Multi-GPU systems handled correctly

EDID Profile Testing

Test: Custom EDID profiles
  1. Place EDID file in EDID directory
  2. Reference in vdd_settings.xml
  3. Restart driver or recreate monitor
  4. Verify:
    • Monitor name matches EDID
    • Supported resolutions match EDID
    • Color spaces and capabilities correct

Debugging Techniques

WPP Tracing

Enable WPP tracing to capture diagnostic logs:
# Start tracing session
tracelog -start MyTrace -guid MttVDD.guid -f MyTrace.etl -flags 0xFFFF

# Reproduce issue

# Stop tracing
tracelog -stop MyTrace

# Convert to readable format
tracefmt MyTrace.etl -o MyTrace.txt
View logs:
type MyTrace.txt | more

Kernel Debugging

Setup kernel debugger (advanced):
  1. Install WinDbg (from Windows SDK)
  2. Configure kernel debugging:
    bcdedit /debug on
    bcdedit /dbgsettings serial debugport:1 baudrate:115200
    
  3. Connect debugger from another machine or VM
  4. Set breakpoints in driver code
Useful WinDbg commands:
!analyze -v          # Analyze crash dump
lm                    # List loaded modules
k                     # Stack trace
dt                    # Display type
!process 0 0          # List processes

Event Viewer Analysis

Check for driver errors:
  1. Open Event Viewer (eventvwr.msc)
  2. Navigate to Windows LogsSystem
  3. Filter current log:
    • Event sources: “DriverFrameworks-UserMode”, “MttVDD”
    • Event level: Warning, Error, Critical
Common error patterns:
  • Event ID 10016 - DCOM permission issues (usually benign)
  • Event ID 219 - Driver failed to start
  • Event ID 7000 - Service control manager errors

Memory Leak Detection

Monitor driver memory usage:
# Check driver memory over time
while ($true) {
    Get-Process -Name "WUDFHost" | Select-Object WorkingSet64, PrivateMemorySize64
    Start-Sleep -Seconds 60
}
Use Driver Verifier (runtime check):
# Enable verifier on MttVDD
verifier /flags 0x209BB /driver MttVDD.dll

# Reboot and test

# Disable verifier when done
verifier /reset
Driver Verifier can cause blue screens if issues are detected. Only use on test systems.

Common Issues and Diagnostics

Driver Fails to Load

Symptoms: No virtual monitors appear, Device Manager shows error Diagnose:
  1. Check Event Viewer for specific error codes
  2. Verify driver signature: signtool verify /v /pa MttVDD.dll
  3. Ensure test signing enabled if using test certificate
  4. Check Device Manager device status (right-click → Properties)
Error Code 52: Signature verification failed
  • Solution: Enable test signing, install certificate to Trusted Root
Error Code 31: Driver not found or corrupted
  • Solution: Reinstall driver, verify file integrity

Blue Screen / System Crash

Symptoms: BSOD when loading/using driver Diagnose:
  1. Note STOP code (e.g., DRIVER_IRQL_NOT_LESS_OR_EQUAL)
  2. Check minidump files in C:\Windows\Minidump\
  3. Analyze with WinDbg: !analyze -v
  4. Look for driver name in stack trace
Common causes:
  • Invalid pointer dereference
  • Memory access at wrong IRQL level
  • Buffer overrun
  • Resource leak
Recovery:
  1. Boot into Safe Mode (F8 during boot)
  2. Uninstall driver via Device Manager
  3. Disable test signing if needed
  4. Fix code issues and rebuild

Performance Issues

Symptoms: Lag, stuttering, high CPU usage Diagnose:
  1. Monitor GPU usage (Task Manager → Performance)
  2. Check CPU usage by WUDFHost process
  3. Profile with Windows Performance Recorder (WPR)
  4. Review SwapChain processing logic
Common causes:
  • Inefficient frame processing
  • Not releasing buffers promptly
  • Excessive logging/tracing
  • GPU/CPU mismatch

Display Artifacts

Symptoms: Screen tearing, corruption, black screens Diagnose:
  1. Verify GPU adapter selection
  2. Check EDID configuration
  3. Test different resolutions/refresh rates
  4. Review Direct3D device initialization

Configuration Not Applied

Symptoms: vdd_settings.xml changes ignored Diagnose:
  1. Verify XML file at C:\VirtualDisplayDriver\vdd_settings.xml
  2. Check XML syntax (use XML validator)
  3. Review Event Viewer for parsing errors
  4. Add WPP traces to configuration loading code

Safe Recovery Procedures

Safe Mode Boot

If system becomes unstable:
  1. Force Safe Mode:
    • Restart computer
    • Press F8 repeatedly during boot
    • Select “Safe Mode”
  2. Windows 10/11 Safe Mode:
    • Shift + Restart
    • Troubleshoot → Advanced → Startup Settings → Restart
    • Press 4 or F4 for Safe Mode
  3. Uninstall driver in Safe Mode:
    pnputil /delete-driver MttVDD.inf /uninstall
    

System Restore

If Safe Mode doesn’t work:
  1. Boot from Windows installation media
  2. Select “Repair your computer”
  3. Troubleshoot → Advanced Options → System Restore
  4. Choose restore point before driver installation

Last Known Good Configuration

On older Windows versions:
  1. Press F8 during boot
  2. Select “Last Known Good Configuration”
  3. Windows loads previous working driver set

Testing Checklist

Before releasing a driver build:

Pre-Installation

  • PREfast analysis passes (0 errors)
  • Driver signed with valid certificate
  • Signature verified with signtool
  • Build configuration correct (Release for distribution)

Basic Functionality

  • Driver installs without errors
  • Virtual monitors appear in Display Settings
  • All configured monitors created
  • Resolutions can be changed
  • Refresh rates configurable
  • Monitors can be enabled/disabled

Advanced Features

  • HDR toggle works (if applicable)
  • Custom EDID profiles load correctly
  • GPU adapter selection functions
  • Multi-monitor configuration stable
  • vdd_settings.xml changes applied

Application Compatibility

  • OBS Studio detects virtual monitor
  • Streaming applications work
  • VR applications compatible (if applicable)
  • Recording software functions
  • Games/applications render correctly

Stability

  • No crashes during 24-hour test
  • No memory leaks detected
  • Event Viewer shows no critical errors
  • Rapid configuration changes stable
  • System remains responsive

Platform Testing

  • Tested on x64 Windows 10
  • Tested on x64 Windows 11
  • Tested on ARM64 (if applicable)
  • Multiple GPU configurations tested

Next Steps

Building from Source

Build your test driver

Contributing

Submit your tested changes

Additional Resources

Build docs developers (and LLMs) love