Comments (14)
Looks like an issue with your environment. Can you compile other rocm libraries successfully?
from rocalution.
-- Found HIP: /opt/rocm-dev2/hip (found version "5.1.20531-")
I don't think it's the cause of the build failures you're describing here, but that version number looks like it may suffer from the problem described in ROCm/HIP#2218. You may want to apply the second patch in this gist before building hipamd.
from rocalution.
@ntrost57 Thanks for helping me with this one. What makes you think so? I have managed to build several other ROCm libraries (using hipcc) with no issue; for instance, rocRAND, rocSPARSE, rocSOLVER. On the other hand, I am having issues with rocFFT as well but again it seems a programming error to me.
May be some CMake option I am missing? It would be very helpful if you could you share with me the CMake options you use to build this library :)
@cgmb Thank you Cory for your prompt help, once again! I took note of that patch and added it to my build process.
from rocalution.
Can you try install.sh
script for compilation?
from rocalution.
I can't use the install script because of the reasons listed in this other similar issue. But I went through your install script and I believe that the issue is the option
[line 21] echo " [--host] build library for host backend only"
Might be that ${build_host}
is set to true
in your testing and then the code
# HIP / Host only
if [[ "${build_host}" == true ]]; then
cmake_common_options="${cmake_common_options} -DSUPPORT_HIP=OFF"
else
cmake_common_options="${cmake_common_options} -DSUPPORT_HIP=ON"
fi
disables HIP support? Then you wouldn't compile the above code that gives me error.
To confirm this, i will try to compile with -DSUPPORT_HIP=OFF
. But what are the implications? The code will only run on CPU right?
from rocalution.
We are testing for both, host and device build. If you compile with -DSUPPORT_HIP=OFF
the code will only run on CPU.
I am not able to reproduce the error you see, using rocm-5.1.1 with posted commit id running the given cmake command on Ubuntu 20.04.
from rocalution.
@ntrost57 would you post your cmake configuration here? I have noticed that my version of hip is 5.1.2xx, you might be using 5.1.1? To obtain the rocm repositories i followed the instructions in your website and used the repo
command. It checked out the branch 5.1.x
of the rocm repository, where instructions to download all repositories are stored. So i might be using a newer version of hip than you. I am not on my laptop now, but I'll post the exact version (commit hash) of hip I am using, maybe the bug is there
from rocalution.
I have been using HIP 5.1.20531-cacfa990 (rocm-5.1.1) what is exactly what you pasted in the logs.
You can use the rocm/dev-ubuntu-20.04:latest
docker image for a clean rocm-5.1.1 installation. After installing rocsparse, rocblas, rocprim and rocrand, you should be able to successfully build rocalution.
from rocalution.
@ntrost57 that is very interesting. I am currently using a VM to try the build but ultimately I need to install ROCm on a supercomputer, so I would like to avoid containers. Coming back to the error I get, looks like the problem is that the *
operator is called on two object of std::complex<double>
. The overloaded function to handle this operation is defined in the standard library and is host code that can't be called within a kernel unless it has been redefined to have also the __device__
attribute. So it seems you have such definition in your HIP installation, and I don't. I will dig more into it, hopefully I will find a way to solve this.
from rocalution.
Ran into the same issue with 5.1.3. Wrote this workaround:
diff --git a/src/base/hip/hip_vector.hpp b/src/base/hip/hip_vector.hpp
index 0444528..a432359 100644
--- a/src/base/hip/hip_vector.hpp
+++ b/src/base/hip/hip_vector.hpp
@@ -30,11 +30,77 @@
#include "../base_vector.hpp"
#include <hip/hip_runtime.h>
+#include <hip/amd_detail/amd_hip_complex.h>
#include <complex>
#include "hip_rand.hpp"
+#if defined(__HIPCC_RTC__)
+#define __HOST_DEVICE__ __device__
+#else
+#define __HOST_DEVICE__ __host__ __device__
+#endif // !defined(__HIPCC_RTC__)
+
+// Gotta put these somewhere
+__HOST_DEVICE__ inline std::complex<float> operator+(const std::complex<float> a, const std::complex<float> b)
+{
+ auto ahip = make_hipFloatComplex(a.real(), a.imag());
+ auto bhip = make_hipFloatComplex(b.real(), b.imag());
+ auto res = a+b;
+ return res;
+}
+__HOST_DEVICE__ inline std::complex<float> operator-(const std::complex<float> a, const std::complex<float> b)
+{
+ auto ahip = make_hipFloatComplex(a.real(), a.imag());
+ auto bhip = make_hipFloatComplex(b.real(), b.imag());
+ auto res = a-b;
+ return res;
+}
+__HOST_DEVICE__ inline std::complex<float> operator*(const std::complex<float> a, const std::complex<float> b)
+{
+ auto ahip = make_hipFloatComplex(a.real(), a.imag());
+ auto bhip = make_hipFloatComplex(b.real(), b.imag());
+ auto res = a*b;
+ return res;
+}
+__HOST_DEVICE__ inline std::complex<float> operator/(const std::complex<float> a, const std::complex<float> b)
+{
+ auto ahip = make_hipFloatComplex(a.real(), a.imag());
+ auto bhip = make_hipFloatComplex(b.real(), b.imag());
+ auto res = a/b;
+ return res;
+}
+
+__HOST_DEVICE__ inline std::complex<double> operator+(const std::complex<double> a, const std::complex<double> b)
+{
+ auto ahip = make_hipDoubleComplex(a.real(), a.imag());
+ auto bhip = make_hipDoubleComplex(b.real(), b.imag());
+ auto res = a+b;
+ return res;
+}
+__HOST_DEVICE__ inline std::complex<double> operator-(const std::complex<double> a, const std::complex<double> b)
+{
+ auto ahip = make_hipDoubleComplex(a.real(), a.imag());
+ auto bhip = make_hipDoubleComplex(b.real(), b.imag());
+ auto res = a-b;
+ return res;
+}
+__HOST_DEVICE__ inline std::complex<double> operator*(const std::complex<double> a, const std::complex<double> b)
+{
+ auto ahip = make_hipDoubleComplex(a.real(), a.imag());
+ auto bhip = make_hipDoubleComplex(b.real(), b.imag());
+ auto res = a*b;
+ return res;
+}
+__HOST_DEVICE__ inline std::complex<double> operator/(const std::complex<double> a, const std::complex<double> b)
+{
+ auto ahip = make_hipDoubleComplex(a.real(), a.imag());
+ auto bhip = make_hipDoubleComplex(b.real(), b.imag());
+ auto res = a/b;
+ return res;
+}
+
namespace rocalution
{
template <typename ValueType>
from rocalution.
Aaand now I'm realizing what I wrote doesn't even use the converted ahip = ...
. Hm but it does compile though
from rocalution.
Thanks for your input @stepannassyr. Indeed it is very strange, to be honest looks like a recursive definition that never ends.. so not sure it will work at runtime. I think there is definitely an issue somewhere in rocm..
from rocalution.
This issue is not present anymore in ROCm 5.2, although I found another one in rocALUTION/src/solvers/multigrid/ruge_stueben_amg.hpp
:
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32)
#else
[[deprecated("This function will be removed in a future release. Use "
"SetStrengthThreshold() instead")]]
#endif
Had to remove the code in the else
block because it wouldnt compile using hipcc (clang-14).
from rocalution.
Hello @dipietrantonio. As the original issue is resolved, I am closing this issue.
The new comment about ruge_stueben_amg.hpp is copied to a new issue (#151).
from rocalution.
Related Issues (20)
- RPATH is missing from ROCm 5.0.0 release HOT 1
- issues being closed without fixing why???
- How to use a BCSR matrix? HOT 6
- Please enable two factor authentication in your github account
- Global HOT 8
- ruge_stueben_amg.hpp does not compile with hipcc (clang-14) HOT 3
- Performance issue with cg_mpi running on 2 GPU or more HOT 3
- ifdef SUPPORT_MULTINODE HOT 2
- CPU-GPU copies instead of GPU-GPU MPI communications in cg_mpi ? HOT 7
- rocALUTION for fortran HOT 12
- Problem with distribute_matrix in common.hpp HOT 2
- Directly update (set/add) LocalMatrix accelerator values HOT 6
- Files tagged with HIP_SOURCE_PROPERTY_FORMAT generate wrong HIP_CLANG_PATH HOT 6
- rocALUTION build following ROCm versions HOT 5
- readthedocs.io documentation missing HOT 3
- PairwiseAMG crash in parallel HOT 2
- Sample cg-rsamg_mpi crashes in parallel (RugeStuebenAMG) HOT 1
- HIP error: invalid device function HOT 1
- [Clarification Needed] Accessing linear systems data already stored on GPU(s) in rocThrust data structures HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rocalution.