Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix and update sccache for CUDA 12.8 #2324

Merged
merged 3 commits into from
Feb 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/nvcc-toolchain/install-cuda.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Param(
[Parameter(Mandatory=$false)]
[string]
$cudaVersion="12.6.0"
$cudaVersion="12.8.0"
)

# Use System.Version to tokenize version
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ jobs:
cuda: "11.8"
extra_desc: cuda11.8
- os: ubuntu-24.04
cuda: "12.6"
cuda: "12.8"
# Oldest supported version, keep in sync with README.md
rustc: "1.75.0"
extra_desc: cuda12.6
extra_desc: cuda12.8
- os: macos-13
# # M1 CPU
- os: macos-14
Expand All @@ -117,21 +117,21 @@ jobs:
rustc: beta
extra_desc: cuda11.8
- os: windows-2022
cuda: "12.6"
cuda: "12.8"
# Oldest supported version, keep in sync with README.md
rustc: "1.75.0"
extra_args: --no-fail-fast
extra_desc: cuda12.6
extra_desc: cuda12.8
- os: windows-2022
cuda: "12.6"
cuda: "12.8"
rustc: nightly
allow_failure: true
extra_args: --features=unstable
extra_desc: cuda12.6
extra_desc: cuda12.8
- os: windows-2022
cuda: "12.6"
cuda: "12.8"
rustc: beta
extra_desc: cuda12.6
extra_desc: cuda12.8
env:
RUST_BACKTRACE: 1
steps:
Expand Down
38 changes: 19 additions & 19 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it isn't clear to me why this change?

Copy link
Contributor Author

@trxcllnt trxcllnt Feb 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When GitHub updates ubuntu-latest to 26.04 next year, the integration tests will start failing again in the same way as here until the HIP job is updated to rocm/dev-ubuntu-26.04.

It will stay broken until a new version is published (or we switch images). This lets us update on our schedule while keeping keep CI green. Since we have to update this file in both cases, I chose the option where jobs don't start mysteriously failing due to GitHub changes.

steps:
- name: Clone repository
uses: actions/checkout@v4
Expand All @@ -28,7 +28,7 @@ jobs:
path: ./target/debug/sccache

redis-deprecated:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: build

services:
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
${SCCACHE_PATH} --show-stats | grep -e "Cache hits\s*[1-9]"
redis:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: build

services:
Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:
${SCCACHE_PATH} --show-stats | grep -e "Cache hits\s*[1-9]"
s3_minio:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: build

# Setup minio server
Expand Down Expand Up @@ -184,7 +184,7 @@ jobs:
${SCCACHE_PATH} --show-stats | grep -e "Cache hits\s*[1-9]"
azblob_azurite:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: build

# Setup azurite server
Expand Down Expand Up @@ -240,7 +240,7 @@ jobs:
${SCCACHE_PATH} --show-stats | grep -e "Cache hits\s*[1-9]"
gha:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: build

env:
Expand Down Expand Up @@ -289,7 +289,7 @@ jobs:
${SCCACHE_PATH} --show-stats | grep -e "Cache hits\s*[1-9]"
memcached-deprecated:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: build

# Setup memcached server
Expand Down Expand Up @@ -344,7 +344,7 @@ jobs:
${SCCACHE_PATH} --show-stats | grep -e "Cache hits\s*[1-9]"
memcached:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: build

# Setup memcached server
Expand Down Expand Up @@ -399,7 +399,7 @@ jobs:
${SCCACHE_PATH} --show-stats | grep -e "Cache hits\s*[1-9]"
webdav:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: build

env:
Expand Down Expand Up @@ -455,7 +455,7 @@ jobs:
env:
TARGET: x86_64-pc-windows-msvc
SCCACHE_EXE: ${{ github.workspace }}\\target\\x86_64-pc-windows-msvc\\debug\\sccache.exe
SCCACHE_LOG: "trace"
SCCACHE_LOG: "debug"
SCCACHE_ERROR_LOG: "${{ github.workspace }}\\server_log.txt"

steps:
Expand All @@ -471,7 +471,7 @@ jobs:
target: $TARGET

- name: Build
run: cargo build --bin sccache --target $env:TARGET --features=openssl/vendored
run: cargo build --bin sccache --target $env:TARGET --features=vendored-openssl

- name: Compile MSVC (no cache)
shell: bash
Expand Down Expand Up @@ -524,7 +524,7 @@ jobs:
run: cat "$SCCACHE_ERROR_LOG"

clang:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: build

env:
Expand Down Expand Up @@ -578,10 +578,10 @@ jobs:
hip:
# Probably wouldn't matter anyway since we run in a container, but staying
# close to the version is better than not.
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
needs: build
container:
image: rocm/dev-ubuntu-22.04:6.0
image: rocm/dev-ubuntu-24.04:6.3

env:
# SCCACHE_GHA_ENABLED: "on"
Expand Down Expand Up @@ -647,7 +647,7 @@ jobs:
${SCCACHE_PATH} --show-stats | grep -e "Cache hits\s*[1-9]"
gcc:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: build

env:
Expand Down Expand Up @@ -692,7 +692,7 @@ jobs:
${SCCACHE_PATH} --show-stats | grep -e "Cache hits\s*[1-9]"
autotools:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: build

env:
Expand Down Expand Up @@ -748,7 +748,7 @@ jobs:
${SCCACHE_PATH} --show-stats | grep -e "Cache hits\s*[1-9]"
cmake:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: build

env:
Expand Down Expand Up @@ -807,7 +807,7 @@ jobs:
# The test cargo "cargo build -Zprofile"
rust-test-Z-profile:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: build

env:
Expand Down Expand Up @@ -853,7 +853,7 @@ jobs:
${SCCACHE_PATH} --show-stats | grep -e "Cache hits\s*[1-9]"
zstd-compression-level:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: build

env:
Expand Down
18 changes: 6 additions & 12 deletions src/compiler/c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ pub enum CCompilerKind {
Msvc,
/// NVIDIA CUDA compiler
Nvcc,
/// NVIDIA CUDA front-end
CudaFE,
/// NVIDIA CUDA optimizer and PTX generator
Cicc,
/// NVIDIA CUDA PTX assembler
Expand Down Expand Up @@ -1385,18 +1387,10 @@ impl pkg::ToolchainPackager for CToolchainPackager {
add_named_file(&mut package_builder, "liblto_plugin.so")?;
}

CCompilerKind::Cicc => {}

CCompilerKind::Ptxas => {}

CCompilerKind::Nvcc => {
// Various programs called by the nvcc front end.
// presumes the underlying host compiler is consistent
add_named_file(&mut package_builder, "cudafe++")?;
add_named_file(&mut package_builder, "fatbinary")?;
add_named_prog(&mut package_builder, "nvlink")?;
add_named_prog(&mut package_builder, "ptxas")?;
}
CCompilerKind::Cicc
| CCompilerKind::CudaFE
| CCompilerKind::Ptxas
| CCompilerKind::Nvcc => {}

CCompilerKind::Nvhpc => {
// Various programs called by the nvc nvc++ front end.
Expand Down
30 changes: 17 additions & 13 deletions src/compiler/cicc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl CCompilerImpl for Cicc {
cwd: &Path,
_env_vars: &[(OsString, OsString)],
) -> CompilerArguments<ParsedArguments> {
parse_arguments(arguments, cwd, Language::Ptx, &ARGS[..])
parse_arguments(arguments, cwd, Language::Ptx, &ARGS[..], 3)
}
#[allow(clippy::too_many_arguments)]
async fn preprocess<T>(
Expand Down Expand Up @@ -106,12 +106,13 @@ pub fn parse_arguments<S>(
cwd: &Path,
language: Language,
arg_info: S,
input_arg_offset_from_end: usize,
) -> CompilerArguments<ParsedArguments>
where
S: SearchableArgInfo<ArgData>,
{
let mut args = arguments.to_vec();
let input_loc = arguments.len() - 3;
let input_loc = arguments.len() - input_arg_offset_from_end;
let input = args.splice(input_loc..input_loc + 1, []).next().unwrap();

let mut take_next = false;
Expand Down Expand Up @@ -143,14 +144,18 @@ where
);
continue;
}
Some(UnhashedGenModuleIdFileFlag) => {
Some(GenModuleIdFileFlag) => {
take_next = false;
gen_module_id_file = true;
&mut unhashed_args
&mut common_args
}
Some(UnhashedModuleIdFileName(o)) => {
Some(ModuleIdFileName(o)) => {
take_next = false;
module_id_file_name = Some(cwd.join(o));
&mut common_args
}
Some(UnhashedPassThrough(o)) => {
take_next = false;
&mut unhashed_args
}
Some(UnhashedOutput(o)) => {
Expand Down Expand Up @@ -220,8 +225,8 @@ where
common_args,
arch_args: vec![],
unhashed_args,
extra_dist_files,
extra_hash_files: vec![],
extra_dist_files: extra_dist_files.clone(),
extra_hash_files: extra_dist_files,
msvc_show_includes: false,
profile_generate: false,
color_mode: ColorMode::Off,
Expand Down Expand Up @@ -263,8 +268,6 @@ pub fn generate_compile_commands(
let _ = path_transformer;
}

trace!("compile");

let lang_str = &parsed_args.language.as_str();
let out_file = match parsed_args.outputs.get("obj") {
Some(obj) => &obj.path,
Expand Down Expand Up @@ -329,8 +332,9 @@ ArgData! { pub
Output(PathBuf),
PassThrough(OsString),
UnhashedFlag,
UnhashedGenModuleIdFileFlag,
UnhashedModuleIdFileName(PathBuf),
GenModuleIdFileFlag,
ModuleIdFileName(PathBuf),
UnhashedPassThrough(OsString),
UnhashedOutput(PathBuf),
}

Expand All @@ -339,9 +343,9 @@ use self::ArgData::*;
counted_array!(pub static ARGS: [ArgInfo<ArgData>; _] = [
take_arg!("--gen_c_file_name", PathBuf, Separated, UnhashedOutput),
take_arg!("--gen_device_file_name", PathBuf, Separated, UnhashedOutput),
flag!("--gen_module_id_file", UnhashedGenModuleIdFileFlag),
flag!("--gen_module_id_file", GenModuleIdFileFlag),
take_arg!("--include_file_name", OsString, Separated, PassThrough),
take_arg!("--module_id_file_name", PathBuf, Separated, UnhashedModuleIdFileName),
take_arg!("--module_id_file_name", PathBuf, Separated, ModuleIdFileName),
take_arg!("--stub_file_name", PathBuf, Separated, UnhashedOutput),
take_arg!("-o", PathBuf, Separated, Output),
]);
1 change: 1 addition & 0 deletions src/compiler/clang.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ pub fn language_to_clang_arg(lang: Language) -> Option<&'static str> {
Language::ObjectiveCxx => Some("objective-c++"),
Language::ObjectiveCxxHeader => Some("objective-c++-header"),
Language::Cuda => Some("cuda"),
Language::CudaFE => None,
Language::Ptx => None,
Language::Cubin => None,
Language::Rust => None, // Let the compiler decide
Expand Down
Loading
Loading