Bug: ValueError: cannot find context for 'fork' breaks 10 tutorials on Windows
@vmoens is already working on this.
Since Aug 17, 2026.
- Dominant language
- Python
- Stars
- 3.6k
- Forks
- 487
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 207
Description
Describe the bug
When running the TorchRL tutorials on Windows, the scripts crash immediately with a ValueError. This happens because the tutorials explicitly attempt to set the multiprocessing start method to "fork", but the "fork" method is not supported on Windows (which only supports "spawn").
This affects 10 different tutorials in the tutorials/sphinx-tutorials/ directory that all hardcode multiprocessing.set_start_method("fork").
The affected files are:
coding_ppo.pycoding_ddpg.pycoding_dqn.pydqn_with_rnn.pymulti_task.pypendulum.pypretrained_models.pyrecurrent_sequence_training.pytorchrl_demo.pytorchrl_envs.py
To Reproduce
Steps to reproduce the behavior.
- Use a Windows machine.
- Clone the
pytorch/rlrepository. - Run any of the affected tutorial scripts from the root directory.
Expected behavior
The tutorial scripts should run successfully on Windows without crashing due to unsupported multiprocessing start methods.
Screenshots
N/A
System info
Describe the characteristic of your environment:
- Windows 10 / 11
- Python 3.12 (also affects other versions on Windows)
Checklist
- I have checked that there is no similar bug in the repo (required)
- I have read the documentation (required)
- I have provided a minimal working example to reproduce the bug (required)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.