NVIDIA Support Issue: CloudXR Runtime 6.0.5 NVENC Failure on AWS g6e (L40S)

## Summary

CloudXR Runtime 6.0.5 fails to encode video on AWS EC2 g6e.xlarge instances (NVIDIA L40S GPU) with `NV_ENC_ERR_NO_ENCODE_DEVICE` errors. The runtime starts successfully and accepts WebSocket connections from CloudXR.js clients, but media streaming fails because NVENC cannot open an encoding session.

## Environment

- **Instance type:** AWS EC2 g6e.xlarge

- **GPU:** NVIDIA L40S (48 GB, Ada Lovelace)

- **OS:** Windows Server 2022 Datacenter (Build 20348)

- **Drivers tested:**

- NVIDIA GRID driver 596.36 (`596.36_grid_win10_win11_server2022_64bit_dch_international_aws_swl.exe` from `s3://ec2-windows-nvidia-drivers/latest/`)

- NVIDIA Gaming driver 596.36 (`596.36_Cloud_Gaming_win10_win11_server2022_dch_64bit_international.exe` from `s3://nvidia-gaming/windows/latest/`)

- **Driver mode:** WDDM (confirmed via `nvidia-smi`)

- **License status:** Licensed (confirmed via `nvidia-smi -q`)

- GRID driver: “NVIDIA RTX Virtual Workstation - Licensed”

- Gaming driver: “NVIDIA Virtual Applications - Licensed”

- **CloudXR Runtime:** 6.0.5 (downloaded from NGC)

- **CloudXR.js client:** 6.1.0

- **Device profile:** `quest3` (set via `–webrtc` flag in LÖVR sample)

- **Server application:** CloudXR LÖVR sample (built from GitHub - NVIDIA/cloudxr-lovr-sample: Stream your LÖVR VR applications wirelessly to supported headsets using NVIDIA CloudXR technology. This sample integrates CloudXR Runtime into LÖVR, enabling untethered VR experiences without physical cables. · GitHub )

## Problem Description

The CloudXR Runtime starts successfully, initializes Vulkan, creates a CUDA context, and begins listening on port 49100 for WebSocket connections. However, the streaming SDK component fails to initialize NVENC encoding:

```

(M) Initialized context for adapter 0: 1024 x 768 @ 64.0 Hz

(M) Driver version is 596.36, branch is r596_25.

(M) System is co-proc.

(M) Initializing NvEnc12VideoEncoder.

(M) Using NvEnc header version 12.0.

(E) Failed to open CUDA encoding session for checking perf support (NV_ENC_ERR_NO_ENCODE_DEVICE).

(W) Failed to get async encode support capability

(E) Failed to open encoding session for checking perf support (NV_ENC_ERR_NO_ENCODE_DEVICE).

```

This error repeats for every codec (H.264, H.265, AV1) and the server ultimately reports no available encoders.

When a Quest 3 client connects, the WebSocket signaling succeeds but media streaming fails with error `0xC0F22226` (“no response from media server”) on the client side.

## What Works

- CloudXR Runtime starts and logs: “The NVIDIA CloudXR Runtime service has started. Runtime is now running and accepting connections.”

- Vulkan initializes correctly: “name: NVIDIA L40S, deviceType: VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU, apiVersion: 1.4.329”

- CUDA context created: “Created CUDA context for device 0”

- Signaling server starts on port 49100

- Quest 3 client connects via WebSocket (IPv6 address resolution seen in logs)

- Direct NVENC API test via Python succeeds: `NvEncodeAPIGetMaxSupportedVersion` returns version 13.0 with result 0 (success)

- Direct CUDA test succeeds: `cuInit(0)` returns 0, device found, context created

## What Fails

- CloudXR streaming SDK’s `NvEnc12VideoEncoder` cannot open a CUDA encoding session

- Error: `NV_ENC_ERR_NO_ENCODE_DEVICE` (error code 1)

- This occurs despite NVENC API being accessible via direct Python ctypes test

- Occurs with both GRID and Gaming driver variants

- Occurs regardless of GSP enabled/disabled (`EnableGSP` registry key)

## Configuration Details

### Session Setup

- Windows auto-logon configured (Administrator)

- LÖVR/CloudXR runs in interactive session 1 (required for D3D initialization)

- D3D initializes successfully (adapter context created at 1024x768 @ 64Hz)

### Registry Keys Set

- `HKLM:\SYSTEM\CurrentControlSet\Services\nvlddmkm\Global\vGamingMarketplace` = 2 (DWORD)

- `HKLM:\SYSTEM\CurrentControlSet\Services\nvlddmkm\EnableGSP` = 0 (DWORD)

- Gaming certificate: `C:\Users\Public\Documents\GridSwCert.txt` (GridSwCert_2026_03_02.cert)

### Environment Variables

- `XR_RUNTIME_JSON` = path to `openxr_cloudxr.json`

- `NV_CXR_FILE_LOGGING` = 1

- `NV_CXR_OUTPUT_DIR` = C:\cxr-logs

## Hypothesis

The streaming SDK’s “System is co-proc” detection may be triggering a code path that attempts to open the NVENC session differently than what works on this hardware. The direct NVENC API is accessible (proven via Python test), but the streaming SDK’s specific initialization sequence fails.

## Questions for NVIDIA

1. Is the L40S on AWS EC2 (g6e instances) a supported configuration for CloudXR Runtime 6.0.5 with WebRTC streaming?

2. Is there a specific driver version or driver type (GRID vs Gaming vs public data center) required for NVENC to work with CloudXR on cloud GPU instances?

3. Does the “co-proc” detection in the streaming SDK affect NVENC initialization, and is there a way to override it?

4. Are there any additional configuration steps required for NVENC on AWS g6e instances beyond what’s documented in the CloudXR 6 Runtime Requirements?

5. The Omniverse Spatial docs reference “RTX 6000 Ada” as the recommended GPU — is there a known limitation with L40S specifically for CloudXR streaming?

## Reproduction Steps

1. Launch AWS EC2 g6e.xlarge with Windows Server 2022 base AMI

2. Install NVIDIA Gaming driver from `s3://nvidia-gaming/windows/latest/`

3. Set `vGamingMarketplace = 2` registry key and download GridSwCert

4. Configure Windows auto-logon (required for D3D in headless environment)

5. Install CloudXR Runtime 6.0.5 from NGC

6. Clone and build cloudxr-lovr-sample

7. Copy CloudXR Runtime DLLs to LÖVR build directory

8. Set `XR_RUNTIME_JSON` environment variable

9. Run `lovr.exe ../src/plugins/nvidia/examples/cloudxr --webrtc` in the interactive session

10. Observe NVENC errors in `cxr_streamsdk` log file

Resolution: The NVENC NV_ENC_ERR_NO_ENCODE_DEVICE error was caused by the CloudXR streaming SDK initializing Direct3D on the wrong display adapter. The AWS g6e instance has two display adapters: the Microsoft Basic Display Adapter (adapter 0) and the NVIDIA L40S (adapter 1). The streaming SDK was using adapter 0 (Basic Display Adapter) which has no NVENC encoder.

Fix: Disable the Microsoft Basic Display Adapter via Device Manager (or PowerShell: Disable-PnpDevice), making the NVIDIA L40S become adapter 0. After a reboot, NVENC initializes correctly and the CloudXR Runtime starts successfully with full encoding capability.

Additional note: The NVIDIA GRID driver (from s3://ec2-windows-nvidia-drivers/) is required, not the public data center (Tesla) driver. The data center driver only supports TCC mode which lacks Direct3D/NVENC graphics support. The GRID driver enables WDDM mode.