hip: mathlibs inherit CudaPackage and ROCmPackage#34586
hip: mathlibs inherit CudaPackage and ROCmPackage#34586haampie merged 6 commits intospack:developfrom
Conversation
|
It's weird how the CI keeps trying to build for gfx701. I suspect it's because the amdgpu_target variant is underspecified in some specs. I've opened #34591 to try to prevent some of those weird failures. |
|
@spackbot rerun pipeline edit: opps. wrong PR. |
|
I've started that pipeline for you! |
|
The ROCmPackage default of ( |
767c107 to
e99b92a
Compare
e99b92a to
3e59444
Compare
This is unfortunate. It means that |
Unless the amdgpu_target is overriden, the libraries will default to being built for cuda, since amdgpu_target=none is both default and in conflict with +rocm. This requires a custom Disjoint set to include both the 'auto' variant used by the rocm mathlibs and the 'none' variant used by ROCmPackage.
|
@haampie, @renjithravindrankannath, @srekolam, please review these changes. I've made some changes so that this PR doesn't have to wait on #35233 and #35316. The custom disjoint set that is needed for this is a bit ugly, but the awfulness is at least contained to these libraries. I explicitly avoided extracting it into a function to ensure that it doesn't get used elsewhere. We can remove it once the amdgpu_target is properly detected. The custom disjoint set is exactly the same as the amdgpu_target variant from ROCmPackage, but it adds the value of Once there is proper amdgpu_target detection logic in spack (both for concretizing specs and for external find), then the |
|
*poke* |
srekolam
left a comment
There was a problem hiding this comment.
@cgmb sorry for being late on this. I looked at your changes and i took your changes on my local spack repository and build hipfft+ cuda and [email protected]. It built both versions successfully.
A couple of observations with the hip. When i execute the hipcc and hipconfig from both the installed prefix paths of hip + rocm and hip+cuda, i see it always points to cuda driver ..
PR-34586.txt
same with hipconfig too.. Just trying to check with you on this.
|
@cgmb , Please excuse my delayed response. I tried hip-targets-release.cmake and hip-targets.cmake are missing under the lib/cmake/hip/ path |
This patch is not strictly necessary, but it may fix the search for HIP in certain environments.
You need to I can't reproduce this, but it looks like a bug in hipcub. The hip-config.cmake file is getting picked up by this call to find_package(hip QUIET CONFIG ...). I've added a couple patches in d2fcda2 to try to fix it for This is a bug in hipsparse. It doesn't support newer versions of CUDA. I've backported the fix in 9fc769d.
That is normal. HIP does not yet support config mode search on the NVIDIA platform. |
Thanks @cgmb . hipcub and hipsparse built successfully for cuda variant. |
| patch("find-hip-cuda-rocm-5.1.patch", when="@5.1:5.2 +cuda") | ||
| patch("find-hip-cuda-rocm-5.3.patch", when="@5.3: +cuda") | ||
|
|
||
| def setup_build_environment(self, env): |
There was a problem hiding this comment.
i see setup_build_environment had been removed for other recipes in the PR except for hipcub. Any reason why. Otherwise i am okay with the changes.
There was a problem hiding this comment.
hipblas, hipsolver, hipfft and hipsparse are all written in C++ and can be built with a normal C++ compiler, but hipCUB is written in the HIP language and requires a HIP compiler.
This change enables hipblas, hipsolver, hipsparse, hipfft, and hipcub to be built for either ROCm or CUDA. The
+rocmvariant is the default (to match the previous behaviour). However, the newamdgpu_targetvariant is required (as that's how ROCmPackage works).Related: #33872