Skip to content

[rocPRIM] Warn/Prevent rocPRIM benchmarks from being built on Windows - #5494

Merged
umfranzw merged 1 commit into
developfrom
users/umfranzw/disable_rocprim_windows_benchmarks
Mar 17, 2026
Merged

umfranzw merged 1 commit into
developfrom
users/umfranzw/disable_rocprim_windows_benchmarks

Conversation

@umfranzw

Copy link
Copy Markdown
Contributor

Motivation

Users who attempt to build benchmarks on Windows see built errors related to amdsmi.

Technical Details

rocPRIM benchmarks can no longer be built on Windows because of primbench's dependency on AMD SMI, which is Linux-only.
This change:

  • Adds a CMake-level fatal warning to alert users of this before they hit build errors.
  • Modifies the rmake.py script to prevent BUILD_BENCHMARK from being set to ON when the --clients option is passed.

Test Plan

Attempt to build rocPRIM with benchmarks enabled on Windows.
Can also try this by using rmake.py and passing the --clients option.

Test Result

CMake-level errors and rmake.py changes work as expected.

Submission Checklist

rocPRIM benchmarks can no longer be built on Windows because of
primbench's dependency on AMD SMI, which is Linux-only.

Add a CMake-level fatal warning to alert users of this before they
hit build errors.

Modify the rmake.py script to prevent BUILD_BENCHMARK from being
set to ON when the --clients option is passed.

@stanleytsang-amd stanleytsang-amd left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yikes, big oversight on our part.

@MyNameIsTrez @Naraenda

Is it possible engineer a Windows-only cut down version of primbench which does not rely on amdsmi-specific functionality (and thus sadly lose all the cool features like temperature monitoring/management, etc..)

I'll talk to the amd-smi team to see if Windows support for the C++ API is anywhere on the roadmap.

@MyNameIsTrez

MyNameIsTrez commented Mar 16, 2026 •

Copy link
Copy Markdown
Contributor

@stanleytsang-amd Apologies for not catching this mistake in Stream HPC's CI either, as our Windows job was broken too at the time.

I'll ask Nara for her thoughts on this tomorrow, but I think I'll create a PR tomorrow which turns AMD SMI into a soft dependency, rather than doing something Windows-specific.

The main reason that I didn't want to make it a soft dependency originally is because it inherently opens the door to people comparing 50°C GPU throughput measurements with 100°C GPU measurements, which are of course not comparable due to GPUs throttling themselves at high temperatures.

I'll talk to the amd-smi team to see if Windows support for the C++ API is anywhere on the roadmap.

I may be misinterpreting ROCm 6.2.4 its ROCm component support page, but its "System Management" row seems to suggest that amdsmi was supported on Windows in the past.
Compare this to the HIP SDK for Windows 7.1.1 its ROCm components supported in HIP SDK page, which has removed amdsmi from the "System Management" row.
So yes, I am very interested in whether AMD SMI's C++ API for Windows is just on a temporary hiatus, or gone forever.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

❌ Your project status has failed because the head coverage (77.21%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5494      +/-   ##
===========================================
- Coverage    66.57%   64.28%   -2.29%     
===========================================
  Files         1836     1988     +152     
  Lines       282885   308577   +25692     
  Branches     39734    40301     +567     
===========================================
+ Hits        188308   198339   +10031     
- Misses       78211    93495   +15284     
- Partials     16366    16743     +377     
Flag Coverage Δ *Carryforward flag
hipBLAS 90.67% <ø> (ø) Carriedforward from 3b34060
hipBLASLt 43.55% <ø> (ø) Carriedforward from 3b34060
hipCUB 82.38% <ø> (ø) Carriedforward from 3b34060
hipDNN 85.00% <ø> (ø) Carriedforward from 3b34060
hipFFT 56.36% <ø> (ø) Carriedforward from 3b34060
hipRAND 76.12% <ø> (ø) Carriedforward from 3b34060
hipSOLVER 68.81% <ø> (ø) Carriedforward from 3b34060
hipSPARSE 84.70% <ø> (ø) Carriedforward from 3b34060
rocBLAS 47.97% <ø> (ø) Carriedforward from 3b34060
rocFFT 47.37% <ø> (ø) Carriedforward from 3b34060
rocPRIM 39.04% <ø> (?)
rocRAND 57.07% <ø> (ø) Carriedforward from 3b34060
rocSOLVER 77.21% <ø> (ø) Carriedforward from 3b34060
rocSPARSE 71.48% <ø> (ø) Carriedforward from 3b34060

*This pull request uses carry forward flags. Click here to find out more.
see 152 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@umfranzw
umfranzw merged commit ffdccf6 into develop Mar 17, 2026
19 of 21 checks passed
@umfranzw
umfranzw deleted the users/umfranzw/disable_rocprim_windows_benchmarks branch March 17, 2026 00:56
assistant-librarian Bot pushed a commit to ROCm/rocPRIM that referenced this pull request Mar 17, 2026
[rocPRIM] Warn/Prevent rocPRIM benchmarks from being built on
 Windows (#5494)

## Motivation

Users who attempt to build benchmarks on Windows see built errors
related to amdsmi.

## Technical Details

rocPRIM benchmarks can no longer be built on Windows because of
primbench's dependency on AMD SMI, which is Linux-only.
This change:
- Adds a CMake-level fatal warning to alert users of this before they
hit build errors.
- Modifies the rmake.py script to prevent BUILD_BENCHMARK from being set
to ON when the --clients option is passed.

## Test Plan

Attempt to build rocPRIM with benchmarks enabled on Windows.
Can also try this by using `rmake.py` and passing the `--clients`
option.

## Test Result

CMake-level errors and rmake.py changes work as expected.

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
@stanleytsang-amd

stanleytsang-amd commented Mar 17, 2026 •

Copy link
Copy Markdown
Contributor

@stanleytsang-amd Apologies for not catching this mistake in Stream HPC's CI either, as our Windows job was broken too at the time.

I'll ask Nara for her thoughts on this tomorrow, but I think I'll create a PR tomorrow which turns AMD SMI into a soft dependency, rather than doing something Windows-specific.

I'm fine either way.

The main reason that I didn't want to make it a soft dependency originally is because it inherently opens the door to people comparing 50°C GPU throughput measurements with 100°C GPU measurements, which are of course not comparable due to GPUs throttling themselves at high temperatures.

That's a good point. We should make the effort to document this or warn the user at runtime about any kind of comparisons when not using amd-smi.

I'll talk to the amd-smi team to see if Windows support for the C++ API is anywhere on the roadmap.

I may be misinterpreting ROCm 6.2.4 its ROCm component support page, but its "System Management" row seems to suggest that amdsmi was supported on Windows in the past. Compare this to the HIP SDK for Windows 7.1.1 its ROCm components supported in HIP SDK page, which has removed amdsmi from the "System Management" row. So yes, I am very interested in whether AMD SMI's C++ API for Windows is just on a temporary hiatus, or gone forever.

I just spoke with the PM of amdsmi. As far as the C++ API goes, there has been a plan, but it is stalled at several stages. The only way to make it a priority is if there was a customer need that makes development worth it for the driver teams. I'm not sure if primbench qualifies, but I'll ask around.

@MyNameIsTrez

MyNameIsTrez commented Mar 17, 2026 •

Copy link
Copy Markdown
Contributor

@stanleytsang-amd Thanks for the details!

Since I already largely decoupled AMD SMI from primbench as a side-effect of introducing CUDA support, I'll create a PR for that as soon as possible. I'll then create a small followup PR which turns both AMD SMI (HIP) and NVML (CUDA) into soft dependencies, which will require the former PR to be merged first.

At Stream HPC we only run the benchmarks on Linux (rather than Windows), so at least for us it isn't important to have AMD SMI its C++ API reintroduced for Windows. I presume the same goes for AMD's CI?

umfranzw added a commit that referenced this pull request Mar 17, 2026
…#5494)

Users who attempt to build benchmarks on Windows see built errors
related to amdsmi.

rocPRIM benchmarks can no longer be built on Windows because of
primbench's dependency on AMD SMI, which is Linux-only.
This change:
- Adds a CMake-level fatal warning to alert users of this before they
hit build errors.
- Modifies the rmake.py script to prevent BUILD_BENCHMARK from being set
to ON when the --clients option is passed.

Attempt to build rocPRIM with benchmarks enabled on Windows.
Can also try this by using `rmake.py` and passing the `--clients`
option.

CMake-level errors and rmake.py changes work as expected.

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
@stanleytsang-amd

Copy link
Copy Markdown
Contributor

@stanleytsang-amd Thanks for the details!

Since I already largely decoupled AMD SMI from primbench as a side-effect of introducing CUDA support, I'll create a PR for that as soon as possible. I'll then create a small followup PR which turns both AMD SMI (HIP) and NVML (CUDA) into soft dependencies, which will require the former PR to be merged first.

At Stream HPC we only run the benchmarks on Linux (rather than Windows), so at least for us it isn't important to have AMD SMI its C++ API reintroduced for Windows. I presume the same goes for AMD's CI?

I believe TheRock Windows CI does build and run the benchmarks by default to check that it at least builds and executes properly, but does not actively track the performance numbers.

jovanau pushed a commit to jovanau/rocm-libraries that referenced this pull request Mar 19, 2026
…ROCm#5494)

## Motivation

Users who attempt to build benchmarks on Windows see built errors
related to amdsmi.

## Technical Details

rocPRIM benchmarks can no longer be built on Windows because of
primbench's dependency on AMD SMI, which is Linux-only.
This change:
- Adds a CMake-level fatal warning to alert users of this before they
hit build errors.
- Modifies the rmake.py script to prevent BUILD_BENCHMARK from being set
to ON when the --clients option is passed.

## Test Plan

Attempt to build rocPRIM with benchmarks enabled on Windows.
Can also try this by using `rmake.py` and passing the `--clients`
option.

## Test Result

CMake-level errors and rmake.py changes work as expected.

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
kokolchin pushed a commit to kokolchin/rocm-libraries that referenced this pull request Mar 19, 2026
…ROCm#5494)

## Motivation

Users who attempt to build benchmarks on Windows see built errors
related to amdsmi.

## Technical Details

rocPRIM benchmarks can no longer be built on Windows because of
primbench's dependency on AMD SMI, which is Linux-only.
This change:
- Adds a CMake-level fatal warning to alert users of this before they
hit build errors.
- Modifies the rmake.py script to prevent BUILD_BENCHMARK from being set
to ON when the --clients option is passed.

## Test Plan

Attempt to build rocPRIM with benchmarks enabled on Windows.
Can also try this by using `rmake.py` and passing the `--clients`
option.

## Test Result

CMake-level errors and rmake.py changes work as expected.

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
MyNameIsTrez added a commit that referenced this pull request Mar 20, 2026
MyNameIsTrez added a commit that referenced this pull request Apr 1, 2026
MyNameIsTrez added a commit that referenced this pull request Apr 14, 2026
MyNameIsTrez added a commit that referenced this pull request Apr 16, 2026
stanleytsang-amd pushed a commit that referenced this pull request Apr 22, 2026
## Motivation

The PR [[rocPRIM] Warn/Prevent rocPRIM benchmarks from being built on
Windows](#5494) was merged as
a hotfix, since rocPRIM's benchmarks were not buildable on Windows
anymore.

This PR its commit `fix(rocprim): revert Windows hotfix PR #5494`
reverts that hotfix, and provides a *proper* fix, by turning AMD SMI and
NVML from hard dependencies into soft dependencies.

This PR will be undrafted once the PR [feat(primbench): support an extra
backend](#5512) on which it
is based has been merged.

## Technical Details


[Here](https://github.com/ROCm/rocm-libraries/tree/users/mynameistrez/make-amdsmi-and-nvml-soft-dependencies/shared/primbench#dependencies)
is the updated Dependencies section of the readme:

<img width="1353" height="755" alt="image"
src="https://github.com/user-attachments/assets/ff8b98b5-1d1c-4fae-a6be-fd2ee7e7415c"
/>

## Test Plan

### VS Code dev containers

<details>
<summary>CUDA <code>Dockerfile</code> +
<code>devcontainer.json</code></summary>

`Dockerfile`:
```Dockerfile
FROM nvidia/cuda:12.9.1-devel-ubuntu24.04

RUN apt update && apt install -y git cmake ninja-build wget

RUN wget -qO- https://repo.radeon.com/rocm/rocm.gpg.key | gpg --dearmor > /etc/apt/keyrings/rocm.gpg

RUN echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/7.2 noble main" > /etc/apt/sources.list.d/rocm.list

RUN tee /etc/apt/preferences.d/rocm-pin-600 <<'EOF'
Package: *
Pin: origin repo.radeon.com
Pin-Priority: 600
EOF

RUN apt update && apt install -y hip-base

ENV HIP_PLATFORM=nvidia
```

`devcontainer.json`:
```json
{
    "build": {
        "dockerfile": "Dockerfile"
    },
    "name": "cuda-minimal",
    "privileged": true,
    "runArgs": [
        "--gpus=all"
    ]
}
```

</details>

<details>
<summary>HIP <code>Dockerfile</code> +
<code>devcontainer.json</code></summary>

`Dockerfile`:
```Dockerfile
FROM rocm/rocm-terminal:latest
```

`devcontainer.json`:
```json
{
    "build": {
        "dockerfile": "Dockerfile"
    },
    "name": "hip-minimal",
    "runArgs": [
        "--device=/dev/kfd",
        "--device=/dev/dri"
    ]
}
```

</details>

## Test Result

I have confirmed that Stream HPC's CI is now able to build rocPRIM's
benchmarks on Windows. It is crucial however for AMD's CI, or one of
AMD's reviewers, to confirm that rocPRIM's benchmarks now build and run
successfully on Windows for them too.

<details>
<summary>Monitoring still works</summary>

```sh
hipcc -o copy_benchmark examples/hip/copy_benchmark.cpp -I. -lamd_smi && ./copy_benchmark --json-out monitoring.json --csv-out monitoring.csv
```
```sh
nvcc -o copy_benchmark examples/cuda/copy_benchmark.cu -I. -lnvidia-ml && ./copy_benchmark --json-out monitoring.json --csv-out monitoring.csv
```

</details>

<details>
<summary>Monitoring can now be turned off</summary>

```sh
hipcc -o copy_benchmark examples/hip/copy_benchmark.cpp -I. -DPRIMBENCH_NO_MONITORING && ./copy_benchmark --json-out no_monitoring.json --csv-out no_monitoring.csv
```
```sh
nvcc -o copy_benchmark examples/cuda/copy_benchmark.cu -I. -DPRIMBENCH_NO_MONITORING && ./copy_benchmark --json-out no_monitoring.json --csv-out no_monitoring.csv
```

When monitoring is disabled, the `GPU °C` column is excluded from the
printed output:
```
Status of copy             Noise  Bytes/sec  Specialization   Index/2
─────────────────────────────────────────────────────────────────────
Success after 1s            0.1%   4.08e+11  type: char             0
Success after 1s            0.0%   5.33e+11  type: long long        1
```

The `monitoring`, `temperature_type` and `gpu_temp_celcius` keys are
also excluded from the JSON output:
```diff
23,27d22
<             "monitoring": {
<                 "name": "amdsmi",
<                 "version": "25.3.0"
<             },
<             "temperature_type": "edge",
73,76d67
<             },
<             "gpu_temp_celsius": {
<                 "start": 50,
<                 "end": 48
```

</details>

<details>
<summary>Forgetting to pass <code>-DPRIMBENCH_NO_MONITORING</code>
throws documented compilation errors</summary>

```sh
hipcc -o copy_benchmark examples/hip/copy_benchmark.cpp -I. && ./copy_benchmark
```
```sh
nvcc -o copy_benchmark examples/cuda/copy_benchmark.cu -I. && ./copy_benchmark
```

```
ld.lld: error: undefined symbol: amdsmi_get_lib_version
>>> referenced by copy_benchmark.cpp
```

```
/usr/bin/ld: /tmp/tmpxft_00007baa_00000000-11_copy_benchmark.o: in function `primbench::detail::monitor::get_temp() const':
tmpxft_00007baa_00000000-6_copy_benchmark.cudafe1.cpp:(.text._ZNK9primbench6detail7monitor8get_tempEv[_ZNK9primbench6detail7monitor8get_tempEv]+0x35): undefined reference to `nvmlDeviceGetTemperature'
```

</details>

## Submission Checklist

- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
assistant-librarian Bot pushed a commit to ROCm/rocPRIM that referenced this pull request Apr 22, 2026
feat(primbench): make AMD SMI and NVML soft dependencies
 (#5637)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

## Motivation

The PR [[rocPRIM] Warn/Prevent rocPRIM benchmarks from being built on
Windows](ROCm/rocm-libraries#5494) was merged as
a hotfix, since rocPRIM's benchmarks were not buildable on Windows
anymore.

This PR its commit `fix(rocprim): revert Windows hotfix PR #5494`
reverts that hotfix, and provides a *proper* fix, by turning AMD SMI and
NVML from hard dependencies into soft dependencies.

This PR will be undrafted once the PR [feat(primbench): support an extra
backend](ROCm/rocm-libraries#5512) on which it
is based has been merged.

## Technical Details

[Here](https://github.com/ROCm/rocm-libraries/tree/users/mynameistrez/make-amdsmi-and-nvml-soft-dependencies/shared/primbench#dependencies)
is the updated Dependencies section of the readme:

<img width="1353" height="755" alt="image"
src="https://github.com/user-attachments/assets/ff8b98b5-1d1c-4fae-a6be-fd2ee7e7415c"
/>

## Test Plan

### VS Code dev containers

<details>
<summary>CUDA <code>Dockerfile</code> +
<code>devcontainer.json</code></summary>

`Dockerfile`:
```Dockerfile
FROM nvidia/cuda:12.9.1-devel-ubuntu24.04

RUN apt update && apt install -y git cmake ninja-build wget

RUN wget -qO- https://repo.radeon.com/rocm/rocm.gpg.key | gpg --dearmor > /etc/apt/keyrings/rocm.gpg

RUN echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/7.2 noble main" > /etc/apt/sources.list.d/rocm.list

RUN tee /etc/apt/preferences.d/rocm-pin-600 <<'EOF'
Package: *
Pin: origin repo.radeon.com
Pin-Priority: 600
EOF

RUN apt update && apt install -y hip-base

ENV HIP_PLATFORM=nvidia
```

`devcontainer.json`:
```json
{
    "build": {
        "dockerfile": "Dockerfile"
    },
    "name": "cuda-minimal",
    "privileged": true,
    "runArgs": [
        "--gpus=all"
    ]
}
```

</details>

<details>
<summary>HIP <code>Dockerfile</code> +
<code>devcontainer.json</code></summary>

`Dockerfile`:
```Dockerfile
FROM rocm/rocm-terminal:latest
```

`devcontainer.json`:
```json
{
    "build": {
        "dockerfile": "Dockerfile"
    },
    "name": "hip-minimal",
    "runArgs": [
        "--device=/dev/kfd",
        "--device=/dev/dri"
    ]
}
```

</details>

## Test Result

I have confirmed that Stream HPC's CI is now able to build rocPRIM's
benchmarks on Windows. It is crucial however for AMD's CI, or one of
AMD's reviewers, to confirm that rocPRIM's benchmarks now build and run
successfully on Windows for them too.

<details>
<summary>Monitoring still works</summary>

```sh
hipcc -o copy_benchmark examples/hip/copy_benchmark.cpp -I. -lamd_smi && ./copy_benchmark --json-out monitoring.json --csv-out monitoring.csv
```
```sh
nvcc -o copy_benchmark examples/cuda/copy_benchmark.cu -I. -lnvidia-ml && ./copy_benchmark --json-out monitoring.json --csv-out monitoring.csv
```

</details>

<details>
<summary>Monitoring can now be turned off</summary>

```sh
hipcc -o copy_benchmark examples/hip/copy_benchmark.cpp -I. -DPRIMBENCH_NO_MONITORING && ./copy_benchmark --json-out no_monitoring.json --csv-out no_monitoring.csv
```
```sh
nvcc -o copy_benchmark examples/cuda/copy_benchmark.cu -I. -DPRIMBENCH_NO_MONITORING && ./copy_benchmark --json-out no_monitoring.json --csv-out no_monitoring.csv
```

When monitoring is disabled, the `GPU °C` column is excluded from the
printed output:
```
Status of copy             Noise  Bytes/sec  Specialization   Index/2
─────────────────────────────────────────────────────────────────────
Success after 1s            0.1%   4.08e+11  type: char             0
Success after 1s            0.0%   5.33e+11  type: long long        1
```

The `monitoring`, `temperature_type` and `gpu_temp_celcius` keys are
also excluded from the JSON output:
```diff
23,27d22
<             "monitoring": {
<                 "name": "amdsmi",
<                 "version": "25.3.0"
<             },
<             "temperature_type": "edge",
73,76d67
<             },
<             "gpu_temp_celsius": {
<                 "start": 50,
<                 "end": 48
```

</details>

<details>
<summary>Forgetting to pass <code>-DPRIMBENCH_NO_MONITORING</code>
throws documented compilation errors</summary>

```sh
hipcc -o copy_benchmark examples/hip/copy_benchmark.cpp -I. && ./copy_benchmark
```
```sh
nvcc -o copy_benchmark examples/cuda/copy_benchmark.cu -I. && ./copy_benchmark
```

```
ld.lld: error: undefined symbol: amdsmi_get_lib_version
>>> referenced by copy_benchmark.cpp
```

```
/usr/bin/ld: /tmp/tmpxft_00007baa_00000000-11_copy_benchmark.o: in function `primbench::detail::monitor::get_temp() const':
tmpxft_00007baa_00000000-6_copy_benchmark.cudafe1.cpp:(.text._ZNK9primbench6detail7monitor8get_tempEv[_ZNK9primbench6detail7monitor8get_tempEv]+0x35): undefined reference to `nvmlDeviceGetTemperature'
```

</details>

## Submission Checklist

- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
aledudek pushed a commit that referenced this pull request May 20, 2026
## Motivation

The PR [[rocPRIM] Warn/Prevent rocPRIM benchmarks from being built on
Windows](#5494) was merged as
a hotfix, since rocPRIM's benchmarks were not buildable on Windows
anymore.

This PR its commit `fix(rocprim): revert Windows hotfix PR #5494`
reverts that hotfix, and provides a *proper* fix, by turning AMD SMI and
NVML from hard dependencies into soft dependencies.

This PR will be undrafted once the PR [feat(primbench): support an extra
backend](#5512) on which it
is based has been merged.

## Technical Details


[Here](https://github.com/ROCm/rocm-libraries/tree/users/mynameistrez/make-amdsmi-and-nvml-soft-dependencies/shared/primbench#dependencies)
is the updated Dependencies section of the readme:

<img width="1353" height="755" alt="image"
src="https://github.com/user-attachments/assets/ff8b98b5-1d1c-4fae-a6be-fd2ee7e7415c"
/>

## Test Plan

### VS Code dev containers

<details>
<summary>CUDA <code>Dockerfile</code> +
<code>devcontainer.json</code></summary>

`Dockerfile`:
```Dockerfile
FROM nvidia/cuda:12.9.1-devel-ubuntu24.04

RUN apt update && apt install -y git cmake ninja-build wget

RUN wget -qO- https://repo.radeon.com/rocm/rocm.gpg.key | gpg --dearmor > /etc/apt/keyrings/rocm.gpg

RUN echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/7.2 noble main" > /etc/apt/sources.list.d/rocm.list

RUN tee /etc/apt/preferences.d/rocm-pin-600 <<'EOF'
Package: *
Pin: origin repo.radeon.com
Pin-Priority: 600
EOF

RUN apt update && apt install -y hip-base

ENV HIP_PLATFORM=nvidia
```

`devcontainer.json`:
```json
{
    "build": {
        "dockerfile": "Dockerfile"
    },
    "name": "cuda-minimal",
    "privileged": true,
    "runArgs": [
        "--gpus=all"
    ]
}
```

</details>

<details>
<summary>HIP <code>Dockerfile</code> +
<code>devcontainer.json</code></summary>

`Dockerfile`:
```Dockerfile
FROM rocm/rocm-terminal:latest
```

`devcontainer.json`:
```json
{
    "build": {
        "dockerfile": "Dockerfile"
    },
    "name": "hip-minimal",
    "runArgs": [
        "--device=/dev/kfd",
        "--device=/dev/dri"
    ]
}
```

</details>

## Test Result

I have confirmed that Stream HPC's CI is now able to build rocPRIM's
benchmarks on Windows. It is crucial however for AMD's CI, or one of
AMD's reviewers, to confirm that rocPRIM's benchmarks now build and run
successfully on Windows for them too.

<details>
<summary>Monitoring still works</summary>

```sh
hipcc -o copy_benchmark examples/hip/copy_benchmark.cpp -I. -lamd_smi && ./copy_benchmark --json-out monitoring.json --csv-out monitoring.csv
```
```sh
nvcc -o copy_benchmark examples/cuda/copy_benchmark.cu -I. -lnvidia-ml && ./copy_benchmark --json-out monitoring.json --csv-out monitoring.csv
```

</details>

<details>
<summary>Monitoring can now be turned off</summary>

```sh
hipcc -o copy_benchmark examples/hip/copy_benchmark.cpp -I. -DPRIMBENCH_NO_MONITORING && ./copy_benchmark --json-out no_monitoring.json --csv-out no_monitoring.csv
```
```sh
nvcc -o copy_benchmark examples/cuda/copy_benchmark.cu -I. -DPRIMBENCH_NO_MONITORING && ./copy_benchmark --json-out no_monitoring.json --csv-out no_monitoring.csv
```

When monitoring is disabled, the `GPU °C` column is excluded from the
printed output:
```
Status of copy             Noise  Bytes/sec  Specialization   Index/2
─────────────────────────────────────────────────────────────────────
Success after 1s            0.1%   4.08e+11  type: char             0
Success after 1s            0.0%   5.33e+11  type: long long        1
```

The `monitoring`, `temperature_type` and `gpu_temp_celcius` keys are
also excluded from the JSON output:
```diff
23,27d22
<             "monitoring": {
<                 "name": "amdsmi",
<                 "version": "25.3.0"
<             },
<             "temperature_type": "edge",
73,76d67
<             },
<             "gpu_temp_celsius": {
<                 "start": 50,
<                 "end": 48
```

</details>

<details>
<summary>Forgetting to pass <code>-DPRIMBENCH_NO_MONITORING</code>
throws documented compilation errors</summary>

```sh
hipcc -o copy_benchmark examples/hip/copy_benchmark.cpp -I. && ./copy_benchmark
```
```sh
nvcc -o copy_benchmark examples/cuda/copy_benchmark.cu -I. && ./copy_benchmark
```

```
ld.lld: error: undefined symbol: amdsmi_get_lib_version
>>> referenced by copy_benchmark.cpp
```

```
/usr/bin/ld: /tmp/tmpxft_00007baa_00000000-11_copy_benchmark.o: in function `primbench::detail::monitor::get_temp() const':
tmpxft_00007baa_00000000-6_copy_benchmark.cudafe1.cpp:(.text._ZNK9primbench6detail7monitor8get_tempEv[_ZNK9primbench6detail7monitor8get_tempEv]+0x35): undefined reference to `nvmlDeviceGetTemperature'
```

</details>

## Submission Checklist

- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
stanleytsang-amd pushed a commit that referenced this pull request Sep 18, 2026
…#5494)

## Motivation

Users who attempt to build benchmarks on Windows see built errors
related to amdsmi.

## Technical Details

rocPRIM benchmarks can no longer be built on Windows because of
primbench's dependency on AMD SMI, which is Linux-only.
This change:
- Adds a CMake-level fatal warning to alert users of this before they
hit build errors.
- Modifies the rmake.py script to prevent BUILD_BENCHMARK from being set
to ON when the --clients option is passed.

## Test Plan

Attempt to build rocPRIM with benchmarks enabled on Windows.
Can also try this by using `rmake.py` and passing the `--clients`
option.

## Test Result

CMake-level errors and rmake.py changes work as expected.

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
stanleytsang-amd pushed a commit that referenced this pull request Sep 18, 2026
## Motivation

The PR [[rocPRIM] Warn/Prevent rocPRIM benchmarks from being built on
Windows](#5494) was merged as
a hotfix, since rocPRIM's benchmarks were not buildable on Windows
anymore.

This PR its commit `fix(rocprim): revert Windows hotfix PR #5494`
reverts that hotfix, and provides a *proper* fix, by turning AMD SMI and
NVML from hard dependencies into soft dependencies.

This PR will be undrafted once the PR [feat(primbench): support an extra
backend](#5512) on which it
is based has been merged.

## Technical Details


[Here](https://github.com/ROCm/rocm-libraries/tree/users/mynameistrez/make-amdsmi-and-nvml-soft-dependencies/shared/primbench#dependencies)
is the updated Dependencies section of the readme:

<img width="1353" height="755" alt="image"
src="https://github.com/user-attachments/assets/ff8b98b5-1d1c-4fae-a6be-fd2ee7e7415c"
/>

## Test Plan

### VS Code dev containers

<details>
<summary>CUDA <code>Dockerfile</code> +
<code>devcontainer.json</code></summary>

`Dockerfile`:
```Dockerfile
FROM nvidia/cuda:12.9.1-devel-ubuntu24.04

RUN apt update && apt install -y git cmake ninja-build wget

RUN wget -qO- https://repo.radeon.com/rocm/rocm.gpg.key | gpg --dearmor > /etc/apt/keyrings/rocm.gpg

RUN echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/7.2 noble main" > /etc/apt/sources.list.d/rocm.list

RUN tee /etc/apt/preferences.d/rocm-pin-600 <<'EOF'
Package: *
Pin: origin repo.radeon.com
Pin-Priority: 600
EOF

RUN apt update && apt install -y hip-base

ENV HIP_PLATFORM=nvidia
```

`devcontainer.json`:
```json
{
    "build": {
        "dockerfile": "Dockerfile"
    },
    "name": "cuda-minimal",
    "privileged": true,
    "runArgs": [
        "--gpus=all"
    ]
}
```

</details>

<details>
<summary>HIP <code>Dockerfile</code> +
<code>devcontainer.json</code></summary>

`Dockerfile`:
```Dockerfile
FROM rocm/rocm-terminal:latest
```

`devcontainer.json`:
```json
{
    "build": {
        "dockerfile": "Dockerfile"
    },
    "name": "hip-minimal",
    "runArgs": [
        "--device=/dev/kfd",
        "--device=/dev/dri"
    ]
}
```

</details>

## Test Result

I have confirmed that Stream HPC's CI is now able to build rocPRIM's
benchmarks on Windows. It is crucial however for AMD's CI, or one of
AMD's reviewers, to confirm that rocPRIM's benchmarks now build and run
successfully on Windows for them too.

<details>
<summary>Monitoring still works</summary>

```sh
hipcc -o copy_benchmark examples/hip/copy_benchmark.cpp -I. -lamd_smi && ./copy_benchmark --json-out monitoring.json --csv-out monitoring.csv
```
```sh
nvcc -o copy_benchmark examples/cuda/copy_benchmark.cu -I. -lnvidia-ml && ./copy_benchmark --json-out monitoring.json --csv-out monitoring.csv
```

</details>

<details>
<summary>Monitoring can now be turned off</summary>

```sh
hipcc -o copy_benchmark examples/hip/copy_benchmark.cpp -I. -DPRIMBENCH_NO_MONITORING && ./copy_benchmark --json-out no_monitoring.json --csv-out no_monitoring.csv
```
```sh
nvcc -o copy_benchmark examples/cuda/copy_benchmark.cu -I. -DPRIMBENCH_NO_MONITORING && ./copy_benchmark --json-out no_monitoring.json --csv-out no_monitoring.csv
```

When monitoring is disabled, the `GPU °C` column is excluded from the
printed output:
```
Status of copy             Noise  Bytes/sec  Specialization   Index/2
─────────────────────────────────────────────────────────────────────
Success after 1s            0.1%   4.08e+11  type: char             0
Success after 1s            0.0%   5.33e+11  type: long long        1
```

The `monitoring`, `temperature_type` and `gpu_temp_celcius` keys are
also excluded from the JSON output:
```diff
23,27d22
<             "monitoring": {
<                 "name": "amdsmi",
<                 "version": "25.3.0"
<             },
<             "temperature_type": "edge",
73,76d67
<             },
<             "gpu_temp_celsius": {
<                 "start": 50,
<                 "end": 48
```

</details>

<details>
<summary>Forgetting to pass <code>-DPRIMBENCH_NO_MONITORING</code>
throws documented compilation errors</summary>

```sh
hipcc -o copy_benchmark examples/hip/copy_benchmark.cpp -I. && ./copy_benchmark
```
```sh
nvcc -o copy_benchmark examples/cuda/copy_benchmark.cu -I. && ./copy_benchmark
```

```
ld.lld: error: undefined symbol: amdsmi_get_lib_version
>>> referenced by copy_benchmark.cpp
```

```
/usr/bin/ld: /tmp/tmpxft_00007baa_00000000-11_copy_benchmark.o: in function `primbench::detail::monitor::get_temp() const':
tmpxft_00007baa_00000000-6_copy_benchmark.cudafe1.cpp:(.text._ZNK9primbench6detail7monitor8get_tempEv[_ZNK9primbench6detail7monitor8get_tempEv]+0x35): undefined reference to `nvmlDeviceGetTemperature'
```

</details>

## Submission Checklist

- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
illsilin pushed a commit to igorluppi/rocm-libraries that referenced this pull request Oct 1, 2026
…ROCm#5494)

## Motivation

Users who attempt to build benchmarks on Windows see built errors
related to amdsmi.

## Technical Details

rocPRIM benchmarks can no longer be built on Windows because of
primbench's dependency on AMD SMI, which is Linux-only.
This change:
- Adds a CMake-level fatal warning to alert users of this before they
hit build errors.
- Modifies the rmake.py script to prevent BUILD_BENCHMARK from being set
to ON when the --clients option is passed.

## Test Plan

Attempt to build rocPRIM with benchmarks enabled on Windows.
Can also try this by using `rmake.py` and passing the `--clients`
option.

## Test Result

CMake-level errors and rmake.py changes work as expected.

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
illsilin pushed a commit to igorluppi/rocm-libraries that referenced this pull request Oct 1, 2026
## Motivation

The PR [[rocPRIM] Warn/Prevent rocPRIM benchmarks from being built on
Windows](ROCm#5494) was merged as
a hotfix, since rocPRIM's benchmarks were not buildable on Windows
anymore.

This PR its commit `fix(rocprim): revert Windows hotfix PR ROCm#5494`
reverts that hotfix, and provides a *proper* fix, by turning AMD SMI and
NVML from hard dependencies into soft dependencies.

This PR will be undrafted once the PR [feat(primbench): support an extra
backend](ROCm#5512) on which it
is based has been merged.

## Technical Details


[Here](https://github.com/ROCm/rocm-libraries/tree/users/mynameistrez/make-amdsmi-and-nvml-soft-dependencies/shared/primbench#dependencies)
is the updated Dependencies section of the readme:

<img width="1353" height="755" alt="image"
src="https://github.com/user-attachments/assets/ff8b98b5-1d1c-4fae-a6be-fd2ee7e7415c"
/>

## Test Plan

### VS Code dev containers

<details>
<summary>CUDA <code>Dockerfile</code> +
<code>devcontainer.json</code></summary>

`Dockerfile`:
```Dockerfile
FROM nvidia/cuda:12.9.1-devel-ubuntu24.04

RUN apt update && apt install -y git cmake ninja-build wget

RUN wget -qO- https://repo.radeon.com/rocm/rocm.gpg.key | gpg --dearmor > /etc/apt/keyrings/rocm.gpg

RUN echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/7.2 noble main" > /etc/apt/sources.list.d/rocm.list

RUN tee /etc/apt/preferences.d/rocm-pin-600 <<'EOF'
Package: *
Pin: origin repo.radeon.com
Pin-Priority: 600
EOF

RUN apt update && apt install -y hip-base

ENV HIP_PLATFORM=nvidia
```

`devcontainer.json`:
```json
{
    "build": {
        "dockerfile": "Dockerfile"
    },
    "name": "cuda-minimal",
    "privileged": true,
    "runArgs": [
        "--gpus=all"
    ]
}
```

</details>

<details>
<summary>HIP <code>Dockerfile</code> +
<code>devcontainer.json</code></summary>

`Dockerfile`:
```Dockerfile
FROM rocm/rocm-terminal:latest
```

`devcontainer.json`:
```json
{
    "build": {
        "dockerfile": "Dockerfile"
    },
    "name": "hip-minimal",
    "runArgs": [
        "--device=/dev/kfd",
        "--device=/dev/dri"
    ]
}
```

</details>

## Test Result

I have confirmed that Stream HPC's CI is now able to build rocPRIM's
benchmarks on Windows. It is crucial however for AMD's CI, or one of
AMD's reviewers, to confirm that rocPRIM's benchmarks now build and run
successfully on Windows for them too.

<details>
<summary>Monitoring still works</summary>

```sh
hipcc -o copy_benchmark examples/hip/copy_benchmark.cpp -I. -lamd_smi && ./copy_benchmark --json-out monitoring.json --csv-out monitoring.csv
```
```sh
nvcc -o copy_benchmark examples/cuda/copy_benchmark.cu -I. -lnvidia-ml && ./copy_benchmark --json-out monitoring.json --csv-out monitoring.csv
```

</details>

<details>
<summary>Monitoring can now be turned off</summary>

```sh
hipcc -o copy_benchmark examples/hip/copy_benchmark.cpp -I. -DPRIMBENCH_NO_MONITORING && ./copy_benchmark --json-out no_monitoring.json --csv-out no_monitoring.csv
```
```sh
nvcc -o copy_benchmark examples/cuda/copy_benchmark.cu -I. -DPRIMBENCH_NO_MONITORING && ./copy_benchmark --json-out no_monitoring.json --csv-out no_monitoring.csv
```

When monitoring is disabled, the `GPU °C` column is excluded from the
printed output:
```
Status of copy             Noise  Bytes/sec  Specialization   Index/2
─────────────────────────────────────────────────────────────────────
Success after 1s            0.1%   4.08e+11  type: char             0
Success after 1s            0.0%   5.33e+11  type: long long        1
```

The `monitoring`, `temperature_type` and `gpu_temp_celcius` keys are
also excluded from the JSON output:
```diff
23,27d22
<             "monitoring": {
<                 "name": "amdsmi",
<                 "version": "25.3.0"
<             },
<             "temperature_type": "edge",
73,76d67
<             },
<             "gpu_temp_celsius": {
<                 "start": 50,
<                 "end": 48
```

</details>

<details>
<summary>Forgetting to pass <code>-DPRIMBENCH_NO_MONITORING</code>
throws documented compilation errors</summary>

```sh
hipcc -o copy_benchmark examples/hip/copy_benchmark.cpp -I. && ./copy_benchmark
```
```sh
nvcc -o copy_benchmark examples/cuda/copy_benchmark.cu -I. && ./copy_benchmark
```

```
ld.lld: error: undefined symbol: amdsmi_get_lib_version
>>> referenced by copy_benchmark.cpp
```

```
/usr/bin/ld: /tmp/tmpxft_00007baa_00000000-11_copy_benchmark.o: in function `primbench::detail::monitor::get_temp() const':
tmpxft_00007baa_00000000-6_copy_benchmark.cudafe1.cpp:(.text._ZNK9primbench6detail7monitor8get_tempEv[_ZNK9primbench6detail7monitor8get_tempEv]+0x35): undefined reference to `nvmlDeviceGetTemperature'
```

</details>

## Submission Checklist

- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants