Closed pierrepaleo closed 4 years ago
I would still keep the call to cublasGetVersion()
as a means of final resort (it's evidently necessary on MacOS anyway), but using os.path.realpath()
to follow library symlinks and thereby reduce the likelihood of cublasGetVersion()
having to be called seems like a good idea - skcuda/utils.py
updated.
The function
_get_cublas_version()
ofcublas.py
sometimes creates a CUBLAS context to get the version number. This can sometimes be avoided.The relevant part of the code finding the cublas library version is:
The regexp search succeeds with names like
libcublas.so.9.1.85
, but fails where there is only the "major version number", ex.libcublas.so.10
. However, the library filenamecublas_path
is often actually a symbolik link (at least on Debian-based distribution, I don't know for the other Linux distributions/OS). So following the symbolic link withos.path.realpath(cublas_path)
gives a file name with the correctmajor.minor.patch
name that can be matched with the regexp.One possible drawback is that the
objdump
command stills returns the "incomplete" file name, ex.Would it make sense to modify
_get_cublas_version()
to avoid creating a CUBLAS context in this case ?