Skip to content

Commit ae6ff77

Browse files
authored
fix(installer): recognize CUDA UMD version labels (#1815)
1 parent d322c49 commit ae6ff77

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

‎docs/public/install.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ check_cuda() {
256256
nvidia-smi -L >/dev/null 2>&1 || die "The NVIDIA driver cannot access a GPU."
257257

258258
supported_cuda=$(nvidia-smi 2>/dev/null |
259-
sed -n 's/.*CUDA Version: \([0-9][0-9.]*\).*/\1/p' |
259+
sed -nE 's/.*CUDA (UMD )?Version: ([0-9][0-9.]*).*/\2/p' |
260260
head -n 1)
261261
[ -n "$supported_cuda" ] ||
262262
die "Could not determine the CUDA version supported by the NVIDIA driver."
@@ -583,7 +583,7 @@ fi
583583

584584
say
585585
say "Activate the environment with:"
586-
say " . $(shell_quote "$venv_path/bin/activate")"
586+
say " source $(shell_quote "$venv_path/bin/activate")"
587587
say
588588
say "Then verify the installation with:"
589589
say " sonar --version"

‎tests/scripts/test_install.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def installer_environment(tmp_path: Path) -> dict[str, str]:
6060
'case "${1:-}" in\n'
6161
' -L) echo "GPU 0: Test GPU";;\n'
6262
' --query-gpu=compute_cap) printf "%s\\n" "$TEST_COMPUTE_CAPS";;\n'
63-
' "") echo "CUDA Version: $TEST_CUDA_VERSION";;\n'
63+
' "") echo "$TEST_CUDA_LABEL: $TEST_CUDA_VERSION";;\n'
6464
" *) exit 1;;\n"
6565
"esac"
6666
),
@@ -82,6 +82,7 @@ def installer_environment(tmp_path: Path) -> dict[str, str]:
8282
"TEST_MACHINE": "aarch64",
8383
"TEST_COMPUTE_CAPS": "11.0",
8484
"TEST_CUDA_VERSION": "13.2",
85+
"TEST_CUDA_LABEL": "CUDA Version",
8586
"SONAR_ENABLE_CUDA_COMPATIBILITY": "0",
8687
"SONAR_CUDA_COMPATIBILITY_PATH": "",
8788
}
@@ -143,13 +144,15 @@ def test_installer_selects_platform_index(
143144
assert not (tmp_path / "venv").exists()
144145

145146

147+
@pytest.mark.parametrize("cuda_label", ["CUDA Version", "CUDA UMD Version"])
146148
@pytest.mark.parametrize(
147149
("machine", "os_name", "cuda_version", "compute_caps", "error"),
148150
[
149151
("aarch64", "Linux", "13.2", "8.0", None),
150152
("aarch64", "Linux", "13.2", "11.0", None),
151153
("aarch64", "Linux", "13.2", "11.0\n12.1", None),
152154
("x86_64", "Linux", "13.2", "12.1", None),
155+
("x86_64", "Linux", "13.4", "12.0", None),
153156
("x86_64", "Linux", "13.2", "11.0", "compute capability: 11.0"),
154157
("aarch64", "Linux", "13.2", "8.7", "compute capability: 8.7"),
155158
("aarch64", "Linux", "13.2", "11.0\n8.7", "compute capability: 8.7"),
@@ -167,13 +170,15 @@ def test_installer_validates_cuda_platform(
167170
cuda_driver: Path,
168171
os_name: str,
169172
cuda_version: str,
173+
cuda_label: str,
170174
compute_caps: str,
171175
error: str | None,
172176
) -> None:
173177
installer_environment.update(
174178
TEST_MACHINE=machine,
175179
TEST_OS=os_name,
176180
TEST_CUDA_VERSION=cuda_version,
181+
TEST_CUDA_LABEL=cuda_label,
177182
TEST_COMPUTE_CAPS=compute_caps,
178183
)
179184
installer_environment.update(LD_LIBRARY_PATH=str(cuda_driver), TEST_DRIVER_API="13000")

0 commit comments

Comments
 (0)