You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Use hipconfig to get the ROCm and HIP installation paths
* Simplify HIP version detection by using hipconfig as source of truth
* Rename build_script.rs to hipconfig.rs
Copy file name to clipboardExpand all lines: README.md
+40-67Lines changed: 40 additions & 67 deletions
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@
14
14
<br/>
15
15
</div>
16
16
17
-
This repository contains Rust bindings for AMD ROCm HIP runtime libraries used by CubeCL.
17
+
This repository contains Rust bindings for AMD ROCm HIP runtime libraries (hiprtc, amdhip64) used by CubeCL.
18
18
19
19
## ⚠️ Notes
20
20
These bindings are unsafe as they are just the raw bindings generated by bindgen with no improvements.
@@ -26,107 +26,79 @@ These bindings are unsafe as they are just the raw bindings generated by bindgen
26
26
27
27
## Prerequisites
28
28
29
-
Install ROCm in the default directory under `/opt`following the [ROCm documentation][1]:
29
+
Install ROCm following the [ROCm documentation][1]:
30
30
31
31
## Versioning Scheme
32
32
33
-
The crates in this repository follow the versioning conventions outlined below:
34
-
- The latest supported ROCm version of the crates is used as the base version.
35
-
- The patch version of the ROCm release is multiplied by 1000, allowing multiple revisions of a crate for the same ROCm version.
33
+
The crates in this repository follow the same versioning as HIP. Note that HIP version is somewhat different than ROCm version.
34
+
The patch number of HIP version is a monotonic number that uniquely indentify the version of HIP.
36
35
37
-
### Example:
36
+
This versioning scheme is in place as of May 2025, any previous version of this crate followed a different versioning scheme based
37
+
on ROCm version instead of HIP.
38
38
39
-
The `cubecl-hip-sys` version `6.2.4000` represents the first release with ROCm `6.2.4`.
40
-
If a fix is required and the ROCm version remains `6.2.4`, the `cubecl-hip-sys` version is incremented to `6.2.4001`.
39
+
Note also that multiple versions of ROCm can ship the same version of HIP.
41
40
42
-
##Usage
41
+
### Example:
43
42
44
-
Add the crate [cubecl-hip-sys][2] to the `Cargo.toml` file of your project and enable the feature
45
-
corresponding to the version of ROCm you have installed.
43
+
The `cubecl-hip-sys` version `6.4.43482` represents the HIP with the same version `6.4.43482`.
46
44
47
-
If no feature is provided then the build script will attempt to find the default ROCm version installed on your system.
48
-
Read the `warning` messages in the build output to learn about the script behavior.
45
+
## Usage
49
46
50
-
```toml
51
-
cubecl-hip-sys = { version = "6.3.1000", features = ["rocm__6_3_1"] }
52
-
```
47
+
Add the crate [cubecl-hip-sys][2] to the `Cargo.toml` file of your project. If no feature is set then cargo will select the HIP
48
+
version returned by the `hipconfig` utility.
53
49
54
-
If you installed a newer ROCm version that is not yet supported by this crate then read the next section to learn
55
-
how to generate and submit new bindings for your version.
50
+
To specify a different version of HIP manually set the environment variable HIP_PATH to a valid HIP installation path. You can
51
+
verify that your system points to the expected version with the command `hipconfig --version`.
56
52
57
-
Next you need to point out where you installed ROCm so that `rustc` can link to your ROCM libraries. To do so set the variable `ROCM_PATH`, or `HIP_PATH` or the more specific `CUBECL_ROCM_PATH`to its
58
-
installation base directory, it is often `/opt/rocm`.
53
+
Remark: Don't set manually the `hip_xxx` feature for this crate. This is the responsibility of the `build.rs` script to set it
54
+
accordingly to your `hipconfig` output.
59
55
60
56
Here is the table of currently available bindings:
61
57
62
-
| ROCm Version | Feature | Crates |
63
-
|:-------------|:------------|:---------------|
64
-
| 6.2.2 | rocm__6_2_2 | cubecl-hip-sys |
65
-
| 6.2.4 | rocm__6_2_4 | cubecl-hip-sys |
66
-
| 6.3.0 | rocm__6_3_0 | cubecl-hip-sys |
67
-
| 6.3.1 | rocm__6_3_1 | cubecl-hip-sys |
68
-
| 6.3.2 | rocm__6_3_2 | cubecl-hip-sys |
69
-
| 6.3.3 | rocm__6_3_3 | cubecl-hip-sys |
70
-
| 6.3.4 | rocm__6_3_4 | cubecl-hip-sys |
71
-
| 6.4.0 | rocm__6_4_0 | cubecl-hip-sys |
72
-
73
-
Here is a table of the libraries covered by each crate:
74
-
75
-
| Crate | ROCm libraries |
76
-
|:---------------|:-----------------|
77
-
| cubecl-hip-sys | hiprtc, amdhip64 |
58
+
| HIP Version | Corresponding ROCm Version Range |
0 commit comments