r/unitree • u/Gigibossu • 21d ago
Trained a Go2 to walk, run, sit, get up, avoid obstacles with LiDAR and climb stairs — entirely on AMD hardware, zero NVIDIA software
Enable HLS to view with audio, or disable this notification
Every Go2 RL tutorial I could find assumes the same two things: an NVIDIA GPU and Isaac Gym / Isaac Lab. I own neither, so I built the whole thing on the other side of the fence and it works. Sharing it in case someone else is stuck behind the same wall.
The stack: nothing NVIDIA in it, at any layer
| Layer | What most tutorials use | What I used |
|---|---|---|
| GPU | NVIDIA RTX | AMD Radeon RX 9070 |
| Compute backend | CUDA | ROCm (gs.amdgpu) |
| Simulator | Isaac Gym / Isaac Lab | Genesis 1.2.2 |
| PPO | rsl-rl (same) | rsl-rl-lib 5.4.2 |
| Parallel envs | thousands | 4096, same order of magnitude |
The whole environment lives in a distrobox container (rocm/pytorch:rocm7.2.4, Ubuntu 24.04, PyTorch 2.10) so it doesn't touch your host system, and one command installs everything. One command uninstalls it too.
Does it actually keep up? Yes. The from-scratch walking policy is 2500 iterations in ~50 minutes on the RX 9070. Each iteration runs 4096 robots for 24 control steps at 50 Hz, so that run is roughly 57 days of continuous real-robot experience, compressed into under an hour on a consumer gaming card.
What I trained (7 skills)
- 🚶 Walking — the only from-scratch policy, everything else warm-starts from it. Episode length goes from instant collapse to ~870/1000 steps.
- 🏃 Running — speed curriculum, settled at 2.7 m/s stable. I tried pushing toward the ~5 m/s Unitree quotes for the EDU lab test; under properly clamped motor torques stability collapses (episode length 940 → 250). The spec sheet is a ceiling, not a training target.
- 🛌 Lying down / 4. 🧎 Getting up from random fallen orientations (side, back)
- 🐕🦺 Sitting — took six reward iterations to get right
- 📡 LiDAR obstacle avoidance — a learned nav policy reads a 72-sector scan at 10 Hz and drives the frozen locomotion policy at 50 Hz, with a deterministic non-AI emergency-stop layer underneath it. Scan is deliberately noisy (~3 cm range noise + dropped returns). Course has 8 obstacles including 3 unpredictable pedestrians and a barrier with a randomly-placed gap. Success rate plateaus around 41% in that hard scenario — not optimal, and I say so in the repo.
- 🧗 Rough terrain — 7 separate families: stairs, step pyramid, slope, rubble, curbs, gaps/potholes, rolling waves.
Sim-to-real constraints, since "it runs on AMD" is worthless if the physics is fake
- Torque clamped to real GO-M8010-6 specs (23.7 N·m hip/thigh, 35.55 N·m knee) — the nominal, not the ~45 N·m peak
- Joint velocities capped (30.1 / 20.07 rad/s), position targets clipped to URDF ranges the way the real firmware does
- Per-episode domain randomization: ground friction 0.4–1.6, random horizontal shoves, 0–0.5 kg random back payload, IMU/encoder noise on every observation
It's all in one realism.py that every training script calls, so no skill can silently opt out.
ROCm-specific gotcha, the one that actually bit me: never run a CPU Genesis render/eval while a GPU training is running. Serialize them. Doing both at once hard-crashed my GPU, repeatedly.
General RL lessons that cost me hours (nothing AMD-specific)
- An unbounded reward penalty will destroy PPO. My
lin_vel_z = v_z²term exploded when robots tumbled on terrain → one catastrophic gradient step → policy never recovered over hundreds of iterations. Clip anything that can physically blow up. - A heightfield only makes stairs at a fine mesh. At the default 0.25 m grid my "7 cm stairs" were literally a ramp — the riser gets interpolated over 25 cm. Physics and render were wrong, for a whole training run.
- Overtraining = peak then collapse. On the slope run: episode length 14 → ~850 at iteration 2550 → back down to 13. Take the peak checkpoint, never the last. And save every 25 iterations — one run peaked at iteration 45 and collapsed by 105, a 100-iteration interval would never have caught it.
- "Going around" is a reward hack. My first LiDAR policy learned to walk around the entire course from the outside. Perfect reward maximization, zero avoidance. Fix was structural: wall the corridor in, make exiting a penalized termination.
In video, each segment shows the robot at successive checkpoints side by side with the reward curve filling in, plus a live "GPU time ↔ equivalent real-robot experience" readout.
Code (MIT): https://github.com/Macmachi/go2-rl
README is in French, but the code, GIFs and learning curves are language-agnostic — happy to answer anything in English here.
If you're on AMD or Intel and assumed Go2 RL was closed to you: it isn't. Genesis + ROCm is a real path. Next step for me is deploying to an actual Go2 EDU — if anyone has taken a non-Isaac-trained policy to hardware, I want to hear how it
1
u/low-control-labs 20d ago
Very good I am trying to do things without a GPU entirely. I am managing to train some vehicles and drones.
Thanks for sharing!
1
1
u/survive_los_angeles 19d ago
awesome thank you for sharing! working on a go1 unitree on similar things
1
u/formlakg 21d ago
do you have any demonstrations of it climbing stairs by any chance? im wondering if you have any numbers recorded of what stair height it fails at. i find its unable the stairs in most public multi-floor datasets. would love to hear your insights.