Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,10 @@ ehthumbs.db
Icon?
Thumbs.db
*.swp

# Generated Libs
libdarknet.a
libdarknet.so

# IDEs garbage
.idea/
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ OPENCV=0
OPENMP=0
DEBUG=0

ARCH= -gencode arch=compute_30,code=sm_30 \
-gencode arch=compute_35,code=sm_35 \
-gencode arch=compute_50,code=[sm_50,compute_50] \
-gencode arch=compute_52,code=[sm_52,compute_52]
#ARCH= -gencode arch=compute_30,code=sm_30 \
# -gencode arch=compute_35,code=sm_35 \
# -gencode arch=compute_50,code=[sm_50,compute_50] \
# -gencode arch=compute_52,code=[sm_52,compute_52] \
# -gencode arch=compute_75,code=[sm_75,compute_75] \ RTX 20 series
# -gencode arch=compute_20,code=[sm_20,sm_21] \ This one is deprecated?

# This is what I use, uncomment if you know your arch and want to specify
Expand Down
57 changes: 33 additions & 24 deletions src/convolutional_layer.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,31 +145,40 @@ void cudnn_convolutional_setup(layer *l)
}
#endif

cudnnGetConvolutionForwardAlgorithm(cudnn_handle(),
l->srcTensorDesc,
l->weightDesc,
l->convDesc,
l->dstTensorDesc,
CUDNN_CONVOLUTION_FWD_SPECIFY_WORKSPACE_LIMIT,
2000000000,
&l->fw_algo);
cudnnGetConvolutionBackwardDataAlgorithm(cudnn_handle(),
l->weightDesc,
l->ddstTensorDesc,
l->convDesc,
l->dsrcTensorDesc,
CUDNN_CONVOLUTION_BWD_DATA_SPECIFY_WORKSPACE_LIMIT,
2000000000,
&l->bd_algo);
cudnnGetConvolutionBackwardFilterAlgorithm(cudnn_handle(),
l->srcTensorDesc,
l->ddstTensorDesc,
l->convDesc,
l->dweightDesc,
CUDNN_CONVOLUTION_BWD_FILTER_SPECIFY_WORKSPACE_LIMIT,
2000000000,
&l->bf_algo);
#if CUDNN_MAJOR >= 8
// Following functions no longer exist in release of CUDNN 8+ and have no replacement. This is the minimal
// intervention necessary for project to work on CUDNN 8+ (CUDA 11+).

// cudnnGetConvolutionForwardAlgorithm(cudnn_handle(),
// l->srcTensorDesc,
// l->weightDesc,
// l->convDesc,
// l->dstTensorDesc,
// CUDNN_CONVOLUTION_FWD_SPECIFY_WORKSPACE_LIMIT,
// 2000000000,
// &l->fw_algo);
l->fw_algo = CUDNN_CONVOLUTION_FWD_ALGO_IMPLICIT_PRECOMP_GEMM;
// cudnnGetConvolutionBackwardDataAlgorithm(cudnn_handle(),
// l->weightDesc,
// l->ddstTensorDesc,
// l->convDesc,
// l->dsrcTensorDesc,
// CUDNN_CONVOLUTION_BWD_DATA_SPECIFY_WORKSPACE_LIMIT,
// 2000000000,
// &l->bd_algo);
l->bd_algo = CUDNN_CONVOLUTION_BWD_DATA_ALGO_1;
// cudnnGetConvolutionBackwardFilterAlgorithm(cudnn_handle(),
// l->srcTensorDesc,
// l->ddstTensorDesc,
// l->convDesc,
// l->dweightDesc,
// CUDNN_CONVOLUTION_BWD_FILTER_SPECIFY_WORKSPACE_LIMIT,
// 2000000000,
// &l->bf_algo);
l->bf_algo = CUDNN_CONVOLUTION_BWD_FILTER_ALGO_1;
#endif
}

#endif
#endif

Expand Down