error: unknown argument: -fno-offload-uniform-block
The handling of WORKAROUND_SWDEV_413293 assumes a compile and does not check if passing -fno-offload-uniform-block is valid adding without checking in CMakeLists.txt
On Fedora Rawhide/F40, this is clang 17 clang version 17.0.6 (Fedora 17.0.6-6.fc40) The latest release of clang.
The option -fno-offload-uniform-block is in the to be released clang 18. It would be better to use check_cxx_compiler_flag() here.
@trixirt Thanks for reporting the issue and proposing a way for fixing it.
It seems like you are not using clang from ROCm, please switch to it. If you are building MIOpen from sources, please use CXX='/opt/rocm/llvm/bin/clang++' cmake ...
check_cxx_compiler_flag() works only during the the building of the library. This won't work if the end user installs pre-built package.
Hope this helps.
[Notice] Clang from ROCm 6.0.0 supports -fno-offload-uniform-block but reports:
/opt/rocm/llvm/bin/clang++ --version
AMD clang version 17.0.0 (https://github.com/RadeonOpenCompute/llvm-project roc-6.0.0 23483 7208e8d15fbf218deb74483ea8c549c67ca4985e)
I am packaging MIOpen for Fedora, so the Fedora clang compiler is required.
@trixirt Hmm... But MIOpen needs HIP runtime at least to work (and the latter is a part of ROCm). Which version of ROCm is expected to be installed on the target Fedora system?
/cc @JehandadKhan @junliume
Does something need to change in the compiler?
Does something need to change in the compiler?
@bcahoon -fno-offload-uniform-block is not yet upstreamed? What would be the best practice for libraries to use it?
Fedora has packaged up a large part of the ROCm 6.0 stack, all of the dependencies needed to build miopen are also in Fedora. ck and rocmlir are not yet in Fedora, ck because of build problems and rocmlir because of a clang fork. So these two configs are turned off in the miopen build.
All of the ROCm packages in Fedora are built with the system clang.
so though the -fno-offload-uniform-block has been upstreamed, it will not be usable by Fedora until clang 18 is released and Fedora updates to clang 18. So i am asking the the option be checked before it is used, here in the cmakelist.txt and src/comgr.cpp
@trixirt 👌 Feature request accepted. Well, basically, this is W/A for current Fedora. Please let us know the importance/urgency of this.
@trixirt Please also let us know which version (or branch/git hash) of MIOpen are you using.
tag: rocm-6.0.0, releases/rocm-rel-6.0 miopen is a dependency for pytorch, when pytorch 2.3 is released, it will be build with rocm 6.x Fedora's pytorch.
@trixirt This is a patch for MIOpen tag: rocm-6.0.0 (branch release/rocm-rel-6.0 commit f34a90f76). Please give it a try and let me know if it resolves the problem. By-product: Fix build with -DMIOPEN_USE_COMPOSABLEKERNEL=off for 6.0 release.
@bcahoon -fno-offload-uniform-block is not yet upstreamed? What would be the best practice for libraries to use it?'
Hi @atamazov, the -fno-offload-unfiform-block option has been upstreamed, but it was added after the 17.0.6 clang release that is used/mentioned in the previous comment.
I think your commit addresses the original issue.
@bcahoon Yeah, thanks for feedback.
@trixirt PRs #2741 and #2743 will remain in the DRAFT state until we get your confirmation that patch resolves the issue.
@trixirt We need your feedback, please.
Looks good, here is where I am using it fedora's miopen specfile