Where is the CUDA 4.0 Driver API .lib file ? I can't find the Driver API .lib file in the CUDA 4
Hello everyone,

I'm trying to use the CUDA 4.0 Driver API in XP using the Microsoft Visual C++ 6.0 compiler.

I've had great success with same using the CUDA 3.2 SDK, but when I downloaded the 4.0 SDK, to my shock and dismay, I couldn't find the .lib file to link with !!

Does anyone know where it is, or how to make it?

I've tried linking with all the .lib files I could find in the entire 4.0 SDK, but to no avail.

I did find what is probably the CUDA runtime .dll file, which is called, "cudart32_40_17.dll", but where's the .lib file that allows me to link to it??

Or are we supposed to, I dunno, call LoadLibrary() for every Driver API function that we want to use? That seems a bit, well, stupid to me, excuse me for saying so..

Along those lines though, I did notice that in the .h file (cuda_drvapi_dynlink_cuda.h), all of the Driver API function names were listed as external function [b][i]pointers[/i][/b] rather than external functions. That might be related to the lack of a .lib file, but where are those pointers?

Can anyone help me out here ?

Thanks in advance.
Hello everyone,



I'm trying to use the CUDA 4.0 Driver API in XP using the Microsoft Visual C++ 6.0 compiler.



I've had great success with same using the CUDA 3.2 SDK, but when I downloaded the 4.0 SDK, to my shock and dismay, I couldn't find the .lib file to link with !!



Does anyone know where it is, or how to make it?



I've tried linking with all the .lib files I could find in the entire 4.0 SDK, but to no avail.



I did find what is probably the CUDA runtime .dll file, which is called, "cudart32_40_17.dll", but where's the .lib file that allows me to link to it??



Or are we supposed to, I dunno, call LoadLibrary() for every Driver API function that we want to use? That seems a bit, well, stupid to me, excuse me for saying so..



Along those lines though, I did notice that in the .h file (cuda_drvapi_dynlink_cuda.h), all of the Driver API function names were listed as external function pointers rather than external functions. That might be related to the lack of a .lib file, but where are those pointers?



Can anyone help me out here ?



Thanks in advance.

#1
Posted 01/11/2012 01:29 PM   
Well, still working on this, but I'm closer now..

I don't know why NVidia decided to get rid of the import library for the CUDA Driver API in their 4.0 SDK, but it looks like they have.

In its place is a C file, "cuda_drvapi_dynlink.c", which, to make a long story short, I gather you're supposed to [b][i]include[/i][/b] in one of your source code modules (as opposed to just adding it to your project). It basically just calls LoadLibrary() and GetProcAddress() for all of the CUDA Driver API functions, yielding a whole mess of globally accessible function pointers, which can then be used to call into the CUDA Driver API..

Why isn't that salient little fact mentioned anywhere in the docs?

From this file, I was able to glean that the CUDA Driver API functions are all in the CUDA Driver itself, which is the file, "nvcuda.dll". Apparently, there are two of them, one for 64-bit, and one for 32-bit.

So on a 64-bit Win 7 machine, which is what I'm using, you end up with the 64-bit version of "nvcuda.dll" (6.29 MB) residing in "C:\Windows\system32", and the 32-bit version (4.70 MB) residing in "C:\Windows\SysWOW64".

All very well and good, except that my compiled 32-bit program's LoadLibrary() call fails when it tries to load the 32-bit version of "nvcuda.dll". So I'm still stumped..

Anyone still listening? Anyone have any suggestions at this point (other than, "buy a newer compiler!") ?
Well, still working on this, but I'm closer now..



I don't know why NVidia decided to get rid of the import library for the CUDA Driver API in their 4.0 SDK, but it looks like they have.



In its place is a C file, "cuda_drvapi_dynlink.c", which, to make a long story short, I gather you're supposed to include in one of your source code modules (as opposed to just adding it to your project). It basically just calls LoadLibrary() and GetProcAddress() for all of the CUDA Driver API functions, yielding a whole mess of globally accessible function pointers, which can then be used to call into the CUDA Driver API..



Why isn't that salient little fact mentioned anywhere in the docs?



From this file, I was able to glean that the CUDA Driver API functions are all in the CUDA Driver itself, which is the file, "nvcuda.dll". Apparently, there are two of them, one for 64-bit, and one for 32-bit.



So on a 64-bit Win 7 machine, which is what I'm using, you end up with the 64-bit version of "nvcuda.dll" (6.29 MB) residing in "C:\Windows\system32", and the 32-bit version (4.70 MB) residing in "C:\Windows\SysWOW64".



All very well and good, except that my compiled 32-bit program's LoadLibrary() call fails when it tries to load the 32-bit version of "nvcuda.dll". So I'm still stumped..



Anyone still listening? Anyone have any suggestions at this point (other than, "buy a newer compiler!") ?

#2
Posted 01/13/2012 03:02 AM   
Well, still working on this, but I'm closer now..

I don't know why NVidia decided to get rid of the import library for the CUDA Driver API in their 4.0 SDK, but it looks like they have.

In its place is a C file, "cuda_drvapi_dynlink.c", which, to make a long story short, I gather you're supposed to [b][i]include[/i][/b] in one of your source code modules (as opposed to just adding it to your project). It basically just calls LoadLibrary() and GetProcAddress() for all of the CUDA Driver API functions, yielding a whole mess of globally accessible function pointers, which can then be used to call into the CUDA Driver API..

Why isn't that salient little fact mentioned anywhere in the docs?

From this file, I was able to glean that the CUDA Driver API functions are all in the CUDA Driver itself, which is the file, "nvcuda.dll". Apparently, there are two of them, one for 64-bit, and one for 32-bit.

So on a 64-bit Win 7 machine, which is what I'm using, you end up with the 64-bit version of "nvcuda.dll" (6.29 MB) residing in "C:\Windows\system32", and the 32-bit version (4.70 MB) residing in "C:\Windows\SysWOW64".

All very well and good, except that my compiled 32-bit program's LoadLibrary() call fails when it tries to load the 32-bit version of "nvcuda.dll". So I'm still stumped..

Anyone still listening? Anyone have any suggestions at this point (other than, "buy a newer compiler!") ?
Well, still working on this, but I'm closer now..



I don't know why NVidia decided to get rid of the import library for the CUDA Driver API in their 4.0 SDK, but it looks like they have.



In its place is a C file, "cuda_drvapi_dynlink.c", which, to make a long story short, I gather you're supposed to include in one of your source code modules (as opposed to just adding it to your project). It basically just calls LoadLibrary() and GetProcAddress() for all of the CUDA Driver API functions, yielding a whole mess of globally accessible function pointers, which can then be used to call into the CUDA Driver API..



Why isn't that salient little fact mentioned anywhere in the docs?



From this file, I was able to glean that the CUDA Driver API functions are all in the CUDA Driver itself, which is the file, "nvcuda.dll". Apparently, there are two of them, one for 64-bit, and one for 32-bit.



So on a 64-bit Win 7 machine, which is what I'm using, you end up with the 64-bit version of "nvcuda.dll" (6.29 MB) residing in "C:\Windows\system32", and the 32-bit version (4.70 MB) residing in "C:\Windows\SysWOW64".



All very well and good, except that my compiled 32-bit program's LoadLibrary() call fails when it tries to load the 32-bit version of "nvcuda.dll". So I'm still stumped..



Anyone still listening? Anyone have any suggestions at this point (other than, "buy a newer compiler!") ?

#3
Posted 01/13/2012 03:02 AM   
Okay, sorry. I can jump the gun at times..

Just found out that there are [b][i]two[/i][/b] separate installs that need to be done before you can successfully access any [b][i]one[/i][/b] CUDA Driver API version: the "[b][i]Computing[/i][/b]" SDK and the "[b][i]Toolkit[/i][/b]" SDK. That info is in the 4.0 "Release Notes", which I didn't get around to reading until recently, because I'm kind of used to those being all about known bugs, and other last-minute minutia..

So I was missing the "Toolkit" SDK for the 4.0 CUDA Driver API, which contains, among other things, the import library for the CUDA Driver DLL..

So, as they say on SNL.. 'never mind'..

Interesting sidebar though: just by tweaking the "Computing" SDK's cuda_drvapi_dynlink*.* code (c and h), I was eventually able to access the entire 4.0 CUDA Driver API under 64-bit Windows 7 in a 32-bit program compiled with Visual C++ 6.0, [b][i]even though[/i][/b] I think (?) my actual Display Driver version (268.30) is [b][i]less than[/i][/b] the required "R270"..(?)

Last word: As far as I can tell, I don't think you can use the 32-bit 4.0 CUDA Driver API at all under a 32-bit Windows OS - that's because it links in the RegGetValue() function from the advapi32 DLL, which Microsoft documents as only available on 64-bit Windows OS's.. Which is entirely too weird, but there it is..
Okay, sorry. I can jump the gun at times..



Just found out that there are two separate installs that need to be done before you can successfully access any one CUDA Driver API version: the "Computing" SDK and the "Toolkit" SDK. That info is in the 4.0 "Release Notes", which I didn't get around to reading until recently, because I'm kind of used to those being all about known bugs, and other last-minute minutia..



So I was missing the "Toolkit" SDK for the 4.0 CUDA Driver API, which contains, among other things, the import library for the CUDA Driver DLL..



So, as they say on SNL.. 'never mind'..



Interesting sidebar though: just by tweaking the "Computing" SDK's cuda_drvapi_dynlink*.* code (c and h), I was eventually able to access the entire 4.0 CUDA Driver API under 64-bit Windows 7 in a 32-bit program compiled with Visual C++ 6.0, even though I think (?) my actual Display Driver version (268.30) is less than the required "R270"..(?)



Last word: As far as I can tell, I don't think you can use the 32-bit 4.0 CUDA Driver API at all under a 32-bit Windows OS - that's because it links in the RegGetValue() function from the advapi32 DLL, which Microsoft documents as only available on 64-bit Windows OS's.. Which is entirely too weird, but there it is..

#4
Posted 01/14/2012 02:31 AM   
Okay, sorry. I can jump the gun at times..

Just found out that there are [b][i]two[/i][/b] separate installs that need to be done before you can successfully access any [b][i]one[/i][/b] CUDA Driver API version: the "[b][i]Computing[/i][/b]" SDK and the "[b][i]Toolkit[/i][/b]" SDK. That info is in the 4.0 "Release Notes", which I didn't get around to reading until recently, because I'm kind of used to those being all about known bugs, and other last-minute minutia..

So I was missing the "Toolkit" SDK for the 4.0 CUDA Driver API, which contains, among other things, the import library for the CUDA Driver DLL..

So, as they say on SNL.. 'never mind'..

Interesting sidebar though: just by tweaking the "Computing" SDK's cuda_drvapi_dynlink*.* code (c and h), I was eventually able to access the entire 4.0 CUDA Driver API under 64-bit Windows 7 in a 32-bit program compiled with Visual C++ 6.0, [b][i]even though[/i][/b] I think (?) my actual Display Driver version (268.30) is [b][i]less than[/i][/b] the required "R270"..(?)

Last word: As far as I can tell, I don't think you can use the 32-bit 4.0 CUDA Driver API at all under a 32-bit Windows OS - that's because it links in the RegGetValue() function from the advapi32 DLL, which Microsoft documents as only available on 64-bit Windows OS's.. Which is entirely too weird, but there it is..
Okay, sorry. I can jump the gun at times..



Just found out that there are two separate installs that need to be done before you can successfully access any one CUDA Driver API version: the "Computing" SDK and the "Toolkit" SDK. That info is in the 4.0 "Release Notes", which I didn't get around to reading until recently, because I'm kind of used to those being all about known bugs, and other last-minute minutia..



So I was missing the "Toolkit" SDK for the 4.0 CUDA Driver API, which contains, among other things, the import library for the CUDA Driver DLL..



So, as they say on SNL.. 'never mind'..



Interesting sidebar though: just by tweaking the "Computing" SDK's cuda_drvapi_dynlink*.* code (c and h), I was eventually able to access the entire 4.0 CUDA Driver API under 64-bit Windows 7 in a 32-bit program compiled with Visual C++ 6.0, even though I think (?) my actual Display Driver version (268.30) is less than the required "R270"..(?)



Last word: As far as I can tell, I don't think you can use the 32-bit 4.0 CUDA Driver API at all under a 32-bit Windows OS - that's because it links in the RegGetValue() function from the advapi32 DLL, which Microsoft documents as only available on 64-bit Windows OS's.. Which is entirely too weird, but there it is..

#5
Posted 01/14/2012 02:31 AM   
Scroll To Top