SKY-GPU002 · Deployment and infrastructure
CUDA build leaves out a target GPU's architecture
CUDA code is compiled for specific GPU architectures, named by compute capability (7.5 for a T4, 8.6 for an A10G). SKY-GPU002 reports a build whose architecture list neither compiles for a target's compute capability nor ships PTX, the portable form the driver can compile for newer GPUs.
- Languages
- CMake, Makefile, Bazel, shell, Python build scripts, GPU target contract (YAML)
- Quality gate
- counted toward the gate limits (full and diff scans). Reported under reliability. It counts toward
max_reliability, which is 0 by default, so one finding fails--gate. - Needs
- A
.skylos/gpu-targets.ymlcontract in the repository. - Finding type
- review
- Catalog name
- CUDA target architecture missing from build
Why it matters
On the missing GPU the kernels fail to load with "no kernel image is available for execution on the device". The build and tests pass on the developer's GPU, so the break only shows up in production.
What Skylos flags
cmake_minimum_required(VERSION 3.24)project(kernels LANGUAGES CXX CUDA)set(CMAKE_CUDA_ARCHITECTURES 75-real)add_library(kernels SHARED src/kernels.cu)version: 1targets: - name: inference-a10g vendor: nvidia compute_capability: "8.6"What Skylos leaves alone
cmake_minimum_required(VERSION 3.24)project(kernels LANGUAGES CXX CUDA)set(CMAKE_CUDA_ARCHITECTURES 75)add_library(kernels SHARED src/kernels.cu)Why Skylos leaves it alone
Without the -real suffix, CMake builds both machine code for 7.5 and PTX for 7.5. The driver can compile that PTX for the newer 8.6 GPU, so the target is covered.
How Skylos decides
- Runs with
--danger(or-a), and only when the repository has a GPU target contract:.skylos/gpu-targets.yml(or.yaml), version 1, listing each target'sname,vendor: nvidia, and itsdriver,compute_capabilityandplatform(linuxorwindows, optionally/amd64or/arm64). Without the file nothing is checked, unless anSKY-GPUrule is selected explicitly with--select. - Reads Dockerfiles, CMake files, Makefiles, Bazel files, shell scripts, Python, C/C++/CUDA sources and YAML as text, skipping
build,dist,node_modules, caches and virtual environments. It never runs a build or probes a GPU. - Reads
CMAKE_CUDA_ARCHITECTURES,TORCH_CUDA_ARCH_LIST,nvcc -arch/--gpu-architectureand-gencodesettings. - Tells machine code (SASS) from PTX: a plain CMake number gives both,
-realgives only machine code,-virtualonly PTX. Machine code covers GPUs of the same major family at or above its version; PTX covers equal or newer GPUs. - Text in
echolines and quoted examples is not build evidence. Dynamic or conditional values,native, and several files that each set architectures are reported as SKY-GPU000 instead. - Reports HIGH on the architecture line, naming the uncovered targets.
How to fix it
Add the missing architecture (75-real 86-real) or keep a PTX entry that covers it (75, or 75-real 86).
cmake_minimum_required(VERSION 3.24)project(kernels LANGUAGES CXX CUDA)Removed: set(CMAKE_CUDA_ARCHITECTURES 75-real)Added: set(CMAKE_CUDA_ARCHITECTURES 75-real 86)add_library(kernels SHARED src/kernels.cu)When it can be wrong
- PTX that is compiled at load time on the newer GPU is counted as coverage, even though the first start is slower.
Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.
How to silence it
Put the marker in a comment on the architecture line or the line above it.
CMake set(CMAKE_CUDA_ARCHITECTURES 75-real) # skylos: ignore[SKY-GPU002] A10G separate[tool.skylos] ignore = ["SKY-GPU002"]turns the rule off for the project.A baseline (
skylos baseline ., then--baseline) accepts the findings that exist today and reports new ones.