mirror of
https://github.com/RadeonOpenCompute/ROCm-docker.git
synced 2023-04-23 17:53:00 +03:00
add compatibility check as entry point for ROCm4.1 docker containers and newer
This commit is contained in:
12
dev/Dockerfile.post-install
Normal file
12
dev/Dockerfile.post-install
Normal file
@@ -0,0 +1,12 @@
|
||||
#| This Dockerfile provides a compatibility check for ROCm docker container.
|
||||
ARG base_image
|
||||
FROM ${base_image}
|
||||
|
||||
MAINTAINER Peng Sun <peng.sun@amd.com>
|
||||
|
||||
COPY ../scripts/compatibility-check.sh /opt/rocm/bin/rocm-compatibility-test.sh
|
||||
RUN chmod a+x /opt/rocm/bin/rocm-compatibility-test.sh
|
||||
ENTRYPOINT ["/opt/rocm/bin/rocm-compatibility-test.sh"]
|
||||
|
||||
# Default to a login shell
|
||||
CMD ["/bin/bash", "-l"]
|
||||
12
rocm-terminal/Dockerfile.post-install
Normal file
12
rocm-terminal/Dockerfile.post-install
Normal file
@@ -0,0 +1,12 @@
|
||||
#| This Dockerfile provides a compatibility check for ROCm docker container.
|
||||
ARG base_image
|
||||
FROM ${base_image}
|
||||
|
||||
MAINTAINER Peng Sun <peng.sun@amd.com>
|
||||
|
||||
COPY ../scripts/compatibility-check.sh /opt/rocm/bin/rocm-compatibility-test.sh
|
||||
RUN chmod a+x /opt/rocm/bin/rocm-compatibility-test.sh
|
||||
ENTRYPOINT ["/opt/rocm/bin/rocm-compatibility-test.sh"]
|
||||
|
||||
# Default to a login shell
|
||||
CMD ["/bin/bash", "-l"]
|
||||
13
scripts/compatibility-check.sh
Executable file
13
scripts/compatibility-check.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
/opt/rocm/bin/rocminfo 2>&1 | /bin/grep "HSA Error" > /dev/null
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
echo "Error: Incompatible ROCm environment."
|
||||
echo "The Docker container requires the latest kernel driver to operate correctly."
|
||||
echo "Upgrade the ROCm kernel to v4.1 or newer, or use a container tagged for v4.0.1 or older."
|
||||
echo "For more information, see"
|
||||
echo "https://rocmdocs.amd.com/en/latest/Current_Release_Notes/Current-Release-Notes.html#"
|
||||
exit 1
|
||||
fi
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user