Darknet compile error with cudnn 8

Hi AastaLL:

./darknet detector demo cfg/coco.data cfg/yolov3-tiny.cfg yolov3-tiny.weights [video]

Means that only tiny-yolov3 is currently supported?

2.the detail after
$git am 0001-fix-for-cudnn_v8-limited-memory-to-default-darknet-s.patch

the file “convolutional_layer.c.rej”

==============================================================================
diff a/src/convolutional_layer.c b/src/convolutional_layer.c (rejected hunks)
@@ -8,6 +8,9 @@
#include <stdio.h>
#include <time.h>

+#define PRINT_CUDNN_ALGO 0
+#define MEMORY_LIMIT 2000000000
+
#ifdef AI2
#include “xnor_layer.h”
#endif
@@ -145,6 +148,76 @@ void cudnn_convolutional_setup(layer *l)
}
#endif

  • #if CUDNN_MAJOR >= 8
  • int returnedAlgoCount;
  • cudnnConvolutionFwdAlgoPerf_t fw_results[2 * CUDNN_CONVOLUTION_FWD_ALGO_COUNT];
  • cudnnConvolutionBwdDataAlgoPerf_t bd_results[2 * CUDNN_CONVOLUTION_BWD_DATA_ALGO_COUNT];
  • cudnnConvolutionBwdFilterAlgoPerf_t bf_results[2 * CUDNN_CONVOLUTION_BWD_FILTER_ALGO_COUNT];
  • cudnnFindConvolutionForwardAlgorithm(cudnn_handle(),
  •        l->srcTensorDesc,
    
  •        l->weightDesc,
    
  •        l->convDesc,
    
  •        l->dstTensorDesc,
    
  •        CUDNN_CONVOLUTION_FWD_ALGO_COUNT,
    
  •        &returnedAlgoCount,
    
  •   fw_results);
    
  • for(int algoIndex = 0; algoIndex < returnedAlgoCount; ++algoIndex){
  •    #if PRINT_CUDNN_ALGO > 0
    
  •    printf("^^^^ %s for Algo %d: %f time requiring %llu memory\n",
    
  •           cudnnGetErrorString(fw_results[algoIndex].status),
    
  •           fw_results[algoIndex].algo, fw_results[algoIndex].time,
    
  •           (unsigned long long)fw_results[algoIndex].memory);
    
  •    #endif
    
  •    if( fw_results[algoIndex].memory < MEMORY_LIMIT ){
    
  •        l->fw_algo = fw_results[algoIndex].algo;
    
  •        break;
    
  • }
  • }
  • cudnnFindConvolutionBackwardDataAlgorithm(cudnn_handle(),
  •        l->weightDesc,
    
  •        l->ddstTensorDesc,
    
  •        l->convDesc,
    
  •        l->dsrcTensorDesc,
    
  •        CUDNN_CONVOLUTION_BWD_DATA_ALGO_COUNT,
    
  •        &returnedAlgoCount,
    
  •        bd_results);
    
  • for(int algoIndex = 0; algoIndex < returnedAlgoCount; ++algoIndex){
  •    #if PRINT_CUDNN_ALGO > 0
    
  •    printf("^^^^ %s for Algo %d: %f time requiring %llu memory\n",
    
  •           cudnnGetErrorString(bd_results[algoIndex].status),
    
  •           bd_results[algoIndex].algo, bd_results[algoIndex].time,
    
  •           (unsigned long long)bd_results[algoIndex].memory);
    
  •    #endif
    
  •    if( bd_results[algoIndex].memory < MEMORY_LIMIT ){
    
  •        l->bd_algo = bd_results[algoIndex].algo;
    
  •        break;
    
  •    }
    
  • }
  • cudnnFindConvolutionBackwardFilterAlgorithm(cudnn_handle(),
  •        l->srcTensorDesc,
    
  •        l->ddstTensorDesc,
    
  •        l->convDesc,
    
  •        l->dweightDesc,
    
  •        CUDNN_CONVOLUTION_BWD_FILTER_ALGO_COUNT,
    
  •        &returnedAlgoCount,
    
  •        bf_results);
    
  • for(int algoIndex = 0; algoIndex < returnedAlgoCount; ++algoIndex){
  •    #if PRINT_CUDNN_ALGO > 0
    
  •    printf("^^^^ %s for Algo %d: %f time requiring %llu memory\n",
    
  •           cudnnGetErrorString(bf_results[algoIndex].status),
    
  •           bf_results[algoIndex].algo, bf_results[algoIndex].time,
    
  •           (unsigned long long)bf_results[algoIndex].memory);
    
  •    #endif
    
  •    if( bf_results[algoIndex].memory < MEMORY_LIMIT ){
    
  •        l->bf_algo = bf_results[algoIndex].algo;
    
  •        break;
    
  •    }
    
  • }
  • #else
    cudnnGetConvolutionForwardAlgorithm(cudnn_handle(),
    l->srcTensorDesc,
    l->weightDesc,
    @@ -169,6 +242,7 @@ void cudnn_convolutional_setup(layer *l)
    CUDNN_CONVOLUTION_BWD_FILTER_SPECIFY_WORKSPACE_LIMIT,
    2000000000,
    &l->bf_algo);
  • #endif
    }
    #endif
    #endif

==============================================================================

after I fixed these code in “convolutional_layer.c”
but still “CUDNN_CONVOLUTION_FWD_PREFER_FASTEST” was not declared.

thanks