This project intends to provide an easy way to have Retroarch running on Toradex boards using Docker containers. Retroarch is a frontend for emulators, and it can execute games for multiple platforms using game engines (libretro cores).
Currently, the only platform tested is :
- Toradex Apalis iMX8
We successfully tested the following libretro cores with a consistent performance:
- Sony Playstation (Beetle PSX) @ 60fps
- Sega Genesis/Mega Drive (PicoDrive)
- Nintendo SNES (Snes9x)
- Dos (DOSBox)
-
A Toradex SoM with Torizon installed. We currently only tested it with Toradex Apalis iMX8.
-
A Dockerhub account. In your PC, use
docker login
to register your credentials -
An HDMI screen connected to the board
Note: Some emulators will require a console BIOS image file. You will also need the ROMs with the game images to execute. As we don't provide these files, we show how to bind mount a directory from your board, so you can included your files to these directories.
If you only want to play games without building from scratch, in your Toradex SoM's console, do the following:
Disable the pre-provisioned containers:
# sudo systemctl disable docker-compose
Reboot your board (You only need to do it once).
After the reboot, pull the pre-built container image from Dockerhub and deploy the container:
# docker pull denisyuji/retroarch-on-torizon && docker run -e ACCEPT_FSL_EULA=1 -it --rm --name=retroarch --net=host --cap-add CAP_SYS_TTY_CONFIG \
-v /dev:/dev -v /tmp:/tmp -v /run/udev/:/run/udev/ --device-cgroup-rule='c 4:* rmw' \
-v ~/ROM:/home/ROM -v ~/BIOS:/home/BIOS --privileged \
--device-cgroup-rule='c 13:* rmw' --device-cgroup-rule='c 199:* rmw' --device-cgroup-rule='c 226:* rmw' \
--device-cgroup-rule='c 81:* rmw' denisyuji/retroarch-on-torizon
Note: Put your BIOS and ROM files on the /home/torizon/BIOS
and /home/torizon/ROM
directories of the board using scp
command. This directory will be bind mounted into the container.
In your PC, clone this repository:
$ git clone https://github.com/denisyuji/retroarch-on-torizon.git
Build the Docker image. It can take several minutes our hours, depending of the machine, since it tries to build all the possible cores for all the games platforms. You can modify the Dockerfile to build only specific cores.
$ cd retroarch-on-torizon
$ docker build -t <your-dockerhub-username>/retroarch-on-torizon .
After the build, push the image to 'your Dockerhub account.
$ docker push <your-dockerhub-username>/retroarch-on-torizon
Connect to your board's terminal using ssh. Torizon comes with pre-provisioned containers. To kill it, send the following command in your board's terminal:
# sudo systemctl disable docker-compose
Reboot your board.
Pull your container from Dockerhub:
# docker pull <your-dockerhub-username>/retroarch-on-torizon
Finally, execute the container based on the image (adjust the command to your Dockerhub username):
docker run -e ACCEPT_FSL_EULA=1 -it --rm --name=retroarch --net=host --cap-add CAP_SYS_TTY_CONFIG \
-v /dev:/dev -v /tmp:/tmp -v /run/udev/:/run/udev/ --device-cgroup-rule='c 4:* rmw' \
-v ~/ROM:/home/ROM -v ~/BIOS:/home/BIOS \
--device-cgroup-rule='c 13:* rmw' --device-cgroup-rule='c 199:* rmw' --device-cgroup-rule='c 226:* rmw' \
--device-cgroup-rule='c 81:* rmw' <your-dockerhub-username>/retroarch-on-torizon
-
The image includes other platforms' cores, but we didn't test it (Some of them will not work).
-
No shaders / render on HW. CPU only. We plan to support HW 3D acceleration in the future (with Vulkan support probably).