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

Add Blackwell to DeviceArchitecture enum #70

Merged
merged 1 commit into from
Feb 14, 2025
Merged
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: 2 additions & 0 deletions nvml-wrapper-sys/nvml.h
Original file line number Diff line number Diff line change
@@ -1439,6 +1439,8 @@ typedef struct nvmlGridLicensableFeatures_st

#define NVML_DEVICE_ARCH_HOPPER 9 // Devices based on the NVIDIA Hopper architecture

#define NVML_DEVICE_ARCH_BLACKWELL 10 // Devices based on the NVIDIA Blackwell architecture

#define NVML_DEVICE_ARCH_UNKNOWN 0xffffffff // Anything else, presumably something newer

typedef unsigned int nvmlDeviceArchitecture_t;
1 change: 1 addition & 0 deletions nvml-wrapper-sys/src/bindings.rs
Original file line number Diff line number Diff line change
@@ -58,6 +58,7 @@ pub const NVML_DEVICE_ARCH_TURING: u32 = 6;
pub const NVML_DEVICE_ARCH_AMPERE: u32 = 7;
pub const NVML_DEVICE_ARCH_ADA: u32 = 8;
pub const NVML_DEVICE_ARCH_HOPPER: u32 = 9;
pub const NVML_DEVICE_ARCH_BLACKWELL: u32 = 10;
pub const NVML_DEVICE_ARCH_UNKNOWN: u32 = 4294967295;
pub const NVML_BUS_TYPE_UNKNOWN: u32 = 0;
pub const NVML_BUS_TYPE_PCI: u32 = 1;
5 changes: 5 additions & 0 deletions nvml-wrapper/src/enums/device.rs
Original file line number Diff line number Diff line change
@@ -225,6 +225,8 @@ pub enum DeviceArchitecture {
Ada,
/// <https://en.wikipedia.org/wiki/Hopper_(microarchitecture)>
Hopper,
/// https://en.wikipedia.org/wiki/Blackwell_(microarchitecture)
Blackwell,
/// Unknown device architecture (most likely something newer).
Unknown,
}
@@ -241,6 +243,7 @@ impl DeviceArchitecture {
Self::Ampere => NVML_DEVICE_ARCH_AMPERE,
Self::Ada => NVML_DEVICE_ARCH_ADA,
Self::Hopper => NVML_DEVICE_ARCH_HOPPER,
Self::Blackwell => NVML_DEVICE_ARCH_BLACKWELL,
Self::Unknown => NVML_DEVICE_ARCH_UNKNOWN,
}
}
@@ -259,6 +262,7 @@ impl TryFrom<nvmlDeviceArchitecture_t> for DeviceArchitecture {
NVML_DEVICE_ARCH_AMPERE => Ok(Self::Ampere),
NVML_DEVICE_ARCH_ADA => Ok(Self::Ada),
NVML_DEVICE_ARCH_HOPPER => Ok(Self::Hopper),
NVML_DEVICE_ARCH_BLACKWELL => Ok(Self::Blackwell),
NVML_DEVICE_ARCH_UNKNOWN => Ok(Self::Unknown),
_ => Err(NvmlError::UnexpectedVariant(data)),
}
@@ -276,6 +280,7 @@ impl Display for DeviceArchitecture {
Self::Ampere => f.write_str("Ampere"),
Self::Ada => f.write_str("Ada"),
Self::Hopper => f.write_str("Hopper"),
Self::Blackwell => f.write_str("Blackwell"),
Self::Unknown => f.write_str("Unknown"),
}
}
Loading