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

Building rocBLAS for CUDA backend fails #603

Closed
torrance opened this issue May 30, 2023 · 2 comments
Closed

Building rocBLAS for CUDA backend fails #603

torrance opened this issue May 30, 2023 · 2 comments
Assignees

Comments

@torrance
Copy link

I'm building using CMake directly[1] for CUDA backend:

# On branch release/rocm-rel-5.5
mkdir build && cd build
cmake -DUSE_CUDA=ON -DHIP_ROOT_DIR=/opt/rocm ..
make

Scanning dependencies of target hipblas_fortran
[ 20%] Building Fortran object library/src/CMakeFiles/hipblas_fortran.dir/hipblas_module.f90.o
[ 40%] Linking Fortran shared library libhipblas_fortran.so
[ 40%] Built target hipblas_fortran
[ 60%] Building CXX object library/src/CMakeFiles/hipblas.dir/nvidia_detail/hipblas.cpp.o
In file included from /home/torrance/hipBLAS/library/src/nvidia_detail/hipblas.cpp:27:
/usr/local/cuda/include/cublas_v2.h:59:2: error: #error "It is an error to include both cublas.h and cublas_v2.h"
   59 | #error "It is an error to include both cublas.h and cublas_v2.h"
      |  ^~~~~

I can compile with the following changes, though I don't know if this is properly functional or not:

diff --git a/library/src/nvidia_detail/hipblas.cpp b/library/src/nvidia_detail/hipblas.cpp
index b60a31d..08a6257 100644
--- a/library/src/nvidia_detail/hipblas.cpp
+++ b/library/src/nvidia_detail/hipblas.cpp
@@ -23,7 +23,7 @@

 #include "hipblas.h"
 #include "exceptions.hpp"
-#include <cublas.h>
+//#include <cublas.h>
 #include <cublas_v2.h>
 #include <cuda_runtime_api.h>
 #include <hip/hip_runtime.h>
@@ -350,7 +350,7 @@ hipblasStatus_t hipblasGetPointerMode(hipblasHandle_t handle, hipblasPointerMode
 try
 {
     cublasPointerMode_t cublasMode;
-    cublasStatus        status = cublasGetPointerMode((cublasHandle_t)handle, &cublasMode);
+    cublasStatus_t        status = cublasGetPointerMode((cublasHandle_t)handle, &cublasMode);
     *mode                      = CudaPointerModeToHIPPointerMode(cublasMode);
     return hipCUBLASStatusToHIPStatus(status);
 }

[1] i.e. not using the install.sh script, though the error is present in both obviously. Honestly though, why this install script, when the rest of the hip ecosystem uses CMake? And why default to making a .deb package?

Environment

Hardware description
GPU Tesla T4
CPU Intel(R) Xeon(R) Gold 6254 CPU @ 3.10GHz
Software version
HIP v5.5
CUDA 12.1
@daineAMD
Copy link
Contributor

Hi @torrance, thanks for opening.

Looks like including both cublas.h and cublas_v2.h is no longer allowed in cuda 12. Appears that cublasStatus was also removed after being replaced by cublasStatus_t a while back, I guess that was missed in the past.

Your changes built fine for me on both cuda 11 and cuda 12. I've opened #605 with your changes.

Thanks,
Daine

@daineAMD
Copy link
Contributor

daineAMD commented Jun 8, 2023

Hi @torrance,

I've added the fixes in develop at 55dc014a and as a hot-fix into ROCm 5.7 at aadde8ae.

Thanks again for bringing this up and having a fix ready! I'll close the ticket now.

Daine

@daineAMD daineAMD closed this as completed Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants