Skip to content

Instantly share code, notes, and snippets.

@AmosLewis
Last active October 23, 2025 22:15
Show Gist options
  • Save AmosLewis/ac3536cc1c4e67abe9a318c35f20efcb to your computer and use it in GitHub Desktop.
Save AmosLewis/ac3536cc1c4e67abe9a318c35f20efcb to your computer and use it in GitHub Desktop.

GPU: AMD radeon tm 890M graphics AMD Radeon™ 890M integrated GPU is based on the gfx1150 architecture, which corresponds to the RDNA 3.5 generation used in AMD's Strix Point APUs like the Ryzen AI 300 series

Issue:

PS C:\Users\chiliu12\Documents\src> git clone https://github.com/ROCm/TheRock.git
git : The term 'git' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ git clone https://github.com/ROCm/TheRock.git
+ ~~~
    + CategoryInfo          : ObjectNotFound: (git:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Solution:

Install git by https://git-scm.com/downloads/win Install python3.12

Issue:

PS C:\Users\chiliu12\Documents\src\TheRock> python3 -m venv venv
PS C:\Users\chiliu12\Documents\src\TheRock> source venv/bin/activate
source : The term 'source' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ source venv/bin/activate
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (source:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Solution: RUN PowerShell as Administrator

PS C:\Users\chiliu12\Documents\src\TheRock> venv\Scripts\Activate.ps1
venv\Scripts\Activate.ps1 : File C:\Users\chiliu12\Documents\src\TheRock\venv\Scripts\Activate.ps1 cannot be loaded
because running scripts is disabled on this system. For more information, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ venv\Scripts\Activate.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess
PS C:\Users\chiliu12\Documents\src\TheRock> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose
you to the security risks described in the about_Execution_Policies help topic at
https:/go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): A
PS C:\Users\chiliu12\Documents\src\TheRock> venv\Scripts\Activate.ps1
(venv) PS C:\Users\chiliu12\Documents\src\TheRock>
@AmosLewis
Copy link
Author

AmosLewis commented Oct 20, 2025

with #1810 https://github.com/ROCm/TheRock/actions/runs/18606584391

python build_tools/install_rocm_from_artifacts.py --run-id 18606584391 --amdgpu-family gfx1150 --output-dir build
(venv) PS C:\Users\chiliu12\Documents\src\TheRock\build\bin> ls


    Directory: C:\Users\chiliu12\Documents\src\TheRock\build\bin


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        10/20/2025  11:26 AM            241 .hipVersion
-a----        10/20/2025  11:26 AM       17629696 amdhip64_7.dll
-a----        10/20/2025  11:27 AM      115628544 amd_comgr0701.dll
-a----        10/20/2025  11:26 AM         953856 fftw3.dll
-a----        10/20/2025  11:26 AM         934400 fftw3f.dll
-a----        10/20/2025  11:27 AM             37 hipcc.bat
-a----        10/20/2025  11:27 AM         243712 hipcc.exe
-a----        10/20/2025  11:26 AM           1538 hipcc_cmake_linker_helper
-a----        10/20/2025  11:27 AM             49 hipconfig.bat
-a----        10/20/2025  11:27 AM         243712 hipconfig.exe
-a----        10/20/2025  11:26 AM           1895 hipdemangleatp
-a----        10/20/2025  11:27 AM       35491328 hipify-clang.exe
-a----        10/20/2025  11:26 AM          24576 hipInfo.exe
-a----        10/20/2025  11:26 AM        1096704 hiprtc-builtins0701.dll
-a----        10/20/2025  11:26 AM        1915392 hiprtc0701.dll
-a----        10/20/2025  11:27 AM           6664 hipvars.pm
-a----        10/20/2025  11:26 AM          10447 roc-obj
-a----        10/20/2025  11:26 AM           8871 roc-obj-extract
-a----        10/20/2025  11:26 AM             73 roc-obj-extract.bat
-a----        10/20/2025  11:26 AM           7335 roc-obj-ls
-a----        10/20/2025  11:26 AM             58 roc-obj-ls.bat
-a----        10/20/2025  11:26 AM       11472896 rocm-openblas.dll

@AmosLewis
Copy link
Author

AmosLewis commented Oct 20, 2025

With CI nightly 10/20 https://github.com/ROCm/TheRock/actions/runs/18640327443

python build_tools/install_rocm_from_artifacts.py --run-id 18640327443 --amdgpu-family gfx1150 --output-dir build
(venv) PS C:\Users\chiliu12\Documents\src\TheRock\build\bin> ls


    Directory: C:\Users\chiliu12\Documents\src\TheRock\build\bin


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----        10/20/2025   1:16 PM                hipblaslt
d-----        10/20/2025   1:16 PM                hipcub
d-----        10/20/2025   1:16 PM                hipRAND
d-----        10/20/2025   1:16 PM                rocblas
d-----        10/20/2025   1:16 PM                rocprim
d-----        10/20/2025   1:16 PM                rocRAND
d-----        10/20/2025   1:17 PM                rocthrust
-a----        10/20/2025   1:15 PM            241 .hipVersion
-a----        10/20/2025   1:17 PM        1490944 address_stability.hip.exe
-a----        10/20/2025   1:17 PM       23656448 adjacent_difference.hip.exe
-a----        10/20/2025   1:17 PM        1815552 advance.hip.exe
-a----        10/20/2025   1:17 PM        1551872 alignment.hip.exe
-a----        10/20/2025   1:17 PM       14825472 allocator.hip.exe
-a----        10/20/2025   1:17 PM        1538048 allocator_aware_policies.hip.exe
-a----        10/20/2025   1:15 PM       17629696 amdhip64_7.dll
-a----        10/20/2025   1:16 PM      115628544 amd_comgr0701.dll
-a----        10/20/2025   1:17 PM       24606720 async_copy.hip.exe
-a----        10/20/2025   1:17 PM        1763840 async_for_each.hip.exe
-a----        10/20/2025   1:17 PM       48809984 async_reduce.hip.exe
...
-a----        10/20/2025   1:16 PM         373760 test_poisson_distribution.exe
-a----        10/20/2025   1:16 PM         477184 test_predicate_iterator.exe
-a----        10/20/2025   1:16 PM         683520 test_radix_key_codec.exe
-a----        10/20/2025   1:16 PM         579072 test_reverse_iterator.exe
-a----        10/20/2025   1:16 PM         419328 test_rocprim_tuple.exe
-a----        10/20/2025   1:16 PM         788480 test_rocprim_types.exe
...
-a----        10/20/2025   1:17 PM        5358080 zip_iterator_reduce_by_key.hip.exe
-a----        10/20/2025   1:17 PM       14353408 zip_iterator_scan.hip.exe
-a----        10/20/2025   1:17 PM        4675072 zip_iterator_sort.hip.exe
-a----        10/20/2025   1:17 PM       14898176 zip_iterator_sort_by_key.hip.exe

@AmosLewis
Copy link
Author

AmosLewis commented Oct 22, 2025

Follow https://github.com/ROCm/TheRock/blob/main/external-builds/pytorch/README.md

cd TheRock

python -m venv .venv
.\.venv\Scripts\Activate.ps1

cd external-builds\pytorch

python pytorch_torch_repo.py checkout --checkout-dir C:/b/pytorch
python pytorch_audio_repo.py checkout --checkout-dir C:/b/audio
python pytorch_vision_repo.py checkout --checkout-dir C:/b/vision

pip install packaging

python build_prod_wheels.py build `
  --install-rocm --index-url https://rocm.nightlies.amd.com/v2/gfx1150/ `
  --pytorch-dir C:/b/pytorch `
  --pytorch-audio-dir C:/b/audio `
  --pytorch-vision-dir C:/b/vision `
  --output-dir %HOME%/tmp/pyout

RuntimeError: VCToolsRedistDir not set, can't copy libomp to torch lib

It should be fixed by install visual studios and set its environment path. It will install vs2022 automatically, but you will find pytorch required 2019 later. Here is a 2022 style fix the issue. Once you got 2019 installed, should follow the same way.

1. Install MSVC Redistributables via Visual Studio Installer

Open Visual Studio Installer (you can search for it in the Start menu).
Click Modify on your installed Visual Studio version.
Under Workloads, ensure "Desktop development with C++" is selected.
Then go to the Individual components tab and check:

MSVC v143 - VS 2022 C++ x64/x86 build tools
Windows 10 SDK
C++ CMake tools for Windows
C++ ATL for v143 build tools (x64/x86) (optional but useful)

Click Modify to install the selected components.

Set enviroment variables.

$env:VCToolsRedistDir = "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.44.35112"

OR

To make it available across sessions or for other tools (like a Python subprocess), you can set it in System Environment Variables via:

Open Start Menu → Search for "Environment Variables".
Click "Edit the system environment variables".
In the System Properties window, click "Environment Variables...".
Under User variables or System variables, click New...
Set:

Variable name: VCToolsRedistDir
Variable value: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\v143

@AmosLewis
Copy link
Author

AmosLewis commented Oct 22, 2025

Retry this:

python build_prod_wheels.py build `
  --install-rocm --index-url https://rocm.nightlies.amd.com/v2/gfx1150/ `
  --pytorch-dir C:/b/pytorch `
  --pytorch-audio-dir C:/b/audio `
  --pytorch-vision-dir C:/b/vision `
  --output-dir %HOME%/tmp/pyout
CMake Error at CMakeLists.txt:28 (project):
  Generator

    Visual Studio 16 2019

  could not find any instance of Visual Studio.



-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
  File "C:\Users\chiliu12\Documents\src\TheRock\external-builds\pytorch\build_prod_wheels.py", line 977, in <module>
    main(sys.argv[1:])
  File "C:\Users\chiliu12\Documents\src\TheRock\external-builds\pytorch\build_prod_wheels.py", line 973, in main
    args.func(args)
  File "C:\Users\chiliu12\Documents\src\TheRock\external-builds\pytorch\build_prod_wheels.py", line 442, in do_build
    do_build_pytorch(
  File "C:\Users\chiliu12\Documents\src\TheRock\external-builds\pytorch\build_prod_wheels.py", line 756, in do_build_pytorch
    exec([sys.executable, "setup.py", "bdist_wheel"], cwd=pytorch_dir, env=env)
  File "C:\Users\chiliu12\Documents\src\TheRock\external-builds\pytorch\build_prod_wheels.py", line 171, in exec
    subprocess.check_call(args, cwd=str(cwd), env=full_env)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.2800.0_x64__qbz5n2kfra8p0\Lib\subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['C:\\Users\\chiliu12\\Documents\\src\\TheRock\\.venv\\Scripts\\python.exe', 'setup.py', 'bdist_wheel']' returned non-zero exit status 1.

when try to download and install vs2019:
Downloads for Visual Studio Subscribers
Older versions require an active Visual Studio Subscription. Choose a product below and click on the download button to log in to your Visual Studio (MSDN) subscription and gain access to the older versions.

Failed try: add this

    if is_windows:
        env["CMAKE_GENERATOR"] = "Visual Studio 17 2022"
        env["CMAKE_GENERATOR_PLATFORM"] = "x64"
        env["TORCH_CMAKE_GENERATOR"] = "Visual Studio 17 2022"
        env["TORCH_CMAKE_GENERATOR_PLATFORM"] = "x64"

before
exec([sys.executable, "setup.py", "bdist_wheel"], cwd=pytorch_dir, env=env)

@AmosLewis
Copy link
Author

AmosLewis commented Oct 23, 2025

start menu search x64 Native Tools Command Prompt for Visual Studio 2022

cd TheRock

.venv\Scripts\activate.bat

python -m pip install --index-url https://rocm.nightlies.amd.com/v2/gfx1150/ "rocm[libraries,devel]"

# Successfully installed rocm-7.10.0a20251023 rocm-sdk-core-7.10.0a20251023 rocm-sdk-devel-7.10.0a20251023 rocm-sdk-libraries-gfx1150-7.10.0a20251023
cd external-builds\pytorch

python pytorch_torch_repo.py checkout --checkout-dir C:/b/pytorch
python pytorch_audio_repo.py checkout --checkout-dir C:/b/audio
python pytorch_vision_repo.py checkout --checkout-dir C:/b/vision

python build_prod_wheels.py build ^
  --install-rocm --index-url https://rocm.nightlies.amd.com/v2/gfx1150/ ^
  --pytorch-dir C:/b/pytorch ^
  --pytorch-audio-dir C:/b/audio ^
  --pytorch-vision-dir C:/b/vision ^
  --output-dir %USERPROFILE%/tmp/pyout ^
  --clean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment