Skip to main content

SKY-GPU002 · Deployment and infrastructure

CUDA build leaves out a target GPU's architecture

High

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.yml contract in the repository.
Finding type
review
Catalog name
CUDA target architecture missing from build
Wrong result? Report itA false positive, a missed case or a confusing message: it goes privately to the founder.

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

CMakeLists.txt · CMakeReported on line 3
cmake_minimum_required(VERSION 3.24)project(kernels LANGUAGES CXX CUDA)set(CMAKE_CUDA_ARCHITECTURES 75-real)add_library(kernels SHARED src/kernels.cu)
.skylos/gpu-targets.yml · YAML
version: 1targets:  - name: inference-a10g    vendor: nvidia    compute_capability: "8.6"

What Skylos leaves alone

CMakeLists.txt · CMake
cmake_minimum_required(VERSION 3.24)project(kernels LANGUAGES CXX CUDA)set(CMAKE_CUDA_ARCHITECTURES 75)add_library(kernels SHARED src/kernels.cu)

.skylos/gpu-targets.yml: same as in the flagged example.

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

  1. 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's name, vendor: nvidia, and its driver, compute_capability and platform (linux or windows, optionally /amd64 or /arm64). Without the file nothing is checked, unless an SKY-GPU rule is selected explicitly with --select.
  2. 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.
  3. Reads CMAKE_CUDA_ARCHITECTURES, TORCH_CUDA_ARCH_LIST, nvcc -arch/--gpu-architecture and -gencode settings.
  4. Tells machine code (SASS) from PTX: a plain CMake number gives both, -real gives only machine code, -virtual only PTX. Machine code covers GPUs of the same major family at or above its version; PTX covers equal or newer GPUs.
  5. Text in echo lines 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.
  6. 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).

CMakeLists.txt · CMake · the fix, against the flagged file
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.

From the Skylos rule handbook, Skylos 5.8.0 (commit 5b880b0). All rules.