Skip to content

[Bug Report] Warp indexing error in IsaacLab template project #5028

@aneeshc12

Description

@aneeshc12

Describe the bug

I am using IsaacSim-6 and the develop branch (commit 8b5cbcc) of IsaacLab

Following the IsaacLab getting started series, I've created a template environment with ./isaaclab.sh --new but I run into warp indexing errors in the environment definition test_env.py

It appears that IsaacLab operations happen in torch, and IsaacSim requires warp arrays to be sent written to the simulation. To fix this, I've tried converting all warp arrays to torch and all torch arrays to warp when needed. (I've pasted the edited test_env.py file with minimal changes below). In this case, I can run IsaacLab without any errors, but I only see one cartpole env out of 4096 moving. Logging the positions of each env confirms this. The physics simulation runs correctly for all envs, but most envs do not move.

Are there any steps I should take to enforce the torch/warp separation? Thanks!

Steps to reproduce

I create a new environment, install it with pip and run train.py as follows:
When creating a new project I use a direct env, with just the skrl and an external install.

./isaaclab.sh --new
python -m pip install -e source/test/
python scripts/random_agent.py --visualizer kit --task Template-Test-Direct-v0
simuser@kite01:/home/<user>/toy_is_lab/test$ python scripts/random_agent.py --visualizer kit --task Template-Test-Direct-v0
Loading user config located at: '/home/<user>/.cache/packman/chk/kit-kernel/109.0.2+production.256998.bb24931b.gl.manylinux_2_35_x86_64.release/data/Kit/IsaacLab/3.0/user.config.json'
2026-03-15T20:58:08Z [0ms] [Warning] [omni.ext.plugin] [ext: isaaclab_visualizers] Extensions config 'extension.toml' doesn't exist '/workspace/IsaacLab/source/isaaclab_visualizers' or '/workspace/IsaacLab/source/isaaclab_visualizers/config'
[0.043s] [ext: omni.assets.plugins-0.0.0] startup
[0.044s] [ext: omni.blobkey-1.1.2] startup
[0.044s] [ext: omni.kit.async_engine-0.0.3] startup
[0.239s] [ext: omni.client.lib-1.1.1] startup
[0.248s] [ext: omni.client-1.3.0] startup
[0.251s] [ext: omni.protobuf.lib-1.0.0] startup
[0.252s] [ext: omni.grpc.lib-1.0.0] startup
[0.256s] [ext: omni.metrics.core-0.0.3] startup
[0.256s] [ext: omni.datastore-0.0.0] startup
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
E0000 00:00:1773608289.202278     905 descriptor_database.cc:633] File already exists in database: grpc/health/v1/health.proto
W0000 00:00:1773608289.202297     905 message.cc:301] Protobuf GeneratedMessageFactory: File is already registered: grpc/health/v1/health.proto
[0.256s] [ext: omni.gpu_foundation.shadercache.vulkan-1.0.0] startup
[0.258s] [ext: omni.hsscclient-1.1.4] startup
[0.259s] [ext: omni.stats-1.0.1] startup
[0.260s] [ext: omni.ujitso.default-1.0.0] startup
[0.262s] [ext: omni.gpu_foundation-0.0.0] startup
[0.267s] [ext: carb.windowing.plugins-1.0.1] startup
[0.280s] [ext: omni.kit.renderer.init-1.0.1] startup

|---------------------------------------------------------------------------------------------|
| Driver Version: 570.211.01    | Graphics API: Vulkan
|=============================================================================================|
| GPU | Name                             | Active | LDA | GPU Memory | Vendor-ID | LUID       |
|     |                                  |        |     |            | Device-ID | UUID       |
|     |                                  |        |     |            | Bus-ID    |            |
|---------------------------------------------------------------------------------------------|
| 0   | NVIDIA GeForce RTX 5070 Laptop.. | Yes: 0 |     | 8151    MB | 10de      | 0          |
|     |                                  |        |     |            | 2d18      | 285989d9.. |
|     |                                  |        |     |            | 1         |            |
|=============================================================================================|
| OS: 22.04.4 LTS (Jammy Jellyfish) ubuntu, Version: 22.04.4, Kernel: 6.8.0-101-generic
| XServer Vendor: The X.Org Foundation, XServer Version: 12201001 (1.22.1.1)
| Processor: Intel(R) Core(TM) i9-14900HX
| Bare Metal Cores: 24 | Bare Metal Logical Cores: 48
| Available Cores:  32 
|---------------------------------------------------------------------------------------------|
| Total Memory (MB): 63999 | Free Memory: 54453
| Total Page/Swap (MB): 8191 | Free Page/Swap: 0
|---------------------------------------------------------------------------------------------|
2026-03-15T20:58:09Z [857ms] [Warning] [gpu.foundation.plugin] CPU performance profile is set to powersave. This profile sets the CPU to the lowest frequency reducing performance.
2026-03-15T20:58:09Z [870ms] [Warning] [gpu.foundation.plugin] PCIe link width current (8) and maximum (16) for device 0 don't match.
2026-03-15T20:58:09Z [870ms] [Warning] [gpu.foundation.plugin] IOMMU is enabled.
[1.007s] [ext: omni.pip.compute-1.6.5] startup
[1.007s] [ext: omni.isaac.core_archive-5.1.0] startup
[1.007s] [ext: omni.kit.pipapi-0.0.0] startup
[1.008s] [ext: omni.kit.telemetry-0.5.2] startup
[1.023s] [ext: omni.kit.loop-isaac-1.3.8] startup
[1.024s] [ext: omni.kit.test-2.0.6] startup
[1.074s] [ext: omni.materialx.libs-1.0.9] startup
[1.079s] [ext: omni.gpucompute.plugins-0.0.0] startup
[1.080s] [ext: omni.usd.config-1.0.6] startup
[1.082s] [ext: omni.usd.libs-1.0.1] startup
[1.150s] [ext: omni.iray.libs-0.0.1] startup
[1.153s] [ext: omni.mdl-56.0.3] startup
[1.173s] [ext: omni.mdl.neuraylib-0.2.17] startup
[1.174s] [ext: omni.kit.usd.mdl-1.1.8] startup
[1.254s] [ext: omni.appwindow-1.2.0] startup
[1.257s] [ext: omni.kit.renderer.core-1.1.1] startup
[1.344s] [ext: omni.kit.renderer.capture-1.0.2] startup
[1.346s] [ext: omni.kit.renderer.imgui-2.0.6] startup
[1.399s] [ext: omni.ui-2.29.1] startup
[1.408s] [ext: omni.kit.mainwindow-1.0.3] startup
[1.409s] [ext: carb.audio-0.1.0] startup
[1.412s] [ext: omni.uiaudio-1.0.0] startup
[1.413s] [ext: omni.kit.uiapp-0.0.0] startup
[1.413s] [ext: omni.usd.schema.metrics.assembler-109.0.0] startup
[1.416s] [ext: isaacsim.robot.schema-4.0.3] startup
[1.426s] [ext: omni.usd.schema.anim-0.0.1] startup
[1.443s] [ext: omni.usd.schema.audio-0.0.1] startup
[1.445s] [ext: omni.usd.schema.geospatial-0.0.1] startup
[1.448s] [ext: omni.usd.schema.semantics-0.0.0] startup
[1.450s] [ext: omni.activity.core-1.0.3] startup
[1.451s] [ext: omni.cubric-0.1.0] startup
[1.452s] [ext: omni.graph.exec-0.9.6] startup
[1.452s] [ext: omni.usd_resolver-1.0.0] startup
[1.455s] [ext: omni.usd.core-1.6.3] startup
[1.457s] [ext: omni.hydra.scene_delegate-0.3.5] startup
[1.461s] [ext: usdrt.scenegraph-7.6.2] startup
[1.491s] [ext: omni.hydra.usdrt_delegate-7.5.2] startup
[1.496s] [ext: omni.kit.actions.core-1.0.0] startup
[1.498s] [ext: omni.kit.audiodeviceenum-1.0.2] startup
[1.499s] [ext: omni.kit.commands-1.5.0] startup
[1.501s] [ext: omni.kit.exec.core-0.13.4] startup
[1.503s] [ext: omni.kit.usd_undo-0.1.8] startup
[1.503s] [ext: omni.kit.window.popup_dialog-2.0.25] startup
[1.507s] [ext: omni.kit.widget.nucleus_connector-2.2.2] startup
[1.510s] [ext: omni.timeline-1.1.0] startup
[1.511s] [ext: omni.usd-1.13.22] startup
[1.546s] [ext: omni.kit.asset_converter-5.0.25] startup
[1.556s] [ext: omni.pip.cloud-1.4.4] startup
[1.559s] [ext: omni.usd.schema.omni_lens_distortion-1.0.0] startup
[1.559s] [ext: omni.usd.schema.omni_sensors-0.0.0] startup
[1.565s] [ext: omni.usd.schema.omnigraph-1.0.1] startup
[1.570s] [ext: omni.usd.schema.omniscripting-1.0.1] startup
[1.574s] [ext: omni.usd.schema.physical_lighting-0.1.0] startup
[1.577s] [ext: omni.usd.schema.physx-109.0.10] startup
[1.605s] [ext: omni.usd.schema.render_settings.rtx-1.0.0] startup
[1.606s] [ext: isaaclab-4.5.21] startup
[1.899s] [ext: isaaclab_contrib-0.3.0] startup
[1.900s] [ext: omni.inspect-1.0.2] startup
[1.902s] [ext: omni.graph.core-3.0.1] startup
[1.904s] [ext: omni.kit.notification_manager-1.0.10] startup
[1.905s] [ext: isaacsim.core.deprecation_manager-0.3.2] startup
[1.906s] [ext: isaacsim.core.version-2.0.6] startup
[1.907s] [ext: omni.kit.menu.core-1.2.0] startup
[1.907s] [ext: omni.kit.menu.utils-2.2.2] startup
[1.914s] [ext: isaacsim.app.about-2.0.13] startup
[1.918s] [ext: omni.hydra.engine.stats-1.0.4] startup
[1.921s] [ext: omni.hydra.rtx.shadercache.vulkan-1.0.0] startup
[1.922s] [ext: omni.index.libs-387500.2199.0] startup
[1.922s] [ext: omni.index-1.0.1] startup
[1.922s] [ext: omni.ujitso.client-0.0.0] startup
[1.923s] [ext: omni.volume-0.5.2] startup
[1.925s] [ext: omni.hydra.rtx-1.0.2] startup
2026-03-15T20:58:10Z [1,918ms] [Warning] [omni.log] Source: omni.hydra was already registered.
[1.953s] [ext: omni.kit.clipboard-1.1.1] startup
[1.954s] [ext: omni.kit.usd.layers-2.4.2] startup
[1.961s] [ext: omni.kit.widget.context_menu-1.3.0] startup
[1.963s] [ext: omni.kit.context_menu-1.8.6] startup
[1.965s] [ext: omni.kit.helper.file_utils-0.1.10] startup
[1.966s] [ext: omni.kit.hotkeys.core-1.3.12] startup
[1.967s] [ext: omni.kit.hydra_texture-1.5.3] startup
[1.970s] [ext: omni.kit.widget.path_field-2.0.13] startup
[1.971s] [ext: omni.kit.widget.browser_bar-2.0.10] startup
[1.972s] [ext: omni.kit.widget.filebrowser-2.12.5] startup
[1.976s] [ext: omni.kit.widget.options_menu-1.1.6] startup
[1.979s] [ext: omni.kit.widget.options_button-1.0.3] startup
[1.979s] [ext: omni.ui.scene-1.13.1] startup
[1.983s] [ext: omni.kit.window.filepicker-2.14.8] startup
[1.995s] [ext: omni.kit.window.file_importer-1.1.20] startup
[1.996s] [ext: omni.kit.material.library-2.0.14] startup
[2.000s] [ext: omni.kit.raycast.query-1.1.0] startup
[2.004s] [ext: omni.kit.stage_template.core-1.1.22] startup
[2.005s] [ext: omni.kit.usd.collect-2.4.9] startup
[2.007s] [ext: omni.kit.widget.prompt-1.0.7] startup
[2.008s] [ext: omni.kit.window.file_exporter-1.0.35] startup
[2.008s] [ext: omni.kit.usdz_export-1.0.10] startup
[2.010s] [ext: omni.kit.widget.filter-1.1.5] startup
[2.011s] [ext: omni.kit.window.content_browser_registry-0.0.6] startup
[2.011s] [ext: omni.kit.window.drop_support-1.0.8] startup
[2.011s] [ext: omni.kit.window.file-2.0.9] startup
[2.014s] [ext: omni.kit.window.content_browser-3.1.6] startup
[2.023s] [ext: omni.kit.tool.asset_importer-5.1.3] startup
[2.027s] [ext: omni.kit.viewport.legacy_gizmos-1.0.23] startup
[2.029s] [ext: omni.kit.viewport.registry-104.0.6] startup
[2.029s] [ext: omni.kit.viewport.scene_camera_model-1.0.7] startup
[2.033s] [ext: omni.kit.widget.viewport-109.0.4] startup
[2.036s] [ext: omni.kit.viewport.window-109.0.1] startup
[2.048s] [ext: omni.kit.viewport.utility-2.0.1] startup
[2.048s] [ext: omni.kit.widget.highlight_label-1.0.3] startup
[2.049s] [ext: omni.kit.widget.searchfield-1.1.8] startup
[2.050s] [ext: omni.kit.widget.text_editor-1.1.1] startup
[2.051s] [ext: omni.kit.window.extensions-1.5.3] startup
[2.056s] [ext: omni.kit.window.property-1.14.4] startup
[2.065s] [ext: isaacsim.asset.importer.mjcf-2.5.15] startup
[2.100s] [ext: omni.convexdecomposition-109.0.10] startup
[2.102s] [ext: omni.graph.tools-1.79.4] startup
[2.120s] [ext: omni.graph-1.142.3] startup
[2.155s] [ext: omni.graph.action_core-1.1.8] startup
[2.157s] [ext: omni.graph.action_nodes_core-2.0.1] startup
[2.159s] [ext: omni.graph.action_nodes-2.0.3] startup
[2.161s] [ext: omni.graph.action-2.0.0] startup
[2.163s] [ext: omni.kit.manipulator.viewport-107.0.1] startup
[2.166s] [ext: omni.graph.visualization.nodes-2.1.4] startup
[2.175s] [ext: omni.kit.widget.zoombar-1.0.7] startup
[2.177s] [ext: omni.kit.browser.core-2.3.17] startup
[2.185s] [ext: omni.kit.browser.folder.core-1.12.1] startup
[2.195s] [ext: omni.kit.widget.stage-3.2.0] startup
[2.284s] [ext: omni.kit.widget.stage_icons-1.0.8] startup
[2.288s] [ext: omni.kit.window.stage-2.6.1] startup
[2.299s] [ext: omni.kit.menu.stage-1.2.7] startup
[2.304s] [ext: omni.kit.property.adapter.core-1.1.1] startup
[2.312s] [ext: omni.kit.property.adapter.usd-1.0.5] startup
[2.315s] [ext: omni.kit.property.usd-4.8.1] startup
[2.326s] [ext: omni.kit.tool.collect-2.2.19] startup
[2.328s] [ext: omni.ui_query-1.1.9] startup
[2.330s] [ext: omni.kit.ui_test-1.4.3] startup
[2.332s] [ext: omni.kvdb-109.0.10] startup
[2.333s] [ext: omni.localcache-109.0.10] startup
[2.334s] [ext: omni.physics-109.0.10] startup
[2.337s] [ext: omni.physx.foundation-109.0.10] startup
[2.338s] [ext: omni.usdphysics-109.0.10] startup
[2.340s] [ext: omni.physx.cooking-109.0.10] startup
[2.342s] [ext: omni.physx-109.0.10] startup
[2.350s] [ext: omni.physics.physx-109.0.10] startup
[2.352s] [ext: omni.physics.stageupdate-109.0.10] startup
[2.353s] [ext: isaacsim.examples.browser-0.2.2] startup
[2.356s] [ext: isaacsim.gui.components-1.4.1] startup
[2.359s] [ext: isaacsim.asset.importer.urdf-2.4.36] startup
[2.378s] [ext: omni.kit.primitive.mesh-1.0.18] startup
[2.384s] [ext: omni.kit.stage_templates-2.0.2] startup
[2.389s] [ext: omni.usd.metrics.assembler-109.0.0] startup
[2.392s] [ext: omni.warp.core-1.10.1] startup
[2.394s] [ext: isaacsim.core.experimental.utils-0.8.1] startup
[2.395s] [ext: omni.physics.tensors-109.0.10] startup
[2.400s] [ext: omni.physx.tensors-109.0.10] startup
2026-03-15T20:58:11Z [2,384ms] [Warning] [omni.physx.tensors.plugin] omni.physx.tensors tensorsInit() already ran, skipping duplicate
[2.403s] [ext: isaacsim.core.simulation_manager-1.7.2] startup
[2.409s] [ext: isaacsim.storage.native-1.6.3] startup
[2.411s] [ext: omni.debugdraw-0.1.4] startup
[2.414s] [ext: omni.kit.manipulator.selector-1.1.4] startup
[2.415s] [ext: omni.kit.widget.searchable_combobox-1.0.6] startup
[2.416s] [ext: omni.kit.widget.settings-1.2.6] startup
[2.418s] [ext: omni.kit.window.preferences-1.8.2] startup
[2.422s] [ext: omni.kit.manipulator.transform-107.0.0] startup
[2.426s] [ext: omni.kit.widget.toolbar-2.1.0] startup
[2.432s] [ext: omni.kit.manipulator.tool.snap-1.5.14] startup
[2.435s] [ext: omni.kit.viewport.manipulator.transform-107.0.4] startup
[2.437s] [ext: omni.kit.manipulator.prim.core-108.0.1] startup
[2.442s] [ext: omni.kit.manipulator.prim.usd-107.0.3] startup
[2.444s] [ext: omni.kit.manipulator.prim-108.0.0] startup
[2.445s] [ext: omni.kit.manipulator.selection-109.0.1] startup
[2.446s] [ext: omni.kit.viewport.actions-107.0.2] startup
[2.450s] [ext: omni.kit.viewport.menubar.core-107.2.1] startup
[2.460s] [ext: omni.kit.viewport.menubar.display-107.1.1] startup
[2.462s] [ext: omni.kit.widget.layers-1.8.8] startup
[2.472s] [ext: omni.physx.commands-109.0.10] startup
[2.476s] [ext: omni.usdphysics.ui-109.0.10] startup
[2.493s] [ext: omni.physx.ui-109.0.10] startup
[2.511s] [ext: omni.usd.metrics.assembler.physics-109.0.10] startup
[2.513s] [ext: isaacsim.core.utils-4.0.1] startup
[2.516s] [ext: isaacsim.core.prims-0.8.3] startup
[2.533s] [ext: isaacsim.core.api-4.11.4] startup
[2.610s] [ext: isaacsim.core.cloner-1.6.3] startup
[2.613s] [ext: isaacsim.test.docstring-1.2.1] startup
[2.616s] [ext: isaacsim.core.experimental.prims-0.9.7] startup
[2.637s] [ext: omni.graph.image.core-0.6.1] startup
[2.638s] [ext: omni.graph.image.nodes-1.3.1] startup
[2.639s] [ext: omni.graph.nodes_core-2.0.3] startup
[2.644s] [ext: omni.graph.nodes-2.1.6] startup
[2.648s] [ext: omni.graph.scriptnode-2.1.2] startup
[2.650s] [ext: omni.graph.ui_nodes-2.0.4] startup
[2.653s] [ext: omni.kit.widget.graph-2.1.0] startup
[2.665s] [ext: omni.kit.graph.delegate.default-1.2.5] startup
[2.672s] [ext: omni.kit.graph.editor.core-1.5.4] startup
[2.678s] [ext: omni.kit.graph.usd.commands-1.3.2] startup
[2.679s] [ext: omni.kit.property.material-1.12.3] startup
[2.685s] [ext: omni.kit.widget.material_preview-1.1.2] startup
[2.688s] [ext: omni.kit.window.material_graph-1.9.5] startup
[2.697s] [ext: omni.syntheticdata-0.6.15] startup
[2.710s] [ext: omni.replicator.nv-1.0.0] startup
OmniReplicatorNvExtension starting up (ext_id: omni.replicator.nv-1.0.0).
2026-03-15T20:58:11Z [2,692ms] [Warning] [omni.graph.core.plugin] Found duplicate of category 'Replicator' - was 'Annotators', adding 'Fabric Reader'
2026-03-15T20:58:11Z [2,693ms] [Warning] [omni.graph.core.plugin] Category 'Replicator' not accepted on node type 'omni.replicator.nv.FabricReader' in extension 'omni.replicator.nv'
[2.714s] [ext: omni.videoencoding-0.1.2] startup
[2.719s] [ext: omni.warp-1.10.1] startup
[2.733s] [ext: omni.replicator.core-1.12.34] startup
2026-03-15T20:58:11Z [2,758ms] [Warning] [pxr.Semantics] pxr.Semantics is deprecated - please use Semantics instead
2026-03-15T20:58:11Z [2,907ms] [Warning] [omni.replicator.core.scripts.extension] No material configuration file, adding configuration to material settings directly.
[2.933s] [ext: isaacsim.core.nodes-5.1.3] startup
[2.944s] [ext: isaacsim.core.rendering_manager-0.2.2] startup
[2.951s] [ext: isaacsim.core.throttling-2.2.4] startup
[2.957s] [ext: isaacsim.examples.base-1.1.3] startup
[2.960s] [ext: omni.kit.selection-0.1.6] startup
[2.963s] [ext: isaacsim.gui.menu-2.4.8] startup
[2.989s] [ext: isaacsim.gui.property-1.2.1] startup
[2.997s] [ext: omni.kit.menu.create-2.0.1] startup
[3.004s] [ext: omni.kit.scripting-109.0.5] startup
[3.055s] [ext: isaacsim.replicator.behavior-1.3.0] startup
[3.060s] [ext: isaacsim.robot.surface_gripper-3.3.6] startup
[3.079s] [ext: isaacsim.robot.manipulators-3.3.9] startup
[3.124s] [ext: isaacsim.robot.policy.examples-5.0.3] startup
[3.429s] [ext: isaacsim.robot.wheeled_robots-5.0.2] startup
[3.446s] [ext: omni.kit.numpy.common-0.1.3] startup
[3.450s] [ext: isaacsim.sensors.camera-1.5.3] startup
[3.466s] [ext: isaacsim.sensors.physics-0.6.3] startup
[3.482s] [ext: isaacsim.util.debug_draw-3.2.0] startup
[3.497s] [ext: isaacsim.sensors.physx-2.4.4] startup
[3.523s] [ext: omni.sensors.net-1.0.1] startup
[3.531s] [ext: omni.sensors.nv.common-3.0.0] startup
[3.557s] [ext: omni.sensors.nv.materials-2.0.0] startup
[3.569s] [ext: omni.sensors.nv.ids-2.0.1] startup
[3.582s] [ext: omni.sensors.nv.lidar-3.0.0] startup
[3.595s] [ext: omni.sensors.nv.wpm-3.0.0] startup
[3.596s] [ext: omni.sensors.nv.radar-3.0.0] startup
[3.601s] [ext: isaacsim.sensors.rtx-15.11.5] startup
[3.629s] [ext: isaacsim.simulation_app-2.14.1] startup
[3.632s] [ext: omni.anim.curve.core-1.5.3] startup
[3.722s] [ext: omni.asset_validator.core-1.9.2] startup
[3.855s] [ext: omni.hydra.scene_api-0.1.3] startup
[3.859s] [ext: omni.kit.manipulator.camera-109.0.1] startup
[3.863s] [ext: omni.kit.property.audio-1.0.16] startup
[3.864s] [ext: omni.kit.property.camera-1.0.13] startup
[3.866s] [ext: omni.kit.property.geometry-2.1.1] startup
[3.869s] [ext: omni.kit.property.light-1.0.13] startup
[3.871s] [ext: omni.kit.property.render-1.2.1] startup
[3.872s] [ext: omni.kit.property.transform-1.6.8] startup
[3.875s] [ext: omni.kit.property.bundle-1.5.0] startup
[3.877s] [ext: omni.kit.property.physx-109.0.10] startup
[3.893s] [ext: omni.kit.stagerecorder.core-109.0.0] startup
[3.896s] [ext: omni.kit.stagerecorder.ui-109.0.0] startup
[3.899s] [ext: omni.kit.stagerecorder.bundle-109.0.0] startup
[3.899s] [ext: omni.kit.ui.actions-1.0.5] startup
[3.901s] [ext: omni.kit.viewport.menubar.camera-107.0.9] startup
[3.906s] [ext: omni.kit.viewport.menubar.lighting-107.3.2] startup
[3.908s] [ext: omni.kit.viewport.menubar.render-107.0.10] startup
[3.911s] [ext: omni.kit.viewport.menubar.settings-107.0.5] startup
[3.914s] [ext: omni.kit.window.console-1.1.7] startup
[3.917s] [ext: omni.kit.window.script_editor-2.0.7] startup
[3.920s] [ext: omni.kit.window.status_bar-0.1.9] startup
[3.923s] [ext: omni.kit.window.toolbar-3.0.2] startup
[3.925s] [ext: omni.ocio-0.1.1] startup
[3.926s] [ext: omni.physx.asset_validator-109.0.10] startup
[3.930s] [ext: omni.physx.demos-109.0.10] startup
[3.946s] [ext: omni.physx.vehicle-109.0.10] startup
[3.961s] [ext: omni.physx.camera-109.0.10] startup
[3.969s] [ext: omni.physx.cct-109.0.10] startup
[3.979s] [ext: omni.physx.graph-109.0.10] startup
[3.993s] [ext: omni.physx.supportui-109.0.10] startup
[4.008s] [ext: omni.physx.telemetry-109.0.10] startup
[4.014s] [ext: omni.physx.bundle-109.0.10] startup
[4.015s] [ext: omni.replicator.replicator_yaml-2.0.11] startup
[4.018s] [ext: omni.rtx.window.settings-0.7.2] startup
[4.025s] [ext: omni.rtx.settings.core-0.6.7] startup
[4.033s] [ext: omni.usd.metrics.assembler.ui-109.0.0] startup
[4.049s] [ext: semantics.schema.editor-2.0.2] startup
[4.053s] [ext: semantics.schema.property-2.0.1] startup
[4.055s] [ext: isaaclab_assets-0.3.0] startup
[4.248s] [ext: isaaclab_tasks-1.5.11] startup
[4.277s] [ext: isaaclab_mimic-1.2.3] startup
[4.278s] [ext: isaaclab_newton-0.5.8] startup
[4.279s] [ext: isaaclab_physx-0.5.11] startup
[4.279s] [ext: isaaclab_rl-0.5.0] startup
[4.280s] [ext: omni.kit.menu.common-2.0.2] startup
[4.281s] [ext: isaaclab.python-3.0.0] startup
[4.283s] Simulation App Starting
[8.162s] Simulation App Startup Complete
[8.165s] app ready
2026-03-15T20:58:17Z [8,273ms] [Warning] [omni.kit.menu.utils.layout] Multiple matching items found for layout "Physics". Found Create, Window. Change <<class 'omni.kit.menu.utils.layout.MenuLayout.SubMenu'> name:Physics> to use specific source. Using "source="Create/Physics""
[INFO]: Parsing configuration from: test.tasks.direct.test.test_env_cfg:TestEnvCfg
2026-03-15T20:58:17Z [8,898ms] [Warning] [isaaclab.envs.direct_rl_env] Seed not set for the environment. The environment creation may not be deterministic.
2026-03-15T20:58:17Z [8,978ms] [Warning] [isaaclab_physx.physics.physx_manager] TGS solver with enable_external_forces_every_iteration=False may cause noisy velocities.
[9.015s] [ext: omni.kit.pip_archive-0.0.0] startup
[9.106s] [ext: omni.physx.fabric-109.0.10] startup
[INFO]: Base environment:
	Environment device    : cuda:0
	Environment seed      : None
	Physics step-size     : 0.008333333333333333
	Rendering step-size   : 0.016666666666666666
	Environment step-size : 0.016666666666666666
[INFO]: Time taken for scene creation Last: 7.114471 s, Mean: 7.114471 s, Std: 0.000000 s, N: 1
[INFO]: Scene manager:  <class InteractiveScene>
	Number of environments: 4096
	Environment spacing   : 4.0
	Source prim name      : /World/envs/env_0
	Global prim paths     : []
	Replicate physics     : True
[INFO]: Starting the simulation. This may take a few seconds. Please wait...
2026-03-15T20:58:41Z [32,242ms] [Warning] [omni.usd] Encountered USD Warnings but USD Diagnostics are currently muted. To view USD Warnings, please set the '/persistent/app/usd/muteUsdDiagnostics' setting to false in Preferences page.
Warp DeprecationWarning: The symbol `warp.types.type_scalar_type` will soon be removed from the public API. It can still be accessed from `warp._src.types.type_scalar_type` but might be changed or removed without notice.
Warp DeprecationWarning: The symbol `warp.types.type_length` will soon be removed from the public API. It can still be accessed from `warp._src.types.type_length` but might be changed or removed without notice.
2026-03-15T20:58:50Z [41,088ms] [Warning] [isaacsim.core.simulation_manager.impl.simulation_manager] Changing backend from 'numpy' to 'torch' since NumPy cannot be used with GPU piplines
[INFO]: Time taken for simulation start Last: 42.327922 s, Mean: 42.327922 s, Std: 0.000000 s, N: 1
[INFO]: Completed setting up the environment...
[INFO]: Gym observation space: Box(-inf, inf, (4096, 4), float32)
[INFO]: Gym action space: Box(-inf, inf, (4096, 1), float32)
Traceback (most recent call last):
  File "/workspace/cral/aneesh/toy_is_lab/test/scripts/random_agent.py", line 70, in <module>
    main()
  File "/workspace/cral/aneesh/toy_is_lab/test/scripts/random_agent.py", line 54, in main
    env.reset()
  File "/isaacsim/_build/linux-x86_64/release/kit/python/lib/python3.12/site-packages/gymnasium/wrappers/common.py", line 400, in reset
    return super().reset(seed=seed, options=options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/isaacsim/_build/linux-x86_64/release/kit/python/lib/python3.12/site-packages/gymnasium/core.py", line 333, in reset
    return self.env.reset(seed=seed, options=options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/IsaacLab/source/isaaclab/isaaclab/envs/direct_rl_env.py", line 335, in reset
    self._reset_idx(indices)
  File "/workspace/cral/aneesh/toy_is_lab/test/source/test/test/tasks/direct/test/test_env.py", line 97, in _reset_idx
    joint_pos = self.robot.data.default_joint_pos[env_ids]
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/isaacsim/_build/linux-x86_64/release/kit/python/lib/python3.12/site-packages/warp/_src/types.py", line 3524, in __getitem__
    raise RuntimeError(f"Invalid index: {key}")
RuntimeError: Invalid index: tensor([   0,    1,    2,  ..., 4093, 4094, 4095], device='cuda:0',
       dtype=torch.int32)
2026-03-15T20:59:23Z [74,563ms] [Warning] [omni.graph.core.plugin] Could not find category 'Replicator:Annotators' for removal
2026-03-15T20:59:23Z [74,563ms] [Warning] [omni.graph.core.plugin] Could not find category 'Replicator:Annotators' for removal
2026-03-15T20:59:23Z [74,563ms] [Warning] [omni.graph.core.plugin] Could not find category 'Replicator:Annotators' for removal
2026-03-15T20:59:23Z [74,563ms] [Warning] [omni.graph.core.plugin] Could not find category 'Replicator:Annotators' for removal
2026-03-15T20:59:23Z [74,563ms] [Warning] [omni.graph.core.plugin] Could not find category 'Replicator:Annotators' for removal
2026-03-15T20:59:23Z [74,563ms] [Warning] [omni.graph.core.plugin] Could not find category 'Replicator:Annotators' for removal
2026-03-15T20:59:23Z [74,563ms] [Warning] [omni.graph.core.plugin] Could not find category 'Replicator:Core' for removal
2026-03-15T20:59:23Z [74,564ms] [Warning] [omni.graph.core.plugin] Could not find category 'animation' for removal
2026-03-15T20:59:23Z [74,587ms] [Warning] [omni.physx.plugin] USD stage detach not called, holding a loose ptr to a stage!
2026-03-15T20:59:23Z [74,751ms] [Warning] [carb.audio.context] 1 contexts were leaked
2026-03-15T20:59:23Z [74,965ms] [Warning] [carb] Recursive unloadAllPlugins() detected!

My updated script is:

# Copyright (c) 2022-2025, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause

from __future__ import annotations

import math
import torch
from collections.abc import Sequence

import isaaclab.sim as sim_utils
from isaaclab.assets import Articulation
from isaaclab.envs import DirectRLEnv
from isaaclab.sim.spawners.from_files import GroundPlaneCfg, spawn_ground_plane
from isaaclab.utils.math import sample_uniform

from .test_env_cfg import TestEnvCfg

import warp as wp
from icecream import ic

class TestEnv(DirectRLEnv):
    cfg: TestEnvCfg

    def __init__(self, cfg: TestEnvCfg, render_mode: str | None = None, **kwargs):
        super().__init__(cfg, render_mode, **kwargs)

        self._cart_dof_idx, _ = self.robot.find_joints(self.cfg.cart_dof_name)
        self._pole_dof_idx, _ = self.robot.find_joints(self.cfg.pole_dof_name)

        self.joint_pos = self.robot.data.joint_pos
        self.joint_vel = self.robot.data.joint_vel

        ic(hasattr(self.robot, '_ALL_INDICES_WP'))
        ic(self.robot._ALL_INDICES)
        ic(type(self.robot._ALL_INDICES))

        import inspect
        ic(inspect.getsource(self.robot.write_data_to_sim))

    def _setup_scene(self):
        self.robot = Articulation(self.cfg.robot_cfg)
        # add ground plane
        spawn_ground_plane(prim_path="/World/ground", cfg=GroundPlaneCfg())
        # clone and replicate
        self.scene.clone_environments(copy_from_source=False)
        # we need to explicitly filter collisions for CPU simulation
        if self.device == "cpu":
            self.scene.filter_collisions(global_prim_paths=[])
        # add articulation to scene
        self.scene.articulations["robot"] = self.robot
        # add lights
        light_cfg = sim_utils.DomeLightCfg(intensity=2000.0, color=(0.75, 0.75, 0.75))
        light_cfg.func("/World/Light", light_cfg)

    def _pre_physics_step(self, actions: torch.Tensor) -> None:
        self.actions = actions.clone()

    def _apply_action(self) -> None:
        self.robot.set_joint_effort_target(self.actions * self.cfg.action_scale, joint_ids=self._cart_dof_idx)

        jp = wp.to_torch(self.robot.data.joint_pos)
        print(jp[:, 0])  # cart position for each env

    def _get_observations(self) -> dict:
        jp = wp.to_torch(self.robot.data.joint_pos)
        jv = wp.to_torch(self.robot.data.joint_vel)
        obs = torch.cat(
            (
                jp[:, self._pole_dof_idx[0]].unsqueeze(dim=1),
                jv[:, self._pole_dof_idx[0]].unsqueeze(dim=1),
                jp[:, self._cart_dof_idx[0]].unsqueeze(dim=1),
                jv[:, self._cart_dof_idx[0]].unsqueeze(dim=1),
            ),
            dim=-1,
        )
        observations = {"policy": obs}
        return observations

    def _get_rewards(self) -> torch.Tensor:
        jp = wp.to_torch(self.robot.data.joint_pos)
        jv = wp.to_torch(self.robot.data.joint_vel)

        total_reward = compute_rewards(
            self.cfg.rew_scale_alive,
            self.cfg.rew_scale_terminated,
            self.cfg.rew_scale_pole_pos,
            self.cfg.rew_scale_cart_vel,
            self.cfg.rew_scale_pole_vel,
            jp[:, self._pole_dof_idx[0]],
            jv[:, self._pole_dof_idx[0]],
            jp[:, self._cart_dof_idx[0]],
            jv[:, self._cart_dof_idx[0]],
            self.reset_terminated,
        )
        return total_reward

    def _get_dones(self) -> tuple[torch.Tensor, torch.Tensor]:
        jp = wp.to_torch(self.robot.data.joint_pos)
        time_out = self.episode_length_buf >= self.max_episode_length - 1
        out_of_bounds = torch.any(torch.abs(jp[:, self._cart_dof_idx]) > self.cfg.max_cart_pos, dim=1)
        out_of_bounds = out_of_bounds | torch.any(torch.abs(jp[:, self._pole_dof_idx]) > math.pi / 2, dim=1)
        return out_of_bounds, time_out

    def _reset_idx(self, env_ids: Sequence[int] | None):
        if env_ids is None:
            env_ids = self.robot._ALL_INDICES
        super()._reset_idx(env_ids)

        joint_pos = wp.to_torch(self.robot.data.default_joint_pos)[env_ids].clone()
        joint_pos[:, self._pole_dof_idx] += sample_uniform(
            self.cfg.initial_pole_angle_range[0] * math.pi,
            self.cfg.initial_pole_angle_range[1] * math.pi,
            joint_pos[:, self._pole_dof_idx].shape,
            joint_pos.device,
        )
        joint_vel = wp.to_torch(self.robot.data.default_joint_vel)[env_ids].clone()

        default_root_state = wp.to_torch(self.robot.data.default_root_state)[env_ids].clone()
        default_root_state[:, :3] += self.scene.env_origins[env_ids]

        self.robot.write_root_pose_to_sim(default_root_state[:, :7], env_ids)
        self.robot.write_root_velocity_to_sim(default_root_state[:, 7:], env_ids)
        self.robot.write_joint_state_to_sim(joint_pos, joint_vel, None, env_ids)

@torch.jit.script
def compute_rewards(
    rew_scale_alive: float,
    rew_scale_terminated: float,
    rew_scale_pole_pos: float,
    rew_scale_cart_vel: float,
    rew_scale_pole_vel: float,
    pole_pos: torch.Tensor,
    pole_vel: torch.Tensor,
    cart_pos: torch.Tensor,
    cart_vel: torch.Tensor,
    reset_terminated: torch.Tensor,
):
    rew_alive = rew_scale_alive * (1.0 - reset_terminated.float())
    rew_termination = rew_scale_terminated * reset_terminated.float()
    rew_pole_pos = rew_scale_pole_pos * torch.sum(torch.square(pole_pos).unsqueeze(dim=1), dim=-1)
    rew_cart_vel = rew_scale_cart_vel * torch.sum(torch.abs(cart_vel).unsqueeze(dim=1), dim=-1)
    rew_pole_vel = rew_scale_pole_vel * torch.sum(torch.abs(pole_vel).unsqueeze(dim=1), dim=-1)
    total_reward = rew_alive + rew_termination + rew_pole_pos + rew_cart_vel + rew_pole_vel
    return total_reward

This results in only one cartpole env moving

System Info

Describe the characteristic of your environment:

  • Commit: 8b5cbcc
  • Isaac Sim Version: 3.0.0
  • OS: Ubuntu 22.04

Additional context

Add any other context about the problem here.

Checklist

  • [ X] I have checked that there is no similar issue in the repo (required)
  • [ X] I have checked that the issue is not in running Isaac Sim itself and is related to the repo

Acceptance Criteria

Add the criteria for which this task is considered done. If not known at issue creation time, you can add this once the issue is assigned.

  • Criteria 1
  • Criteria 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions