Native runtime and installer: load the HIP runtime only from System32 or an official SDK by full path

オープン
#242 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
cpp

調査の方向性

Start with init in clean/runtime/device.cpp (around lines 301-335), the single HIP loader that clean/runtime/runtime.cpp (around lines 698-706) calls, then compare it against the probe in clean/installer/src/wg_core/checks.cpp (around lines 151-189, 210-213, 284-300). Read clean/runner/sdk.py from PR #239 for the official-SDK resolution rule to mirror, and note the Windows loader flags available for System32-only and full-path loads. Adding the no-GPU tests (stand-in DLL on PATH, a HIP_PATH folder outside the official root, an accepted official install) and the BUILDING.md HIP SDK sentence is done when no bare-name load remains in either component and the tests prove it.

索引モデルが issue の本文から書いたものです。

説明

Problem

PR #239 makes the Python tools and build scripts use only an official AMD HIP SDK (clean/runner/sdk.py). The native
runtime and the installer still have their own HIP runtime lookup, which does not follow that rule:

  • clean/runtime/device.cpp (init, around lines 301-335) on Windows tries, in order: an explicit rocm_dir (any
    folder, or an exact .dll the installer selected), amdhip64_7.dll from System32, then the same bare name through the
    standard DLL search path (which includes PATH), then the newest folder under C:\Program Files\AMD\ROCm, then
    %HIP_PATH%\bin. On Linux it tries rocm_dir/lib/libamdhip64.so, then the bare name libamdhip64.so (the loader's
    search path). clean/runtime/runtime.cpp (around lines 698-706) reaches this loader.
  • clean/installer/src/wg_core/checks.cpp (around lines 151-189, 210-213, 284-300) probes PATH and HIP_PATH
    candidates on its own.

Example: when System32 has no amdhip64_7.dll, a DLL of that name found through PATH is loaded, or HIP_PATH
pointing at a non-official SDK copy is used. The installer probe can select such a copy as well.

These rules predate #239; changing them changes product behaviour, so they were kept out of that PR.

Proposed rule (runtime and installer the same)

  1. System32 first: the AMD driver's own amdhip64_7.dll (LOAD_LIBRARY_SEARCH_SYSTEM32).
  2. Then an official HIP SDK install by full path: C:\Program Files\AMD\ROCm\<version>\bin\amdhip64_7.dll, newest
    compatible version first (Linux: /opt/rocm-<version>/lib or /opt/rocm/lib, by full path).
  3. Never a bare-name search through PATH or the loader's default search path.
  4. HIP_PATH only when it resolves to one of the official installs of step 2 (otherwise ignored, with a note in the log
    that names it by id only, not by path).
  5. An explicit rocm_dir or installer-selected DLL: only when it is System32's copy or inside an official install
    (tests that need another one get an explicit, logged override).
  6. The installer probe (checks.cpp) uses exactly these rules, so it never selects a runtime the runtime would refuse.

Done when

  • device.cpp, runtime.cpp and checks.cpp follow the rule above; no bare-name load remains.
  • Tests (no GPU): with a stand-in DLL on PATH and in a HIP_PATH folder outside the official root, neither is
    loaded or selected; System32 and the official SDK are; HIP_PATH pointing at an official install is accepted.
  • BUILDING.md (HIP SDK paragraph) states that the native runtime and installer follow the same rule.
主要言語
C++
スター
12
フォーク
2
平均マージ
3時間 10分
マージ済み PR(30日)
171

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

phantoslayer21/wronggpu のほかの issue

phantoslayer21/wronggpu の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。