A container starts, but the application never uses the GPU. Or the device list looks correct, yet the first matrix operation fails. Neither problem can be ruled out simply because “the image runs.” Before deploying an inference service on DGX Spark, build a small probe that requires no model downloads. Validate the architecture, GPU device injection, framework initialization and computation results in separate stages, so that an environment failure is not mistaken for a model problem.
1. Separate device visibility from successful computation
CGbps DGX Spark systems use NVIDIA GB10 Grace Blackwell, an ARM64 platform with 128GB of LPDDR5x unified memory shared by the CPU and GPU. Unified memory does not mean that applications automatically select the GPU, nor does it mean that a generic ARM64 image includes a working CUDA framework.
Validation should retain evidence at four layers: the host recognizes the device; the image has the correct architecture; the framework inside the container can initialize CUDA; and an actual computation completes with the correct result. Pass each layer before moving to the next. When an error occurs, change only the relevant layer rather than replacing the driver, image and application dependencies all at once.
A successful
nvidia-smirun is not proof of successful computation. It does not establish that the current Python environment has loaded the correct framework, or that a CUDA kernel has completed execution.
This article assumes NVIDIA DGX OS, Docker and an existing PyTorch image. It does not provide installation scripts. Run the commands in the same Bash session, using an account with the necessary permissions. Do not make the Docker socket writable by all users to work around permission problems.
2. Check the host and local image first
After payment, retrieve the address and credentials from the console, then connect over SSH. Record the host state before listing the local images:
uname -m
nvidia-smi
docker version
docker image ls --no-trunc
read -r -p 'Local PyTorch image reference: ' IMAGE
export IMAGE
docker image inspect "$IMAGE" \
--format '{{.Id}} {{.Os}}/{{.Architecture}}'
uname -m should report aarch64, and the image platform should be linux/arm64. Enter an existing image reference. If inspection fails, stop rather than continuing with the probes below. Archive the image ID instead of keeping only a tag that may later be overwritten. If the image came from a multi-architecture source, also record the digest and platform used when obtaining it.
ARM64 addresses only CPU instruction-set compatibility. The PyTorch build inside the image must also support the corresponding CUDA environment and the GB10 GPU architecture. Being able to import the module does not establish that this requirement is met.
If nvidia-smi fails on the host itself, save the error and open a support ticket through the console. Do not repeatedly try to install host drivers inside the container. CUDA user-space libraries in the container and the host driver belong to different layers; changing both makes the original failure harder to reconstruct.
3. Run a comparable computation in the same image
First check Docker's GPU injection path. Set the entrypoint explicitly so that the image's default entrypoint does not launch a model service:
docker run --rm --gpus all \
--entrypoint nvidia-smi "$IMAGE"
If Docker reports that it cannot select a GPU driver, focus on NVIDIA Container Toolkit and the runtime configuration. If it reports only that the command cannot be found, check the image and tool injection rather than concluding that the device is faulty.
Next, create the probe directory and script:
mkdir -p "$HOME/dgx-gpu-check"
cd "$HOME/dgx-gpu-check"
cat > gpu_probe.py <<'PY'
import json
import platform
import torch
if platform.machine() not in ("aarch64", "arm64"):
raise RuntimeError("Unexpected CPU architecture")
if not torch.cuda.is_available():
raise RuntimeError("CUDA is unavailable")
torch.backends.cuda.matmul.allow_tf32 = False
x = (torch.arange(4096, dtype=torch.float32) % 7 - 3).reshape(64, 64)
reference = x @ x.T
device_x = x.to("cuda")
device_result = device_x @ device_x.T
if device_result.device.type != "cuda":
raise RuntimeError("Result is not on CUDA")
torch.cuda.synchronize()
result = device_result.cpu()
if not torch.isfinite(result).all().item():
raise RuntimeError("Non-finite result")
torch.testing.assert_close(result, reference, rtol=1e-5, atol=1e-4)
print(json.dumps({
"torch": torch.__version__,
"cuda_build": torch.version.cuda,
"device": torch.cuda.get_device_name(0),
"capability": torch.cuda.get_device_capability(0),
"max_abs_error": (result - reference).abs().max().item(),
"status": "passed"
}, ensure_ascii=False))
PY
docker run --rm --gpus all \
--mount "type=bind,src=$PWD,dst=/probe,readonly" \
--entrypoint python3 "$IMAGE" /probe/gpu_probe.py \
> probe.json 2> probe.err
probe_status=$?
printf 'probe_exit=%s\n' "$probe_status"
cat probe.json
cat probe.err
The script constructs its input from fixed small integers. It does not depend on a random seed or download any weights. The CPU calculates a reference result first, then the GPU performs the matrix multiplication. Explicit synchronization exposes asynchronous computation errors during this check instead of leaving them to surface in a later request.
This validates the basic execution path, not performance. The matrix is too small to estimate model throughput, and the test does not prove that all quantization operators work. The exit code must be zero, and the output must contain passed. Keep any warnings written to standard error as well.
4. Hide the device to rule out silent fallback
A successful run alone is not enough. Run the same script again, hiding only the CUDA devices, to verify that it really depends on the GPU:
docker run --rm --gpus all \
-e CUDA_VISIBLE_DEVICES= \
--mount "type=bind,src=$PWD,dst=/probe,readonly" \
--entrypoint python3 "$IMAGE" /probe/gpu_probe.py \
> negative.out 2> negative.err
negative_status=$?
printf 'negative_exit=%s\n' "$negative_status"
cat negative.err
test "$negative_status" -ne 0
The expected result is a nonzero exit code and the message CUDA is unavailable. If the run fails because the script is missing, a module cannot be imported or the mount is denied, the negative test has not passed. Fix those problems first.
Both tests must use the same image ID, the same script and the same mount directory. Device visibility must be the only deliberate change. If both the normal test and the test with devices hidden succeed, the probe may be bypassing the GPU check, or the script being executed may not be the archived one.
The negative test neither uninstalls drivers nor modifies host devices. The environment variable ceases to apply when the container exits. There is no need to reboot the entire system to create a failure scenario.
5. Troubleshoot the failing layer before testing models
Handle common errors according to where they occur:
exec format error: check the entrypoint executable and image architecture first, rather than starting with CUDA parameters.No module named torch: inspect the Python path and image contents; do not classify this as a device injection failure.- CUDA unavailable: narrow down the cause using the host state, device visibility inside the container and framework build information.
no kernel image is available: focus on whether the framework binaries support the target GPU architecture.- Inconsistent results: pin down the image, inputs and precision settings before investigating differences in operators and runtime libraries.
Do not upgrade the entire environment in response to a single failure. Change one variable at a time, then rerun both the normal and negative tests. If the image changes, previous test results no longer apply. If the Python environment changes, record the framework version again.
Archive at least the host diagnostic output, image ID, probe file, both exit codes, standard output and standard error. Use sha256sum gpu_probe.py to record the script's checksum so that you can verify that the input has not changed when repeating the test.
Once basic validation passes, load the actual model and separately check the precision, attention implementation and quantization operators it uses. A successful matrix probe establishes only that the basic CUDA path works; it does not replace model-level correctness and capacity validation. Keep this small sequence of checks as a standard first step after image updates, so that “the device is visible” remains clearly distinct from “the application computes correctly.”
Frequently asked questions
Does a successful nvidia-smi command validate the inference environment?
No. It provides evidence of device and driver visibility. CUDA initialization, GPU-resident tensors, completed computation and comparison with a reference result are still required.
How should the probe exit when the GPU is hidden?
It should return a nonzero exit status and report that CUDA is unavailable. Success could indicate a silent CPU fallback, which invalidates the GPU execution check.
AMD EPYC 7543P Dedicated Server
From $455.2/month