Skip to content

Conversation

@neubig
Copy link
Contributor

@neubig neubig commented Dec 6, 2025

HUMAN: this needs testing

Description

This PR adds comprehensive documentation for GPU support in OpenHands Docker workspaces, covering both the main OpenHands application and the Software Agent SDK.

Changes

OpenHands Application Documentation

1. Configuration Options (openhands/usage/advanced/configuration-options.mdx)

  • Added new "GPU Support" section under Sandbox Configuration
  • Documented enable_gpu parameter (boolean, default: false)
  • Documented cuda_visible_devices parameter for selective GPU mounting
  • Included example config.toml configurations
  • Added prerequisites section with NVIDIA Container Toolkit installation instructions
  • Added verification steps using nvidia-smi

2. GUI Mode (openhands/usage/run-openhands/gui-mode.mdx)

  • Enhanced existing GPU section with advanced configuration examples
  • Added environment variable configuration method
  • Added config.toml configuration example
  • Added cross-reference to detailed Configuration Options

3. Environment Variables (openhands/usage/environment-variables.mdx)

  • Enhanced descriptions for SANDBOX_ENABLE_GPU and SANDBOX_CUDA_VISIBLE_DEVICES
  • Added examples of GPU ID specifications

Software Agent SDK Documentation

4. Docker Sandbox (sdk/guides/agent-server/docker-sandbox.mdx)

  • Added new section "GPU Support in Docker Sandbox"
  • Included basic GPU configuration examples for DockerWorkspace
  • Included custom base image examples for DockerDevWorkspace with CUDA
  • Added prerequisites installation guide
  • Added GPU verification code examples
  • Added practical use cases (ML training, GPU-accelerated data processing)
  • Documented current SDK limitation (no selective GPU mounting)

Source References

All documentation is based on analysis of the following source code:

OpenHands Main Application:

  • OpenHands/openhands/core/config/sandbox_config.py (lines 86, 96)
  • OpenHands/openhands/runtime/impl/docker/docker_runtime.py (lines 497-511)
  • OpenHands/openhands/core/config/arg_utils.py (line 182)
  • OpenHands/config.template.toml

Software Agent SDK:

  • software-agent-sdk/openhands-workspace/openhands/workspace/docker/workspace.py (lines 113-116, ~295)

External Documentation:

Documentation Verification

✅ All configuration options documented match the actual code implementation
✅ All examples are based on verified code patterns
✅ All prerequisites are necessary for the feature to work
✅ Installation commands are from official NVIDIA documentation
✅ No speculative or unverified information included

Testing

The documentation describes features that can be tested with:

  1. NVIDIA GPU with drivers installed
  2. NVIDIA Container Toolkit (nvidia-docker2) installed
  3. Running nvidia-smi in the OpenHands workspace to verify GPU access

Note: This is a documentation-only PR with no code changes.

@neubig can click here to continue refining the PR

- Add GPU configuration section to configuration-options.mdx with enable_gpu and cuda_visible_devices parameters
- Enhance gui-mode.mdx with advanced GPU configuration examples
- Update environment-variables.mdx with detailed GPU variable descriptions
- Add complete GPU support guide to SDK docker-sandbox.mdx with code examples
- Include prerequisites, verification steps, and use cases for GPU-enabled workspaces

Co-authored-by: openhands <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants