Skip to content

Commit 139d805

Browse files
committed
Migrate cuda to runtime
The CUDA variant is absorbed into the base image. The CUDA SDK was already installed at runtime by devinstall_software.sh; the only build-time additions were Nsight GUI dependencies and the CUDA_VERSION env var. Nsight GUI deps now install conditionally with INSTALL_TOOLS. - Delete Dockerfile.cuda and cuda-image.yml CI workflow - Move Nsight GUI deps (libglvnd-opengl, etc.) to devinstall_software.sh under INSTALL_TOOLS + CUDA_VERSION - Remove IMAGE_TAG version embedding for cuda in triton-dev-containers.sh - Resolve -d cuda to the base image - Remove cuda-image build target from Makefile stack-info: PR: #2, branch: hinriksnaer/stack/17
1 parent 12066ac commit 139d805

6 files changed

Lines changed: 18 additions & 129 deletions

File tree

.github/workflows/cuda-image.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.

Makefile

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,12 @@ IMAGE_REPO = quay.io/triton-dev-containers
4848

4949
# Image name definitions (clean and extensible)
5050
BASE_IMAGE_NAME = base
51-
CUDA_IMAGE_NAME = cuda
5251
ROCM_IMAGE_NAME = rocm
5352

5453
# Image tags
5554
IMAGE_TAG := centos$(CENTOS_VERSION)
5655

5756
BASE_IMAGE_TAG := $(IMAGE_TAG)
58-
CUDA_IMAGE_TAG := $(CUDA_VERSION)-$(IMAGE_TAG)
5957
ROCM_IMAGE_TAG := $(ROCM_VERSION)-$(IMAGE_TAG)
6058

6159
# ------------------------------------------------------------------------------
@@ -134,7 +132,7 @@ define build-image
134132
endef
135133

136134
.PHONY: build-images
137-
build-images: cuda-image rocm-image ## Build all container images
135+
build-images: base-image rocm-image ## Build all container images
138136

139137
define base_image_build_args
140138
--build-arg CENTOS_VERSION=$(CENTOS_VERSION) \
@@ -152,11 +150,6 @@ define image_build_args
152150
--build-arg BASE_IMAGE_TAG=$(BASE_IMAGE_TAG)
153151
endef
154152

155-
.PHONY: cuda-image
156-
cuda-image: dockerfiles/Dockerfile.cuda | base-image ## Build a CUDA container image
157-
$(call build-image,$(CUDA_IMAGE_NAME),$(CUDA_IMAGE_TAG),$(image_build_args) \
158-
--build-arg BUILD_CUDA_VERSION=$(CUDA_VERSION),$<)
159-
160153
.PHONY: rocm-image
161154
rocm-image: dockerfiles/Dockerfile.rocm | base-image ## Build a ROCm container image
162155
$(call build-image,$(ROCM_IMAGE_NAME),$(ROCM_IMAGE_TAG),$(image_build_args) \
@@ -273,8 +266,8 @@ base-run: ## Run the base container
273266
@./triton-dev-containers.sh $(RUNTIME_ARGS) -d base
274267

275268
.PHONY: cuda-run
276-
cuda-run: ## Run the CUDA container image
277-
@./triton-dev-containers.sh $(CUDA_RUNTIME_ARGS) -d $(CUDA_IMAGE_NAME)
269+
cuda-run: ## Run a CUDA container
270+
@./triton-dev-containers.sh $(CUDA_RUNTIME_ARGS) -d cuda
278271

279272
.PHONY: cpu-run
280273
cpu-run: ## Run a CPU container
@@ -285,8 +278,8 @@ rocm-run: ## Run the ROCm container image
285278
@./triton-dev-containers.sh $(ROCM_RUNTIME_ARGS) -d $(ROCM_IMAGE_NAME)
286279

287280
.PHONY: helion-cuda-run
288-
helion-cuda-run: ## Run the Helion CUDA container image
289-
@./triton-dev-containers.sh $(CUDA_RUNTIME_ARGS) -d $(CUDA_IMAGE_NAME) -k helion
281+
helion-cuda-run: ## Run the Helion CUDA container
282+
@./triton-dev-containers.sh $(CUDA_RUNTIME_ARGS) -d cuda -k helion
290283

291284
.PHONY: helion-cpu-run
292285
helion-cpu-run: ## Run the Helion CPU container
@@ -297,8 +290,8 @@ helion-rocm-run: ## Run the Helion ROCm container image
297290
@./triton-dev-containers.sh $(ROCM_RUNTIME_ARGS) -d $(ROCM_IMAGE_NAME) -k helion
298291

299292
.PHONY: triton-cuda-run
300-
triton-cuda-run: ## Run the Triton CUDA container image
301-
@./triton-dev-containers.sh $(CUDA_RUNTIME_ARGS) -d $(CUDA_IMAGE_NAME) -k triton
293+
triton-cuda-run: ## Run the Triton CUDA container
294+
@./triton-dev-containers.sh $(CUDA_RUNTIME_ARGS) -d cuda -k triton
302295

303296
.PHONY: triton-cpu-run
304297
triton-cpu-run: ## Run the Triton CPU container
@@ -309,8 +302,8 @@ triton-rocm-run: ## Run the Triton ROCm container image
309302
@./triton-dev-containers.sh $(ROCM_RUNTIME_ARGS) -d $(ROCM_IMAGE_NAME) -k triton
310303

311304
.PHONY: torch-cuda-run
312-
torch-cuda-run: ## Run the PyTorch CUDA container image
313-
@./triton-dev-containers.sh $(CUDA_RUNTIME_ARGS) -d $(CUDA_IMAGE_NAME) -k torch
305+
torch-cuda-run: ## Run the PyTorch CUDA container
306+
@./triton-dev-containers.sh $(CUDA_RUNTIME_ARGS) -d cuda -k torch
314307

315308
.PHONY: torch-cpu-run
316309
torch-cpu-run: ## Run the PyTorch CPU container
@@ -321,8 +314,8 @@ torch-rocm-run: ## Run the PyTorch ROCm container image
321314
@./triton-dev-containers.sh $(ROCM_RUNTIME_ARGS) -d $(ROCM_IMAGE_NAME) -k torch
322315

323316
.PHONY: vllm-cuda-run
324-
vllm-cuda-run: ## Run the vLLM CUDA container image
325-
@./triton-dev-containers.sh $(CUDA_RUNTIME_ARGS) -d $(CUDA_IMAGE_NAME) -k vllm
317+
vllm-cuda-run: ## Run the vLLM CUDA container
318+
@./triton-dev-containers.sh $(CUDA_RUNTIME_ARGS) -d cuda -k vllm
326319

327320
.PHONY: vllm-cpu-run
328321
vllm-cpu-run: ## Run the vLLM CPU container

README.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ Arguments that can be added to the build commands below, i.e. `OPTION=VALUE`.
7171

7272
- `CENTOS_VERSION`
7373
- CentOS Stream image version to use, i.e. `9`
74-
- `CUDA_VERSION`
75-
- Use the CUDA RPM package version, i.e. `12-9`
7674
- `GOSU_VERSION`
7775
- Check the gosu GitHub for the desired release
7876
- <https://github.com/tianon/gosu>
@@ -95,12 +93,6 @@ make build-images [OPTIONS]
9593
make base-image [OPTIONS]
9694
```
9795

98-
#### NVIDIA CUDA container build
99-
100-
```sh
101-
make cuda-image [OPTIONS]
102-
```
103-
10496
#### AMD ROCm container build
10597

10698
```sh
@@ -117,7 +109,7 @@ Arguments that can be added to the run commands below, i.e. `OPTION=VALUE`.
117109

118110
- `CUDA_VERSION`
119111
- Use the CUDA RPM package version, i.e. `12-9`
120-
- Specifies the CUDA image to use
112+
- Selects the CUDA SDK version to install at runtime
121113
- `ROCM_VERSION`
122114
- Specifies the ROCm image to use
123115
- Use the ROCm RPM package version, i.e. `6.3.4`

dockerfiles/Dockerfile.cuda

Lines changed: 0 additions & 36 deletions
This file was deleted.

scripts/devinstall_software.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ EOF
125125
fi
126126

127127
if [ "${INSTALL_TOOLS:-}" = "true" ]; then
128+
echo "Installing NVIDIA Nsight GUI dependencies ..."
129+
$SUDO dnf -y install libglvnd-opengl libxkbfile \
130+
qt5-qtwayland xcb-util-cursor
131+
128132
echo "Installing NVIDIA Nsight ..."
129133
$SUDO dnf -y install cublasmp "cuda-gdb-$CUDA_VERSION" \
130134
"cuda-nsight-$CUDA_VERSION" "cuda-nsight-compute-$CUDA_VERSION" \

triton-dev-containers.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ set_device_opts() {
283283

284284
set_env_opt CUDA_VERSION "${DEFAULT_ENV_OPTS["CUDA_VERSION"]}"
285285
set_env_opt CUDA_VISIBLE_DEVICES "${DEFAULT_ENV_OPTS["CUDA_VISIBLE_DEVICES"]}"
286-
IMAGE_TAG=${ENV_OPTS["CUDA_VERSION"]}-${DEFAULT_IMAGE_TAG}
287286
;;
288287
cpu)
289288
set_env_opt TRITON_CPU_BACKEND 1
@@ -439,8 +438,8 @@ fi
439438

440439
# Resolve image name from target device (cpu uses the base image)
441440
case ${TARGET_DEVICE,,} in
442-
cpu|base) IMAGE_NAME=base ;;
443-
*) IMAGE_NAME=${TARGET_DEVICE} ;;
441+
cpu|cuda|base) IMAGE_NAME=base ;;
442+
*) IMAGE_NAME=${TARGET_DEVICE} ;;
444443
esac
445444

446445
IMAGE=${IMAGE:-${DEFAULT_IMAGE_REPO}/${IMAGE_NAME}:${IMAGE_TAG:-${DEFAULT_IMAGE_TAG}}}

0 commit comments

Comments
 (0)