Skip to content

Commit

Permalink
Support CUDA 12.6. (#286)
Browse files Browse the repository at this point in the history
I updated build.rs and Cargo.toml and ran the bindgen script.

Local testing mostly passed; all of the errors are the same, which is probably indicating that I still haven't set everything up correctly on my machine.

```

---- driver::safe::launch::tests::test_launch_with_views stdout ----
thread 'driver::safe::launch::tests::test_launch_with_views' panicked at src/lib.rs:98:5:
Unable to dynamically load the "cuda" shared library - searched for library names: ["cuda", "nvcuda"]. Ensure that `LD_LIBRARY_PATH` has the correct path to the installed library. If the shared library is present on the system under a different name than one of those listed above, please open a GitHub issue.

---- driver::safe::launch::tests::test_par_launch stdout ----
thread 'driver::safe::launch::tests::test_par_launch' panicked at src/lib.rs:98:5:
Unable to dynamically load the "cuda" shared library - searched for library names: ["cuda", "nvcuda"]. Ensure that `LD_LIBRARY_PATH` has the correct path to the installed library. If the shared library is present on the system under a different name than one of those listed above, please open a GitHub issue.

failures:
    cublas::safe::tests::test_dgemm
    cublas::safe::tests::test_dgemv
    cublas::safe::tests::test_sgemm
    cublas::safe::tests::test_sgemv
    cublaslt::safe::tests::test_matmul_f32
    cudnn::safe::tests::test_conv1d
    cudnn::safe::tests::test_conv2d_pick_algorithms
    cudnn::safe::tests::test_conv3d
    cudnn::safe::tests::test_create_descriptors
    cudnn::safe::tests::test_reduction
    curand::safe::tests::test_different_seeds_neq
    curand::safe::tests::test_log_normal_f32
    curand::safe::tests::test_log_normal_f64
    curand::safe::tests::test_normal_f32
    curand::safe::tests::test_normal_f64
    curand::safe::tests::test_rc_counts
    curand::safe::tests::test_seed_reproducible
    curand::safe::tests::test_set_offset
    curand::safe::tests::test_uniform_f32
    curand::safe::tests::test_uniform_f64
    curand::safe::tests::test_uniform_u32
    driver::safe::alloc::tests::test_copy_uses_correct_context
    driver::safe::alloc::tests::test_device_copy_to_views
    driver::safe::alloc::tests::test_leak_and_upgrade
    driver::safe::alloc::tests::test_post_alloc_arc_counts
    driver::safe::alloc::tests::test_post_build_arc_count
    driver::safe::alloc::tests::test_post_clone_arc_slice_counts
    driver::safe::alloc::tests::test_post_clone_counts
    driver::safe::alloc::tests::test_post_release_counts
    driver::safe::alloc::tests::test_post_take_arc_counts
    driver::safe::alloc::tests::test_slice_is_freed_with_correct_context
    driver::safe::core::tests::test_transmutes
    driver::safe::launch::tests::test_large_launches
    driver::safe::launch::tests::test_launch_with_16bit
    driver::safe::launch::tests::test_launch_with_32bit
    driver::safe::launch::tests::test_launch_with_64bit
    driver::safe::launch::tests::test_launch_with_8bit
    driver::safe::launch::tests::test_launch_with_floats
    driver::safe::launch::tests::test_launch_with_mut_and_ref_cudarc
    driver::safe::launch::tests::test_launch_with_views
    driver::safe::launch::tests::test_mut_into_kernel_param_no_inc_rc
    driver::safe::launch::tests::test_par_launch
    driver::safe::launch::tests::test_ref_into_kernel_param_inc_rc
    driver::safe::threading::tests::test_threading
    nccl::result::tests::multi_thread
    nccl::result::tests::single_thread
    nccl::safe::tests::test_all_reduce

test result: FAILED. 137 passed; 47 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.36s.
```
  • Loading branch information
paulstansifer authored Sep 5, 2024
1 parent 886d6d2 commit 3eaff86
Show file tree
Hide file tree
Showing 18 changed files with 51,300 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ keywords = [
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[package.metadata.docs.rs]
features = ["cuda-12050", "f16", "cudnn"]
features = ["cuda-12060", "f16", "cudnn"]

[features]
default = ["std", "cublas", "cublaslt", "curand", "driver", "nvrtc"]
Expand All @@ -38,6 +38,7 @@ cuda-12020 = []
cuda-12030 = []
cuda-12040 = []
cuda-12050 = []
cuda-12060 = []

dynamic-linking = []

Expand Down
7 changes: 5 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ fn main() {
println!("cargo:rerun-if-env-changed=CUDA_PATH");
println!("cargo:rerun-if-env-changed=CUDA_TOOLKIT_ROOT_DIR");

let (major, minor): (usize, usize) = if cfg!(feature = "cuda-12050") {
let (major, minor): (usize, usize) = if cfg!(feature = "cuda-12060") {
(12, 6)
} else if cfg!(feature = "cuda-12050") {
(12, 5)
} else if cfg!(feature = "cuda-12040") {
(12, 4)
Expand All @@ -30,7 +32,7 @@ fn main() {
(11, 4)
} else {
#[cfg(not(feature = "cuda-version-from-build-system"))]
panic!("Must specify one of the following features: [cuda-version-from-build-system, cuda-12050, cuda-12040, cuda-12030, cuda-12020, cuda-12010, cuda-12000, cuda-11080, cuda-11070, cuda-11060, cuda-11050, cuda-11040]");
panic!("Must specify one of the following features: [cuda-version-from-build-system, cuda-12060, cuda-12050, cuda-12040, cuda-12030, cuda-12020, cuda-12010, cuda-12000, cuda-11080, cuda-11070, cuda-11060, cuda-11050, cuda-11040]");

#[cfg(feature = "cuda-version-from-build-system")]
{
Expand Down Expand Up @@ -68,6 +70,7 @@ fn cuda_version_from_build_system() -> (usize, usize) {
let version_number = release_section.split(' ').nth(1).unwrap();

match version_number {
"12.6" => (12, 6),
"12.5" => (12, 5),
"12.4" => (12, 4),
"12.3" => (12, 3),
Expand Down
5 changes: 5 additions & 0 deletions src/cublas/sys/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ mod sys_12050;
#[cfg(feature = "cuda-12050")]
pub use sys_12050::*;

#[cfg(feature = "cuda-12060")]
mod sys_12060;
#[cfg(feature = "cuda-12060")]
pub use sys_12060::*;

pub unsafe fn lib() -> &'static Lib {
static LIB: std::sync::OnceLock<Lib> = std::sync::OnceLock::new();
LIB.get_or_init(|| {
Expand Down
Loading

0 comments on commit 3eaff86

Please sign in to comment.