Repository navigation
[rocPRIM] Warn/Prevent rocPRIM benchmarks from being built on Windows - #5494
Conversation
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.
There was a problem hiding this comment.
Yikes, big oversight on our part.
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.
|
@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 may be misinterpreting ROCm 6.2.4 its ROCm component support page, but its "System Management" row seems to suggest that |
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
*This pull request uses carry forward flags. Click here to find out more. 🚀 New features to boost your workflow:
|
[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.
I'm fine either way.
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 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. |
|
@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? |
…#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.
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. |
…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.
…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.
## 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.
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.
## 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.
…#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.
## 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.
…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.
## 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.
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:
Test Plan
Attempt to build rocPRIM with benchmarks enabled on Windows.
Can also try this by using
rmake.pyand passing the--clientsoption.Test Result
CMake-level errors and rmake.py changes work as expected.
Submission Checklist