Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix several CMakeLists.txt files to support non-standard cudnn path #573

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zobinHuang
Copy link
Contributor

@zobinHuang zobinHuang commented Apr 23, 2023

Background

My machine have been installed cudnn under the non-standard path /usr/local/cudnn-linux-x86_64-8.4.1.50_cuda11.6-archive, and the directory tree under this path looks like:

/usr/local/cudnn-linux-x86_64-8.4.1.50_cuda11.6-archive/
├── include
├── lib
└── LICENSE

Problem

When I ran cmake with following options:

cmake .. -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-11.6 \
    -DCUDNN_LIBRARY_PATH=/usr/local/cudnn-linux-x86_64-8.4.1.50_cuda11.6-archive/lib \
    -DCUDNN_INCLUDE_PATH=/usr/local/cudnn-linux-x86_64-8.4.1.50_cuda11.6-archive/include \
    -DCMAKE_CUDA_ARCHITECTURES=80-real 

Some target libraries such as swin_gemm, vit_gemm, WenetEncoder and ViTINT8 still failed to find cudnn.h. The error during building looks like:

[ 75%] Building CXX object src/fastertransformer/models/vit_int8/CMakeFiles/ViTINT8.dir/ViTINT8.cc.o
In file included from /data/huangzhuobin/projects/oneflow_features/FasterTransformer/src/fastertransformer/models/vit_int8/ViTINT8.h:26,
                 from /data/huangzhuobin/projects/oneflow_features/FasterTransformer/src/fastertransformer/models/vit_int8/[ViTINT8.cc:17](http://vitint8.cc:17/):
/data/huangzhuobin/projects/oneflow_features/FasterTransformer/src/fastertransformer/utils/conv2d.h:24:10: fatal error: cudnn.h: No such file or directory
   24 | #include <cudnn.h>
      |          ^~~~~~~~~
compilation terminated.
make[2]: *** [src/fastertransformer/models/vit_int8/CMakeFiles/ViTINT8.dir/build.make:76: src/fastertransformer/models/vit_int8/CMakeFiles/ViTINT8.dir/ViTINT8.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:6880: src/fastertransformer/models/vit_int8/CMakeFiles/ViTINT8.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

Fix

This patch specifies the CUDNN include path for these target libraries via the CUDNN_INCLUDE_PATH which passed as cmake option

@zobinHuang zobinHuang changed the title fix several CMakeLists.txt files to support building corresponding ta… fix several CMakeLists.txt files to support non-standard cudnn path Apr 23, 2023
@byshiue
Copy link
Collaborator

byshiue commented Apr 24, 2023

  1. Have you investigated why find_package(CUDNN) does not find your CUDNN?
  2. Have you tried the variable CUDNN_LIBRARY and CUDNN_INCLUDE_DIR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants