How to pass from Cuda 4.2 to 5.0 and replace Get Cuda Driver Error String

The library 4.2 have the méthod:
// This is just a linear search through the array, since the error_id’s are not
// always ocurring consecutively
inline const char * getCudaDrvErrorString(CUresult error_id)
{
int index = 0;
while (sCudaDrvErrorString[index].error_id != error_id &&
sCudaDrvErrorString[index].error_id != -1)
{
index++;
return (const char *)sCudaDrvErrorString[index].error_string;
}
return (const char *)“CUDA_ERROR not found!”;
}
This seems to be the brief Initialize the CUDA driver AP for CUresult error_id
whitch is in Cuda.h witch is not in Cuda 5.0:

/**

  • \defgroup CUDA_INITIALIZE Initialization
  • This section describes the initialization functions of the low-level CUDA
  • driver application programming interface.
  • @{
    */

/**

  • \brief Initialize the CUDA driver API
  • Initializes the driver API and must be called before any other function from
  • the driver API. Currently, the \p Flags parameter must be 0. If ::cuInit()
  • has not been called, any function from the driver API will return
  • ::CUDA_ERROR_NOT_INITIALIZED.
  • \param Flags - Initialization flag for CUDA.
  • \return
  • ::CUDA_SUCCESS,
  • ::CUDA_ERROR_INVALID_VALUE,
  • ::CUDA_ERROR_INVALID_DEVICE
  • \notefnerr
    */
    CUresult CUDAAPI cuInit(unsigned int Flags);

How to replace it in Cuda 5.0 ?

Thanks

I have had “cuda.h” in Version 5.0 in the directory NVIDIA\Bibliotheques Communes V 5-0\common\inc
(copie from Cuda 4.2)

Is the good solution ?

Thanks

I personally wouldn’t suggest that. If there were other API changes between 4.2 and 5.0, and you were using one of those changed APIs with CUDA 5.0 but the 4.2 cuda.h header file, you could get any sort of unpredictable behvior.

The modern replacement(s) for the function you mention are covered here.

I don’t know if those were available in CUDA 5.0. CUDA 5.0 is very old, and if anyone were updating CUDA 4.2 code, I would not suggest they update from 4.2 to 5.0, but instead from 4.2 to something like 9.0 or newer.

Hy,
Thanks for the response

I passe to Cuda 10.0

I copy the old déclarations that come from 4.2 tu use them.

I attempte now to compil and I reply you.

I have now error with Cuda 10.1
error : identifier “CUdevice_attribute” is undefined
error : identifier “cuDriverGetVersion” is undefined
error : identifier “CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X” is undefined
error : identifier “CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y” is undefined
error : identifier “CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z” is undefined
error : identifier “CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT” is undefined
error : identifier “CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT” is undefined
error : identifier “CU_DEVICE_ATTRIBUTE_INTEGRATED” is undefined
error : identifier “CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY” is undefined
error : identifier “CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS” is undefined
error : identifier “CU_DEVICE_ATTRIBUTE_SURFACE_ALIGNMENT” is undefined
error : identifier “CU_DEVICE_ATTRIBUTE_ECC_ENABLED” is undefined
error : identifier “CU_DEVICE_ATTRIBUTE_TCC_DRIVER” is undefined
error : identifier “CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING” is undefined
error : identifier “CU_DEVICE_ATTRIBUTE_PCI_BUS_ID” is undefined
error : identifier “CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID” is undefined

If I had in the “*.h” #include cuda.h, the cuda.h version 5.0 is loaded !

Why basic features are removed ?
We waste a lot of time to configure each subsequent version of CUDA !
I get anxious about every CUDA version change !

It seems that I have found:
For the Project: (properties):

  • C/C++
    - Additionnal include directory:
    - Deleting Cuda V 5.0 directory
    Tick : Héritance of the Project
  • CUDA C/C++
    • Common
      • Cuda Toolkit Custom Dir
        $(CUDA_PATH_V10_1)

I’m not going to try and research all this for you, but it seems quite evident to me you have a broken install or broken build process.

That define is contained in cuda.h associated with CUDA 12 and CUDA 10.2. It hasn’t been removed.

I’m confused by that statement. CUDA 4.2 is over 10 years old. The modern version is 12.0 I don’t see any evidence that you have been configuring each subsequent version of CUDA.

Thank’s

Exactly, I’have make my self the install of CUDA Version befor 4.2.
Now it’s simpler as I explained.
But I work on scientific projects and it’s long

How can I change the Computing Version (Cuda 10.1):
nvcc fatal : Unsupported gpu architecture ‘compute_13’

compute_13 has not been supported since I think CUDA 7. That is an item specified in a compile command somewhere. You would not want to be targetting that architecture unless you want to support very old GPUs.

nvcc fatal : Unsupported gpu architecture ‘compute_13’

Witch version of compute and sm I must put in Visual Studio 2019
and witch macro I can use ?
I want to passe tu Cuda 10.1 and nothing work’s.
I want to know th good configuration and not what don’t work !

Than’s

It(s not me witch put compute_1",sm_13:

I have put Compute_35,sm_35!