Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instructions: How to build in windows? #3436

Open
johnnynunez opened this issue Dec 13, 2024 · 9 comments
Open

Instructions: How to build in windows? #3436

johnnynunez opened this issue Dec 13, 2024 · 9 comments

Comments

@johnnynunez
Copy link

No description provided.

@huanrwan-amd
Copy link
Contributor

Hi @johnnynunez , we have instructions to build MIOpen in Ubuntu as

@CAHEK7
Copy link
Contributor

CAHEK7 commented Dec 17, 2024

Probably @apwojcik can provide some insights. At least he participated in windows CI stage setup.

@johnnynunez
Copy link
Author

johnnynunez commented Dec 17, 2024

@johnnynunez
Copy link
Author

Probably @apwojcik can provide some insights. At least he participated in windows CI stage setup.

Why is not include in hip sdk if it is compiling on github runners?
I mean like amd comgr

As of ROCm version 6.1.2, the HIP SDK for Windows includes updated versions of the runtime components amdhip64 and amd_comgr. To use the latest capabilities of the HIP SDK, reference the new versions of these DLL binaries.

amdhip64_6.dll (formerly amdhip64.dll)

amd_comgr_2.dll (formerly amd_comgr.dll)
```

@johnnynunez
Copy link
Author

PS C:\Users\Johnny\Documents\GitHub\MIOpen\build> cmake .. `
>>     -DMIOPEN_BACKEND=HIP `
>>     -DCMAKE_PREFIX_PATH="C:/Users/Johnny/Documents/GitHub/vcpkg/installed/x64-windows" `
>>     -DCMAKE_CXX_FLAGS="--rocm-path='C:/Program Files/AMD/ROCm/6.2'" `
>>     -DROCM_PATH="C:\Program Files\AMD\ROCm\6.2" `
>>     -DCMAKE_LIBRARY_PATH="C:\Program Files\AMD\ROCm\6.2\lib" `
>>     -DCMAKE_PREFIX_PATH="C:\Program Files\AMD\ROCm\6.2" `
>>     -Dnlohmann_json_DIR="C:/Users/Johnny/Documents/GitHub/vcpkg/installed/x64-windows/share/nlohmann_json" `
>>     -G "Ninja" `
>>     -DMIOPEN_USE_MLIR=Off `
>>     -DMIOPEN_ENABLE_AI_KERNEL_TUNING=Off `
>>     -DMIOPEN_ENABLE_AI_IMMED_MODE_FALLBACK=Off `
>>     -DHALF_INCLUDE_DIR="C:/Users/Johnny/Documents/GitHub/vcpkg/installed/x64-windows/include" `
>>     -DMIOPEN_USE_COMPOSABLEKERNEL=Off `
>>     -DCMAKE_MAKE_PROGRAM="C:/tools/ninja/ninja.exe" `
>>     -DCMAKE_C_COMPILER="C:/Program Files/LLVM/bin/clang.exe" `
>>     -DCMAKE_CXX_COMPILER="C:/Program Files/LLVM/bin/clang++.exe" `
>>     -DBZIP2_INCLUDE_DIR="C:/Users/Johnny/Documents/GitHub/vcpkg/installed/x64-windows/include" `
>>     -DBZIP2_LIBRARIES="C:/Users/Johnny/Documents/GitHub/vcpkg/installed/x64-windows/lib/bz2.lib" `
>>     -DROCM_DIR="C:/Program Files/AMD/ROCm/6.2/cmake" `
>>     -DBUILD_TESTING=Off
CMake Deprecation Warning at /opt/rocm/share/rocm/cmake/ROCMConfig.cmake:12 (message):
  Use of find_package(ROCM) is deprecated as of ROCm 6.4.  Please use
  find_package(ROCmCMakeBuildTools)
Call Stack (most recent call first):
  CMakeLists.txt:83 (find_package)


-- MIOPEN_WORKAROUND_USE_BOOST_FILESYSTEM OFF
-- MIOPEN_OFFLINE_COMPILER_PATHS_V2: OFF
-- MIOPEN_BUILD_DRIVER: ON
-- Build with HIP 6.2.41512 C:/Program Files/AMD/ROCm/6.2/lib/cmake/hip
-- Enable Composable Kernels: Off
-- Hip compiler flags:  -x hip   -D__HIP_PLATFORM_AMD__=1  -DUSE_PROF_API=1 C:/Program Files/LLVM/lib/clang/18/lib/windows/clang_rt.builtins-x86_64.lib --hip-link  C:/Program Files/LLVM/lib/clang/18/lib/windows/clang_rt.builtins-x86_64.lib
-- OpenCL compiler: C:/Program Files/LLVM/bin/clang.exe
-- Build with rocblas 4.2.4 C:/Program Files/AMD/ROCm/6.2/lib/cmake/rocblas
-- Build without hipbBLASLt
-- HIP backend selected.
-- clang-offload-bundler found: C:/Program Files/LLVM/bin/clang-offload-bundler.exe
-- AMDGCN assembler: C:/Program Files/LLVM/bin/clang.exe
-- Build with amd_comgr
CMake Deprecation Warning at C:/Program Files/AMD/ROCm/6.2/lib/cmake/hiprtc/hiprtc-config.cmake:21 (cmake_minimum_required):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.
Call Stack (most recent call first):
  CMakeLists.txt:488 (find_package)


-- Build with hiprtc 6.2.41512 C:/Program Files/AMD/ROCm/6.2/lib/cmake/hiprtc
-- HALF_INCLUDE_DIR: C:/Users/Johnny/Documents/GitHub/vcpkg/installed/x64-windows/include
-- Build without rocTracer
-- Build with rocrand 3.1.1 C:/Program Files/AMD/ROCm/6.2/lib/cmake/rocrand
-- rocm-cmake: Set license file to C:/Users/Johnny/Documents/GitHub/MIOpen/LICENSE.txt.
-- Clang tidy found: 18.1.8
-- MIOpen_VERSION= 3.3.0
-- CMAKE_BUILD_TYPE= Release
-- Configuring done (3.8s)
-- Generating done (1.7s)
-- Build files have been written to: C:/Users/Johnny/Documents/GitHub/MIOpen/build
PS C:\Users\Johnny\Documents\GitHub\MIOpen\build> ninja
[0/2] Re-checking globbed directories...
[1/577] Building CXX object addkernels/CMakeFiles/addkernels.dir/addkernels.cpp.obj
FAILED: addkernels/CMakeFiles/addkernels.dir/addkernels.cpp.obj
C:\PROGRA~1\LLVM\bin\CLANG_~1.EXE -DBOOST_ALL_NO_LIB=1 -DHIP_COMPILER_FLAGS=" -x hip   -D__HIP_PLATFORM_AMD__=1  -DUSE_PROF_API=1 C:/Program Files/LLVM/lib/clang/18/lib/windows/clang_rt.builtins-x86_64.lib --hip-link  C:/Program Files/LLVM/lib/clang/18/lib/windows/clang_rt.builtins-x86_64.lib " -DMIOPEN_BETA_API=1 -DMIOPEN_HACK_DO_NOT_INCLUDE_CONFIG_H=1 -DMIOPEN_WORKAROUND_USE_BOOST_FILESYSTEM=0 -IC:/Users/Johnny/Documents/GitHub/MIOpen/src/include --rocm-path='C:/Program Files/AMD/ROCm/6.2' -O3 -DNDEBUG -std=c++17 -D_DLL -D_MT -Xclang --dependent-lib=msvcrt   -U__HCC__ -Wall -Wextra -Wcomment -Wendif-labels -Wformat -Winit-self -Wreturn-type -Wsequence-point -Wswitch -Wtrigraphs -Wundef -Wuninitialized -Wunreachable-code -Wunused -Wno-ignored-qualifiers -Wno-sign-compare -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-conversion -Wno-double-promotion -Wno-exit-time-destructors -Wno-extra-semi -Wno-extra-semi-stmt -Wno-float-conversion -Wno-gnu-anonymous-struct -Wno-gnu-zero-variadic-macro-arguments -Wno-missing-prototypes -Wno-nested-anon-types -Wno-option-ignored -Wno-padded -Wno-return-std-move-in-c++11 -Wno-shorten-64-to-32 -Wno-sign-conversion -Wno-unknown-warning-option -Wno-unused-command-line-argument -Wno-weak-vtables -Wno-covered-switch-default -Wno-unused-result -Wno-unsafe-buffer-usage -Wno-deprecated-declarations -Wno-shadow-uncaptured-local -Wno-global-constructors -Wno-reserved-identifier -Wno-zero-as-null-pointer-constant -Wno-ignored-attributes -Wno-deprecated -Wno-incompatible-pointer-types -Wno-old-style-cast -Wno-unknown-attributes -Wno-microsoft-cpp-macro -Wno-microsoft-enum-value -Wno-language-extension-token -Wno-c++11-narrowing -Wno-float-equal -Wno-redundant-parens -Wno-format-nonliteral -Wno-unused-template -Wno-comma -Wno-suggest-destructor-override -Wno-switch-enum -Wno-shift-sign-overflow -Wno-suggest-override -Wno-inconsistent-missing-destructor-override -Wno-cast-function-type -Wno-nonportable-system-include-path -Wno-documentation -Wno-deprecated-builtins -Wno-enum-constexpr-conversion -Wno-unused-value -Wno-unused-parameter -Wno-missing-noreturn -Wno-tautological-constant-out-of-range-compare -Wno-c++20-extensions -fdelayed-template-parsing -fms-extensions -fms-compatibility -MD -MT addkernels/CMakeFiles/addkernels.dir/addkernels.cpp.obj -MF addkernels\CMakeFiles\addkernels.dir\addkernels.cpp.obj.d -o addkernels/CMakeFiles/addkernels.dir/addkernels.cpp.obj -c C:/Users/Johnny/Documents/GitHub/MIOpen/addkernels/addkernels.cpp
clang++: error: no such file or directory: 'Files/AMD/ROCm/6.2''
[2/577] Building CXX object addkernels/CMakeFiles/addkernels.dir/include_inliner.cpp.obj
FAILED: addkernels/CMakeFiles/addkernels.dir/include_inliner.cpp.obj
C:\PROGRA~1\LLVM\bin\CLANG_~1.EXE -DBOOST_ALL_NO_LIB=1 -DHIP_COMPILER_FLAGS=" -x hip   -D__HIP_PLATFORM_AMD__=1  -DUSE_PROF_API=1 C:/Program Files/LLVM/lib/clang/18/lib/windows/clang_rt.builtins-x86_64.lib --hip-link  C:/Program Files/LLVM/lib/clang/18/lib/windows/clang_rt.builtins-x86_64.lib " -DMIOPEN_BETA_API=1 -DMIOPEN_HACK_DO_NOT_INCLUDE_CONFIG_H=1 -DMIOPEN_WORKAROUND_USE_BOOST_FILESYSTEM=0 -IC:/Users/Johnny/Documents/GitHub/MIOpen/src/include --rocm-path='C:/Program Files/AMD/ROCm/6.2' -O3 -DNDEBUG -std=c++17 -D_DLL -D_MT -Xclang --dependent-lib=msvcrt   -U__HCC__ -Wall -Wextra -Wcomment -Wendif-labels -Wformat -Winit-self -Wreturn-type -Wsequence-point -Wswitch -Wtrigraphs -Wundef -Wuninitialized -Wunreachable-code -Wunused -Wno-ignored-qualifiers -Wno-sign-compare -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-conversion -Wno-double-promotion -Wno-exit-time-destructors -Wno-extra-semi -Wno-extra-semi-stmt -Wno-float-conversion -Wno-gnu-anonymous-struct -Wno-gnu-zero-variadic-macro-arguments -Wno-missing-prototypes -Wno-nested-anon-types -Wno-option-ignored -Wno-padded -Wno-return-std-move-in-c++11 -Wno-shorten-64-to-32 -Wno-sign-conversion -Wno-unknown-warning-option -Wno-unused-command-line-argument -Wno-weak-vtables -Wno-covered-switch-default -Wno-unused-result -Wno-unsafe-buffer-usage -Wno-deprecated-declarations -Wno-shadow-uncaptured-local -Wno-global-constructors -Wno-reserved-identifier -Wno-zero-as-null-pointer-constant -Wno-ignored-attributes -Wno-deprecated -Wno-incompatible-pointer-types -Wno-old-style-cast -Wno-unknown-attributes -Wno-microsoft-cpp-macro -Wno-microsoft-enum-value -Wno-language-extension-token -Wno-c++11-narrowing -Wno-float-equal -Wno-redundant-parens -Wno-format-nonliteral -Wno-unused-template -Wno-comma -Wno-suggest-destructor-override -Wno-switch-enum -Wno-shift-sign-overflow -Wno-suggest-override -Wno-inconsistent-missing-destructor-override -Wno-cast-function-type -Wno-nonportable-system-include-path -Wno-documentation -Wno-deprecated-builtins -Wno-enum-constexpr-conversion -Wno-unused-value -Wno-unused-parameter -Wno-missing-noreturn -Wno-tautological-constant-out-of-range-compare -Wno-c++20-extensions -fdelayed-template-parsing -fms-extensions -fms-compatibility -MD -MT addkernels/CMakeFiles/addkernels.dir/include_inliner.cpp.obj -MF addkernels\CMakeFiles\addkernels.dir\include_inliner.cpp.obj.d -o addkernels/CMakeFiles/addkernels.dir/include_inliner.cpp.obj -c C:/Users/Johnny/Documents/GitHub/MIOpen/addkernels/include_inliner.cpp
clang++: error: no such file or directory: 'Files/AMD/ROCm/6.2''
[3/577] Building CXX object tools/sqlite2txt/CMakeFiles/sqlite2txt.dir/main.cpp.obj
FAILED: tools/sqlite2txt/CMakeFiles/sqlite2txt.dir/main.cpp.obj
C:\PROGRA~1\LLVM\bin\CLANG_~1.EXE -DBOOST_ALL_NO_LIB=1 -DHIP_COMPILER_FLAGS=" -x hip   -D__HIP_PLATFORM_AMD__=1  -DUSE_PROF_API=1 C:/Program Files/LLVM/lib/clang/18/lib/windows/clang_rt.builtins-x86_64.lib --hip-link  C:/Program Files/LLVM/lib/clang/18/lib/windows/clang_rt.builtins-x86_64.lib " -DMIOPEN_BETA_API=1 -isystem C:/Users/Johnny/Documents/GitHub/vcpkg/installed/x64-windows/include --rocm-path='C:/Program Files/AMD/ROCm/6.2' -O3 -DNDEBUG -std=c++17 -D_DLL -D_MT -Xclang --dependent-lib=msvcrt   -U__HCC__ -Wall -Wextra -Wcomment -Wendif-labels -Wformat -Winit-self -Wreturn-type -Wsequence-point -Wswitch -Wtrigraphs -Wundef -Wuninitialized -Wunreachable-code -Wunused -Wno-ignored-qualifiers -Wno-sign-compare -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-conversion -Wno-double-promotion -Wno-exit-time-destructors -Wno-extra-semi -Wno-extra-semi-stmt -Wno-float-conversion -Wno-gnu-anonymous-struct -Wno-gnu-zero-variadic-macro-arguments -Wno-missing-prototypes -Wno-nested-anon-types -Wno-option-ignored -Wno-padded -Wno-return-std-move-in-c++11 -Wno-shorten-64-to-32 -Wno-sign-conversion -Wno-unknown-warning-option -Wno-unused-command-line-argument -Wno-weak-vtables -Wno-covered-switch-default -Wno-unused-result -Wno-unsafe-buffer-usage -Wno-deprecated-declarations -Wno-shadow-uncaptured-local -Wno-global-constructors -Wno-reserved-identifier -Wno-zero-as-null-pointer-constant -Wno-ignored-attributes -Wno-deprecated -Wno-incompatible-pointer-types -Wno-old-style-cast -Wno-unknown-attributes -Wno-microsoft-cpp-macro -Wno-microsoft-enum-value -Wno-language-extension-token -Wno-c++11-narrowing -Wno-float-equal -Wno-redundant-parens -Wno-format-nonliteral -Wno-unused-template -Wno-comma -Wno-suggest-destructor-override -Wno-switch-enum -Wno-shift-sign-overflow -Wno-suggest-override -Wno-inconsistent-missing-destructor-override -Wno-cast-function-type -Wno-nonportable-system-include-path -Wno-documentation -Wno-deprecated-builtins -Wno-enum-constexpr-conversion -Wno-unused-value -Wno-unused-parameter -Wno-missing-noreturn -Wno-tautological-constant-out-of-range-compare -Wno-c++20-extensions -fdelayed-template-parsing -fms-extensions -fms-compatibility -MD -MT tools/sqlite2txt/CMakeFiles/sqlite2txt.dir/main.cpp.obj -MF tools\sqlite2txt\CMakeFiles\sqlite2txt.dir\main.cpp.obj.d -o tools/sqlite2txt/CMakeFiles/sqlite2txt.dir/main.cpp.obj -c C:/Users/Johnny/Documents/GitHub/MIOpen/tools/sqlite2txt/main.cpp
clang++: error: no such file or directory: 'Files/AMD/ROCm/6.2''
[4/577] Building CXX object src/sqlite/CMakeFiles/sqlite_memvfs.dir/memvfs.cpp.obj
FAILED: src/sqlite/CMakeFiles/sqlite_memvfs.dir/memvfs.cpp.obj
C:\PROGRA~1\LLVM\bin\CLANG_~1.EXE -DBOOST_ALL_NO_LIB=1 -DHIP_COMPILER_FLAGS=" -x hip   -D__HIP_PLATFORM_AMD__=1  -DUSE_PROF_API=1 C:/Program Files/LLVM/lib/clang/18/lib/windows/clang_rt.builtins-x86_64.lib --hip-link  C:/Program Files/LLVM/lib/clang/18/lib/windows/clang_rt.builtins-x86_64.lib " -DMIOPEN_BETA_API=1 -isystem C:/Users/Johnny/Documents/GitHub/vcpkg/installed/x64-windows/include --rocm-path='C:/Program Files/AMD/ROCm/6.2' -O3 -DNDEBUG -std=c++17 -D_DLL -D_MT -Xclang --dependent-lib=msvcrt   -U__HCC__ -Wall -Wextra -Wcomment -Wendif-labels -Wformat -Winit-self -Wreturn-type -Wsequence-point -Wswitch -Wtrigraphs -Wundef -Wuninitialized -Wunreachable-code -Wunused -Wno-ignored-qualifiers -Wno-sign-compare -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-conversion -Wno-double-promotion -Wno-exit-time-destructors -Wno-extra-semi -Wno-extra-semi-stmt -Wno-float-conversion -Wno-gnu-anonymous-struct -Wno-gnu-zero-variadic-macro-arguments -Wno-missing-prototypes -Wno-nested-anon-types -Wno-option-ignored -Wno-padded -Wno-return-std-move-in-c++11 -Wno-shorten-64-to-32 -Wno-sign-conversion -Wno-unknown-warning-option -Wno-unused-command-line-argument -Wno-weak-vtables -Wno-covered-switch-default -Wno-unused-result -Wno-unsafe-buffer-usage -Wno-deprecated-declarations -Wno-shadow-uncaptured-local -Wno-global-constructors -Wno-reserved-identifier -Wno-zero-as-null-pointer-constant -Wno-ignored-attributes -Wno-deprecated -Wno-incompatible-pointer-types -Wno-old-style-cast -Wno-unknown-attributes -Wno-microsoft-cpp-macro -Wno-microsoft-enum-value -Wno-language-extension-token -Wno-c++11-narrowing -Wno-float-equal -Wno-redundant-parens -Wno-format-nonliteral -Wno-unused-template -Wno-comma -Wno-suggest-destructor-override -Wno-switch-enum -Wno-shift-sign-overflow -Wno-suggest-override -Wno-inconsistent-missing-destructor-override -Wno-cast-function-type -Wno-nonportable-system-include-path -Wno-documentation -Wno-deprecated-builtins -Wno-enum-constexpr-conversion -Wno-unused-value -Wno-unused-parameter -Wno-missing-noreturn -Wno-tautological-constant-out-of-range-compare -Wno-c++20-extensions -fdelayed-template-parsing -fms-extensions -fms-compatibility -Wno-everything -MD -MT src/sqlite/CMakeFiles/sqlite_memvfs.dir/memvfs.cpp.obj -MF src\sqlite\CMakeFiles\sqlite_memvfs.dir\memvfs.cpp.obj.d -o src/sqlite/CMakeFiles/sqlite_memvfs.dir/memvfs.cpp.obj -c C:/Users/Johnny/Documents/GitHub/MIOpen/src/sqlite/memvfs.cpp
clang++: error: no such file or directory: 'Files/AMD/ROCm/6.2''
ninja: build stopped: subcommand failed.
PS C:\Users\Johnny\Documents\GitHub\MIOpen\build>

@CAHEK7
Copy link
Contributor

CAHEK7 commented Dec 24, 2024

Probably @apwojcik can provide some insights. At least he participated in windows CI stage setup.

Why is not include in hip sdk if it is compiling on github runners? I mean like amd comgr

As of ROCm version 6.1.2, the HIP SDK for Windows includes updated versions of the runtime components amdhip64 and amd_comgr. To use the latest capabilities of the HIP SDK, reference the new versions of these DLL binaries.

amdhip64_6.dll (formerly amdhip64.dll)

amd_comgr_2.dll (formerly amd_comgr.dll)

I guess because it is

  1. not compiled but github runners, at least for windows. But there are internal CI runs for some other non-related-to-miopen projects
  2. not a mandatory part of ROCm framework (while comgr is, it's kind of essential part of one of the runtime compilation schemes)

Also that's funny that some part of the build system can't handle spaces in the paths.

@johnnynunez
Copy link
Author

I guess because it is

  1. not compiled but github runners, at least for windows. But there are internal CI runs for some other non-related-to-miopen projects
  2. not a mandatory part of ROCm framework (while comgr is, it's kind of essential part of one of the runtime compilation schemes)

Also that's funny that some part of the build system can't handle spaces in the paths.

Well, we have to wait for rocm 7.0 that is unified stack

@justinkb
Copy link

justinkb commented Jan 10, 2025

it is possible, but the procedure is quite involved. I'll try to get some kind of clean script for this set up. you are going to need access to some cmake files and header files from a linux install of rocm, as well as a grab bag of fixes and dev packages for all kinds of libraries

edit: had fun this weekend setting this up, stay tuned, I'll probably provide the Dockerfile and build script later today. You can prepare by setting up a Docker Windows containers environment, which I decided to use since it is the cleanest way to build this without cluttering your host system with stuff you're never using otherwise.

@justinkb
Copy link

Please see my instructions here https://github.com/justinkb/MIOpen-Build-Win

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

No branches or pull requests

5 participants