Skip to content

Instantly share code, notes, and snippets.

@pejvan
Forked from anonymous/amdgpupro_in_container.bash
Created February 15, 2019 10:13
Show Gist options
  • Save pejvan/e5b36ce0ee9e669891f483f8ef6b0e08 to your computer and use it in GitHub Desktop.
Save pejvan/e5b36ce0ee9e669891f483f8ef6b0e08 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