Files
Bobby R. Bruce 7117b1399b util-docker: Fix gpu dpcker images (#1627)
Two faults:

1. You can't give description the docker-bake file for single platform
builds. They must be in the Dockerfile..
2. The gpu docker image def in docker-bake.hcl was not overriding the
"common" setttings as previously thought. This was causing builds to
something build the wrong platform and vairous other weird bugs. This
has been fixed in this patch.
2024-10-04 02:37:16 -07:00
..

rocm-build Dockerfile

The Dockerfile in this directory is used to build applications to be run with GPU full system. Applications targeting AMD's ROCm GPU framework can be built using this docker (e.g., HIP, HSA, OpenCL, etc.). The current major ROCm version targeted is 6.1. This version matches the disk image provided in gem5-resources.

The purpose of this docker image is to allow building applications without requiring ROCm to be installed on the host machine. If you have ROCm installed locally and the version matches the disk image of the simulated system, this docker is not required and you may build on the host normally. This docker is also not the disk image used to simulated GPU full system applications (i.e., not an input to gem5 itself).

Building the docker image

docker build -t <image_name> .

For example:

docker build -t rocm6-build .

Building an application

Building an application requires that docker run in a directory which has access to all files needed to build. The simplest example would be square in the gem5-resources repository. Square provides a Makefile and has only one input file:

cd gem5-resources/src/gpu/square
docker run --rm -u $UID:$GID -v $PWD:$PWD -w $PWD rocm6-build make

More complex applications, such as applications requiring m5ops, applications with multiple build steps, or paths with symlinks require more complex --volume command line options. See the docker documentation to figure out how to set the volumes to build your application.