Skip to content

Move the cudnn include path before system include path#5026

Merged
soumith merged 1 commit intopytorch:masterfrom
sdmonov:fix_cmake_cudnn_include
Feb 4, 2018
Merged

Move the cudnn include path before system include path#5026
soumith merged 1 commit intopytorch:masterfrom
sdmonov:fix_cmake_cudnn_include

Conversation

@sdmonov
Copy link
Copy Markdown
Contributor

@sdmonov sdmonov commented Feb 3, 2018

In some cases when there are two different versions of cudnn installed,
one under /usr/local/cuda and other under a virtual env such as conda or
under the main system path /usr/include, the compiler would pickup the
cudnn.h from the virtual env/system path first. This is because cmake
generates C_INCLUDES and CXX_INCLUDES flags with system include path
first. All this may lead to linking problems as described in Issue #4869

Fixes #4869

In some cases when there are two different versions of cudnn installed,
one under /usr/local/cuda and other under a virtual env such as conda or
under the main system path /usr/include, the compiler would pickup the
cudnn.h from the virtual env/system path first. This is because cmake
generates C_INCLUDES and CXX_INCLUDES flags with system include path
first. All this may lead to linking problems as described in Issue pytorch#4869

Fixes pytorch#4869
@soumith
Copy link
Copy Markdown
Collaborator

soumith commented Feb 3, 2018

@pytorchbot add to whitelist

@soumith
Copy link
Copy Markdown
Collaborator

soumith commented Feb 4, 2018

@pytorchbot retest this please

@soumith soumith merged commit c65bd66 into pytorch:master Feb 4, 2018
@soumith
Copy link
Copy Markdown
Collaborator

soumith commented Feb 4, 2018

thanks @sdmonov !

@sdmonov sdmonov deleted the fix_cmake_cudnn_include branch February 4, 2018 16:22
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
In some cases when there are two different versions of cudnn installed,
one under /usr/local/cuda and other under a virtual env such as conda or
under the main system path /usr/include, the compiler would pickup the
cudnn.h from the virtual env/system path first. This is because cmake
generates C_INCLUDES and CXX_INCLUDES flags with system include path
first. All this may lead to linking problems as described in Issue pytorch#4869

Fixes pytorch#4869
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compilation fails because CMake silently picks up cudnn from conda

3 participants