Repository navigation
[Mac OS] [RL] Run RL agents on the simulation device and raise without CUDA #8188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
AntoineRichard
merged 12 commits into
isaac-sim:develop
from
AntoineRichard:antoiner/fix/rsl-rl-runner-cpu-fallback
Oct 9, 2026
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
827a989
Fall back to the env device for RSL-RL runners without CUDA
AntoineRichard f2cf68f
Warn when the RSL-RL runner falls back to the env device
AntoineRichard 2284297
Drop the runner device test and docstring note
AntoineRichard ce07f72
Merge remote-tracking branch 'origin/develop' into antoiner/fix/rsl-r…
AntoineRichard 566ac34
Run RL agents on the resolved simulation device and fall back to CPU …
AntoineRichard 535cbf8
Merge remote-tracking branch 'origin/develop' into antoiner/fix/rsl-r…
AntoineRichard f82356a
Merge remote-tracking branch 'origin/develop' into antoiner/fix/rsl-r…
AntoineRichard 0c81e67
Set the agent device in each RL library's shared config setup and rai…
AntoineRichard 062dd2a
Pass the agent device and seed to the shared RL config setup explicitly
AntoineRichard 9d208ef
Restore update_rsl_rl_cfg's args_cli signature and set the device there
AntoineRichard 202545f
Pass args_cli to update_sb3_cfg like update_rsl_rl_cfg
AntoineRichard 9055fc6
Add --seed to RL-Games export and pass args_cli to update_rl_games_cfg
AntoineRichard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
source/isaaclab/changelog.d/antoiner-fix-rsl-rl-runner-cpu-fallback.changed.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| * Changed the RSL-RL, RL-Games, and Stable-Baselines3 benchmark workflows to set up their agent configuration with | ||
| the same shared overrides as the training and play workflows, including the device the simulation runs on. |
2 changes: 2 additions & 0 deletions
2
source/isaaclab/changelog.d/antoiner-fix-rsl-rl-runner-cpu-fallback.fixed.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| * Fixed runs on hosts without CUDA, such as macOS, failing inside PyTorch when the resolved device was a CUDA | ||
| device. :func:`~isaaclab.app.launch_simulation` now raises a clear error that asks for ``--device cpu``. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
source/isaaclab_rl/changelog.d/antoiner-fix-rsl-rl-runner-cpu-fallback.added.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| * Added ``--seed`` to the RL-Games export command, matching the RSL-RL export command. |
3 changes: 3 additions & 0 deletions
3
source/isaaclab_rl/changelog.d/antoiner-fix-rsl-rl-runner-cpu-fallback.changed.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| * **Breaking:** Changed the RSL-RL, RL-Games, and Stable-Baselines3 workflows to run the agent on the simulation's | ||
| device, as skrl and TorchRL do. They ignored ``--device`` for the agent outside distributed runs and used the | ||
| agent configuration's ``cuda:0``; pass ``--device`` to choose where both run. |
Empty file.
30 changes: 30 additions & 0 deletions
30
source/isaaclab_rl/isaaclab_rl/entrypoints/backends/cli_args_rl_games.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). | ||
| # All rights reserved. | ||
| # | ||
| # SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| """Agent configuration overrides shared by the RL-Games entrypoints.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import argparse | ||
|
|
||
| from ..common import resolve_seed | ||
|
|
||
|
|
||
| def update_rl_games_cfg(agent_cfg: dict, args_cli: argparse.Namespace) -> dict: | ||
| """Override an RL-Games agent configuration with the command-line arguments. | ||
|
|
||
| Args: | ||
| agent_cfg: The configuration for RL-Games agent. | ||
| args_cli: The command line arguments. | ||
|
|
||
| Returns: | ||
| The updated RL-Games agent configuration. | ||
| """ | ||
| config = agent_cfg["params"]["config"] | ||
| config["device"] = config["device_name"] = args_cli.device | ||
| if args_cli.seed is not None: | ||
| args_cli.seed = resolve_seed(args_cli.seed) | ||
| agent_cfg["params"]["seed"] = args_cli.seed | ||
| return agent_cfg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
source/isaaclab_rl/isaaclab_rl/entrypoints/backends/cli_args_sb3.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). | ||
| # All rights reserved. | ||
| # | ||
| # SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| """Agent configuration overrides shared by the Stable-Baselines3 entrypoints.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import argparse | ||
|
|
||
| from ..common import resolve_seed | ||
|
|
||
|
|
||
| def update_sb3_cfg(agent_cfg: dict, args_cli: argparse.Namespace) -> dict: | ||
| """Override a Stable-Baselines3 agent configuration with the command-line arguments. | ||
|
|
||
| Args: | ||
| agent_cfg: The configuration for Stable-Baselines3 agent. | ||
| args_cli: The command line arguments. | ||
|
|
||
| Returns: | ||
| The updated Stable-Baselines3 agent configuration. | ||
| """ | ||
| agent_cfg["device"] = args_cli.device | ||
| if args_cli.seed is not None: | ||
| args_cli.seed = resolve_seed(args_cli.seed) | ||
| agent_cfg["seed"] = args_cli.seed | ||
| return agent_cfg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id rather raise an error than fall back if device startwith("cuda")