项目作者: cebxan

项目描述 :
Docker image with AMDGPU OpenCL support
高级语言: Dockerfile
项目地址: git://github.com/cebxan/docker-amdgpu-opencl.git
创建时间: 2021-03-30T21:35:04Z
项目社区:https://github.com/cebxan/docker-amdgpu-opencl

开源协议:MIT License

下载


Docker AMDGPU OpenCL image

This Docker image is based on Ubuntu 20.04 and was compiled with support for legacy GPUs (Polaris and older) and ROCr (Vega and newer)

Build

You can pull the latest version in your Dockerfile

  1. FROM cebxan/amdgpu-opencl:latest

Or pull and specific tag

  1. FROM cebxan/amdgpu-opencl:21.10-1247438

You can use it with multi-stage builds for smaller images

  1. FROM ubuntu:20.04 AS base
  2. WORKDIR /tmp
  3. # run your steps to build your app
  4. FROM cebxan/amdgpu-opencl:21.10-1247438
  5. COPY --from=base /tmp/app/yourbinary /usr/local/bin/yourbinary
  6. ENTRYPOINT ["yourbinary"]

Usage

You have to use --device=/dev/dri:/dev/dri to access the GPU resource on Linux. For example:

  1. docker run --rm --name amdgpu-example \
  2. --device='/dev/dri:/dev/dri' \
  3. -e TZ="America/Caracas" \
  4. cebxan/amdgpu-opencl

The TZ environment variable is available to set your desired timezone.

No default command is defined because it’s intended to be used as a base for other images.

Support

This has only been tested with a RX 580. If you can confirm other GPUs, please let me know so I can create a list of tested cards.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT