Skip to content

Fix errors and warnings with CUDA 9.0 builds #2923

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

Merged
merged 4 commits into from
Jun 5, 2020

Conversation

umar456
Copy link
Member

@umar456 umar456 commented Jun 5, 2020

  • The rdc and dlink flags are not required because they are added
    by CMake for separable compilation and static linking respectively
  • Add guards around libs that are not included in the CUDA 9.0
    Toolkit
  • Only link with OpenMP when linking with cuSOLVER dynamically
  • Fix error message when CUDNN is not found
  • Address casts from double to __half which are missing in 9.0
  • Thrust return_temporary_buffer function can accept void* pointers
    in older versions of Thrust. Use raw_pointer_cast to pass the
    pointer to memFree
  • cublasGemmEx doesn't exist in CUDA 9.0. Add ifdefs to guard
    against older builds
  • __float2half is not a host function so it needs to be removed
    from mean
  • Add template instantiation for memFree to accept void* pointers
  • CUSOLVER_CHECK error message printed "CUBLAS Error" instead of
    CUSOLVER Error

umar456 added 3 commits June 5, 2020 01:13
* The rdc and dlink flags are not required because they are added
  by CMake for separable compilation and static linking respectively
* Add guards around libs that are not included in the CUDA 9.0
  Toolkit
* Only link with OpenMP when linking with cuSOLVER dynamically
* Fix error message when CUDNN is not found
* Address casts from double to __half which are missing in 9.0
* Thrust return_temporary_buffer function can accept void* pointers
  in older versions of Thrust. Use raw_pointer_cast to pass the
  pointer to memFree
* cublasGemmEx doesn't exist in CUDA 9.0. Add ifdefs to guard
  against older builds
* __float2half is not a host function so it needs to be removed
  from mean
* Add template instantiation for memFree to accept void* pointers
CUSOLVER_CHECK error message printed "CUBLAS Error" instead of
CUSOLVER Error
@umar456 umar456 added the CUDA label Jun 5, 2020
@umar456 umar456 added this to the 3.7.2 milestone Jun 5, 2020
Copy link
Member

@9prady9 9prady9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have checked with toolkits 10 with separable ON and OFF on my system again just to be sure. Surprisingly it does work without the flags. I clearly remember it giving issues earlier. Perhaps, the reorganization I did w.r.t sources of cuda::{thrus,scan} and the static lib cleared out an indirect issue.

target_link_libraries(af_cuda_static_cuda_library
PRIVATE
${CUDA_cublasLt_static_LIBRARY}
${CUDA_lapack_static_LIBRARY})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, these are not there prior to toolkit 10 - I should have thought about this

${CUDA_cusparse_static_LIBRARY}
${cusolver_static_lib}
-Wl,--end-group
)

if(CUDA_VERSION VERSION_GREATER 9.5)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think a better check to avoid any unexpected issues (with decimals and all against different cmake versions) with cmake is to do

if(CUDA_VERSION_MAJOR VERSION_GREATER 9)

On another note, I will take care of this with some other change.

@@ -71,8 +71,9 @@ void generateBufferRead(std::stringstream& kerStream, int id,
<< "];\n";
}

void generateShiftNodeOffsets(std::stringstream& kerStream, int id,
bool is_linear, const std::string& type_str) {
inline void generateShiftNodeOffsets(std::stringstream& kerStream, int id,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: looks like this is just to make the compiler silent even though this won't be actually inlined.

@9prady9 9prady9 merged commit d2df83d into arrayfire:master Jun 5, 2020
@umar456 umar456 deleted the old_cuda branch June 26, 2020 18:35
@umar456 umar456 mentioned this pull request Jun 27, 2020
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants