cublas linker error 4.1 and 4.2
Hello all,

I have 64-bit Linux Ubuntu 10.04.

Previously I had cuda toolkit version 4.0. Recently I installed 4.1 and got a linker error when recompiling existing code. I reinstalled 4.0 and all was ok again. Today I installed version 4.2 and it gives the same linker error too. The error is:

CUDAPACKAGE/ipdiagsolver/CG.o: In function `cublasSdot':
tmpxft_0000371e_00000000-1_CG.cudafe1.cpp:(.text+0x1c): undefined reference to `cublasGetCurrentCtx'
tmpxft_0000371e_00000000-1_CG.cudafe1.cpp:(.text+0x5b): undefined reference to `cublasSetError'
collect2: ld returned 1 exit status
make: *** [lin_wacu] Error 1

Needless to say, my source code is unchanged. I checked in /usr/local/cuda/lib with readelf -Ws * | grep cublasSetError.
No symbol is reported at all. Neither in version 4.1 nor in version 4.2.

I removed /usr/local/cuda and re-installed 4.0 again. My code now compiles again and the above readelf command now displays:

164: 00052c40 101 FUNC GLOBAL DEFAULT 11 cublasSetError
164: 00052c40 101 FUNC GLOBAL DEFAULT 11 cublasSetError
164: 00052c40 101 FUNC GLOBAL DEFAULT 11 cublasSetError

This seems a bug to me.

Anyone has the same problem? (and solved it?)

Cheers, Anneke
Hello all,



I have 64-bit Linux Ubuntu 10.04.



Previously I had cuda toolkit version 4.0. Recently I installed 4.1 and got a linker error when recompiling existing code. I reinstalled 4.0 and all was ok again. Today I installed version 4.2 and it gives the same linker error too. The error is:



CUDAPACKAGE/ipdiagsolver/CG.o: In function `cublasSdot':

tmpxft_0000371e_00000000-1_CG.cudafe1.cpp:(.text+0x1c): undefined reference to `cublasGetCurrentCtx'

tmpxft_0000371e_00000000-1_CG.cudafe1.cpp:(.text+0x5b): undefined reference to `cublasSetError'

collect2: ld returned 1 exit status

make: *** [lin_wacu] Error 1



Needless to say, my source code is unchanged. I checked in /usr/local/cuda/lib with readelf -Ws * | grep cublasSetError.

No symbol is reported at all. Neither in version 4.1 nor in version 4.2.



I removed /usr/local/cuda and re-installed 4.0 again. My code now compiles again and the above readelf command now displays:



164: 00052c40 101 FUNC GLOBAL DEFAULT 11 cublasSetError

164: 00052c40 101 FUNC GLOBAL DEFAULT 11 cublasSetError

164: 00052c40 101 FUNC GLOBAL DEFAULT 11 cublasSetError



This seems a bug to me.



Anyone has the same problem? (and solved it?)



Cheers, Anneke

#1
Posted 05/01/2012 11:32 AM   
Hi,
I'm no cublas developer but I just checked quickly the various cublas documentation I've got here and AFAICS, cublasSetError is never mentioned. Thus it looks like you used an undocumented function in your code, which has been removed from the library. AAMOF, since the new cublas API removes the need of getting error status using cublasGetError (but keeps the function for portability), removing the non-documented function cublasSetError seems like a natural choice.
Maybe you should consider adapting your code to the new API, extending its potential lifespan, or maybe you could open a bug to complain about it.
Hi,

I'm no cublas developer but I just checked quickly the various cublas documentation I've got here and AFAICS, cublasSetError is never mentioned. Thus it looks like you used an undocumented function in your code, which has been removed from the library. AAMOF, since the new cublas API removes the need of getting error status using cublasGetError (but keeps the function for portability), removing the non-documented function cublasSetError seems like a natural choice.

Maybe you should consider adapting your code to the new API, extending its potential lifespan, or maybe you could open a bug to complain about it.

#2
Posted 05/01/2012 12:00 PM   
I have the same problem on mac os 16.6.8 on cuda toolkit version 4.1.
I get:

[i]Undefined symbols:
"_cublasSetError"

"_cublasGetCurrentCtx"
ld: symbol(s) not found[/i]

I don't really want to update to cuda toolkit version 4.2 yet.
Did you manage to solve this Anneke?

[quote name='asicherer' date='01 May 2012 - 12:32 PM' timestamp='1335871947' post='1402976']
Hello all,

I have 64-bit Linux Ubuntu 10.04.

Previously I had cuda toolkit version 4.0. Recently I installed 4.1 and got a linker error when recompiling existing code. I reinstalled 4.0 and all was ok again. Today I installed version 4.2 and it gives the same linker error too. The error is:

CUDAPACKAGE/ipdiagsolver/CG.o: In function `cublasSdot':
tmpxft_0000371e_00000000-1_CG.cudafe1.cpp:(.text+0x1c): undefined reference to `cublasGetCurrentCtx'
tmpxft_0000371e_00000000-1_CG.cudafe1.cpp:(.text+0x5b): undefined reference to `cublasSetError'
collect2: ld returned 1 exit status
make: *** [lin_wacu] Error 1

Needless to say, my source code is unchanged. I checked in /usr/local/cuda/lib with readelf -Ws * | grep cublasSetError.
No symbol is reported at all. Neither in version 4.1 nor in version 4.2.

I removed /usr/local/cuda and re-installed 4.0 again. My code now compiles again and the above readelf command now displays:

164: 00052c40 101 FUNC GLOBAL DEFAULT 11 cublasSetError
164: 00052c40 101 FUNC GLOBAL DEFAULT 11 cublasSetError
164: 00052c40 101 FUNC GLOBAL DEFAULT 11 cublasSetError

This seems a bug to me.

Anyone has the same problem? (and solved it?)

Cheers, Anneke
[/quote]
I have the same problem on mac os 16.6.8 on cuda toolkit version 4.1.

I get:



Undefined symbols:

"_cublasSetError"



"_cublasGetCurrentCtx"

ld: symbol(s) not found




I don't really want to update to cuda toolkit version 4.2 yet.

Did you manage to solve this Anneke?



[quote name='asicherer' date='01 May 2012 - 12:32 PM' timestamp='1335871947' post='1402976']

Hello all,



I have 64-bit Linux Ubuntu 10.04.



Previously I had cuda toolkit version 4.0. Recently I installed 4.1 and got a linker error when recompiling existing code. I reinstalled 4.0 and all was ok again. Today I installed version 4.2 and it gives the same linker error too. The error is:



CUDAPACKAGE/ipdiagsolver/CG.o: In function `cublasSdot':

tmpxft_0000371e_00000000-1_CG.cudafe1.cpp:(.text+0x1c): undefined reference to `cublasGetCurrentCtx'

tmpxft_0000371e_00000000-1_CG.cudafe1.cpp:(.text+0x5b): undefined reference to `cublasSetError'

collect2: ld returned 1 exit status

make: *** [lin_wacu] Error 1



Needless to say, my source code is unchanged. I checked in /usr/local/cuda/lib with readelf -Ws * | grep cublasSetError.

No symbol is reported at all. Neither in version 4.1 nor in version 4.2.



I removed /usr/local/cuda and re-installed 4.0 again. My code now compiles again and the above readelf command now displays:



164: 00052c40 101 FUNC GLOBAL DEFAULT 11 cublasSetError

164: 00052c40 101 FUNC GLOBAL DEFAULT 11 cublasSetError

164: 00052c40 101 FUNC GLOBAL DEFAULT 11 cublasSetError



This seems a bug to me.



Anyone has the same problem? (and solved it?)



Cheers, Anneke

#3
Posted 05/02/2012 11:01 AM   
Scroll To Top