Skip to content

Instantly share code, notes, and snippets.

@usrbinkat
Created October 1, 2024 02:34
Show Gist options
  • Save usrbinkat/c19f36db5c188942c803b18c9f394ee6 to your computer and use it in GitHub Desktop.
Save usrbinkat/c19f36db5c188942c803b18c9f394ee6 to your computer and use it in GitHub Desktop.
Arch Linux Nvidia Cuda Docker
##################################################################################
#
# Arch Linux Nvidia Cuda Container
#
# Build:
#
# $ docker build --progress=plain -t testing/cuda .
#
# Run:
#
# $ docker run -it --rm --gpus=all testing/cuda nvidia-smi
#
# Tue Oct 1 02:27:59 2024
# +-----------------------------------------------------------------------------------------+
# | NVIDIA-SMI 560.35.03 Driver Version: 560.35.03 CUDA Version: 12.6 |
# |-----------------------------------------+------------------------+----------------------+
# | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
# | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
# | | | MIG M. |
# |=========================================+========================+======================|
# | 0 Quadro T1000 Off | 00000000:01:00.0 Off | N/A |
# | N/A 48C P8 3W / 50W | 126MiB / 4096MiB | 0% Default |
# | | | N/A |
# +-----------------------------------------+------------------------+----------------------+
#
# +-----------------------------------------------------------------------------------------+
# | Processes: |
# | GPU GI CI PID Type Process name GPU Memory |
# | ID ID Usage |
# |=========================================================================================|
#
##################################################################################
FROM archlinux
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
ENV PKG_LIST="\
base \
base-devel \
cuda \
"
RUN \
--mount=type=cache,sharing=locked,target=/var/cache/pacman \
pacman -Syu --noconfirm --needed $PKG_LIST \
&& echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment