mirror of
https://github.com/ROCm/ROCm-docker.git
synced 2026-05-05 07:36:12 +02:00
Adding docker build contexts for rock and roct
This commit is contained in:
parent
d5681793b9
commit
5e18be02e2
28
rock/README.md
Normal file
28
rock/README.md
Normal file
@ -0,0 +1,28 @@
|
||||
## ROCK-Kernel-Driver docker build context
|
||||
This directory is the docker build context of the ROC kernel and kernel modules. Building the docker container will download, optionally build and install the linux kernel with the appropriate kernel modules enabled.
|
||||
|
||||
This dockerfile serves as an example, how-to, or as an isolated environment for kernel hackers, as build files and artifacts are isolated in the scope of the docker container.
|
||||
|
||||
### The host is not modified
|
||||
There are two dockerfiles files present in this directory
|
||||
* rock-deb-dockerfile
|
||||
* rock-make-dockerfile
|
||||
|
||||
---
|
||||
**rock-deb-dockerfile** will connect to github and clone the ROCK-Kernel-Driver repository. It then unpacks the pre-built .debs that are part of the build tree. This is the fastest and tested way to install the amdkfd and amdgpu components
|
||||
|
||||
Build with: `docker build -f rock-deb-dockerfile -t roc/rock .`
|
||||
|
||||
---
|
||||
**rock-make-dockerfile** also connects to github and clones the ROCK-Kernel-Driver repository. Instead of using the pre-built debian packages, it build a new kernel with the amdkfd and amdgpu kernel modules enabled.
|
||||
|
||||
Build with: `docker build -f rock-make-dockerfile -t roc/rock .`
|
||||
|
||||
---
|
||||
Once the docker images has been built, you can run a shell inside of the container with:
|
||||
|
||||
`docker run -it --rm roc/rock`
|
||||
|
||||
**rock.config** is used to seed the kernel configuration step, turning on boltzmann kernel modules in the **rock-make-dockerfile**
|
||||
|
||||
**rock.config.diff** shows what kernel options changed from the default generated .config
|
||||
37
rock/rock-deb-dockerfile
Normal file
37
rock/rock-deb-dockerfile
Normal file
@ -0,0 +1,37 @@
|
||||
# Build this dockerfile with `docker build -f rock-deb-dockerfile -t roc/rock .`
|
||||
|
||||
# To reduce container rebuild time, place commands least likely to change at top to
|
||||
# most changing at bottom
|
||||
|
||||
# This builds the radeon open compute kernel and kernel modules
|
||||
|
||||
# This kfd has only been tested so far on linux-headers-generic-lts-vivid
|
||||
# ubuntu:14.04.3, the native kernel is '3.19'
|
||||
FROM ubuntu:14.04.3
|
||||
MAINTAINER Kent Knox <kent.knox@amd>
|
||||
|
||||
# Constant environment variables
|
||||
ENV WORKPATH /root
|
||||
|
||||
# Set working directory to be root's home directory
|
||||
WORKDIR ${WORKPATH}
|
||||
|
||||
# Default to a login shell
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
CMD ["-l"]
|
||||
|
||||
# Initialize the image we are working with
|
||||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||
crda \
|
||||
wireless-crda \
|
||||
git && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN cd /usr/local/src && \
|
||||
git clone --depth=1 https://github.com/RadeonOpenCompute/ROCK-Kernel-Driver.git && \
|
||||
cd ROCK-Kernel-Driver && \
|
||||
echo "KERNEL==\"kfd\", MODE=\"0666\"" | sudo tee /etc/udev/rules.d/kfd.rules
|
||||
|
||||
RUN cd /usr/local/src/ROCK-Kernel-Driver && \
|
||||
DEBIAN_FRONTEND=noninteractive dpkg -i packages/ubuntu/*.deb
|
||||
51
rock/rock-make-dockerfile
Normal file
51
rock/rock-make-dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Build this dockerfile with `docker build -f rock-make-dockerfile -t roc/rock .`
|
||||
|
||||
# To reduce container rebuild time, place commands least likely to change at top to
|
||||
# most changing at bottom
|
||||
|
||||
# This builds the radeon open compute kernel and kernel modules
|
||||
|
||||
# This kfd has only been tested so far on linux-headers-generic-lts-vivid
|
||||
# ubuntu:14.04.3, the native kernel is '3.19'
|
||||
FROM ubuntu:14.04.3
|
||||
MAINTAINER Kent Knox <kent.knox@amd>
|
||||
|
||||
# Constant environment variables
|
||||
ENV WORKPATH /root
|
||||
|
||||
# Set working directory to be root's home directory
|
||||
WORKDIR ${WORKPATH}
|
||||
|
||||
# Default to a login shell
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
CMD ["-l"]
|
||||
|
||||
# Initialize the image we are working with
|
||||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||
crda \
|
||||
wireless-crda \
|
||||
build-essential \
|
||||
bc \
|
||||
git && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN cd /usr/local/src && \
|
||||
git clone --depth=1 https://github.com/RadeonOpenCompute/ROCK-Kernel-Driver.git && \
|
||||
cd ROCK-Kernel-Driver && \
|
||||
make mrproper && \
|
||||
echo "KERNEL==\"kfd\", MODE=\"0666\"" | sudo tee /etc/udev/rules.d/kfd.rules
|
||||
|
||||
# Copy a pre-configured kernel config that enables amdkfd & amdgpu
|
||||
# 'device drivers' \ 'IOMMU Hardware support' \ 'amd_iommu_v2'
|
||||
# 'device drivers' \ 'graphics support' \ 'direct rendering manager' \ 'AMD GPU'
|
||||
# 'device drivers' \ 'graphics support' \ 'direct rendering manager' \ 'HSA kernel driver'
|
||||
COPY rock.config /usr/local/src/ROCK-Kernel-Driver/.config
|
||||
|
||||
RUN cd /usr/local/src/ROCK-Kernel-Driver && \
|
||||
make olddefconfig && \
|
||||
make -j $(nproc) && \
|
||||
make modules_install install && \
|
||||
DEBIAN_FRONTEND=noninteractive dpkg -i packages/ubuntu/compute-firmware*.deb
|
||||
|
||||
# VOLUME ["/usr/share/doc/compute-firmware"]
|
||||
3745
rock/rock.config
Normal file
3745
rock/rock.config
Normal file
File diff suppressed because it is too large
Load Diff
10
rock/rock.config.diff
Normal file
10
rock/rock.config.diff
Normal file
@ -0,0 +1,10 @@
|
||||
AMD_IOMMU_V2 n -> m
|
||||
DRM_AMDGPU n -> m
|
||||
+DRM_AMDGPU_CIK n
|
||||
+DRM_AMDGPU_USERPTR n
|
||||
+DRM_AMD_DAL n
|
||||
+DRM_AMD_GNB_BUS m
|
||||
+DRM_AMD_POWERPLAY n
|
||||
+DRM_TTM m
|
||||
+HSA_AMD m
|
||||
+MMU_NOTIFIER y
|
||||
@ -1,4 +1,4 @@
|
||||
# Build this dockerfile with `docker build -f rocr-dockerfile -t rocr:master .`
|
||||
# Build this dockerfile with `docker build -f rocr-dockerfile -t roc/rocr .`
|
||||
|
||||
# To reduce container rebuild time, place commands least likely to change at top to
|
||||
# most changing at bottom
|
||||
|
||||
18
roct/README.md
Normal file
18
roct/README.md
Normal file
@ -0,0 +1,18 @@
|
||||
## ROCT-Thunk-Interface docker build context
|
||||
This directory is the docker build context of the ROC thunk interface. Building the docker container downloads, builds and installs the radeon compute user-mode API interfaces.
|
||||
|
||||
This dockerfile serves as an example, how-to, or as an isolated environment for kernel hackers, as build files and artifacts are isolated in the scope of the docker container.
|
||||
|
||||
### The host is not modified
|
||||
|
||||
One dockerfile is present in this directory
|
||||
* roct-thunk-dockerfile
|
||||
|
||||
---
|
||||
**roct-thunk-dockerfile** contains a dependency on the roc/rock image to be present.
|
||||
|
||||
Build with: `docker build -f roct-thunk-dockerfile -t roc/roct .`
|
||||
|
||||
---
|
||||
Once the docker images has been built, you can run a shell inside of the container with
|
||||
`docker run -it --rm roc/roct`
|
||||
36
roct/roct-thunk-dockerfile
Normal file
36
roct/roct-thunk-dockerfile
Normal file
@ -0,0 +1,36 @@
|
||||
# Build this dockerfile with `docker build -f roct-thunk-dockerfile -t roc/roct-thunk .`
|
||||
|
||||
# To reduce container rebuild time, place commands least likely to change at top to
|
||||
# most changing at bottom
|
||||
|
||||
# This builds the radeon open compute runtime
|
||||
|
||||
# This kfd has only been tested so far on linux-headers-generic-lts-vivid
|
||||
# ubuntu:14.04.3, the native kernel is '3.19'
|
||||
FROM roc/rock
|
||||
MAINTAINER Kent Knox <kent.knox@amd>
|
||||
|
||||
# Constant environment variables
|
||||
ENV WORKPATH /root
|
||||
|
||||
# Set working directory to be root's home directory
|
||||
WORKDIR ${WORKPATH}
|
||||
|
||||
# Default to a login shell
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
CMD ["-l"]
|
||||
|
||||
# Initialize the image we are working with
|
||||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||
build-essential \
|
||||
git && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN cd /usr/local/src && \
|
||||
git clone https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface.git && \
|
||||
cd ROCT-Thunk-Interface && \
|
||||
make -j $(nproc) all deb && \
|
||||
rm -f /usr/lib/x86_64-linux-gnu/libhsakmt.* && \
|
||||
cp build/lnx64a/lib*.so.1 /usr/lib/x86_64-linux-gnu && \
|
||||
ln -s /usr/lib/x86_64-linux-gnu/libhsakmt.so.1 /usr/lib/x86_64-linux-gnu/libhsakmt.so
|
||||
Loading…
x
Reference in New Issue
Block a user