Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save stevewithington/c87d96d9d781aa3188b77280d9b9394f to your computer and use it in GitHub Desktop.
Save stevewithington/c87d96d9d781aa3188b77280d9b9394f to your computer and use it in GitHub Desktop.
#!/bin/bash -e
ln -s /usr/lib/x86_64-linux-gnu/amdgpu-pro .
ln -s /etc/OpenCL .
tar -czvf libs.tar.gz amdgpu-pro/*
tar -czvf conf.tar.gz OpenCL/*
cat > .dockerignore << EOF
OpenCL
amdgpu-pro
EOF
cat > Dockerfile << EOF
FROM ubuntu:16.04
ADD libs.tar.gz /usr/lib
ADD conf.tar.gz /etc
RUN ldconfig /usr/lib /usr/lib/amdgpu-pro
CMD ["bash"]
EOF
docker build -t climage .
echo "Finished. Run with:"
echo " docker run --device /dev/dri:/dev/dri <extra-params> climage <command>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment