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

Integrate "Fix NVML detection on Windows" #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
11 changes: 5 additions & 6 deletions NVML/cmake/FindNVML.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,16 @@
#
###############################################################################

#TODO: Should GPU_DEPLOYMENT_KIT_ROOT_DIR override the default locations?
if( CMAKE_SYSTEM_NAME STREQUAL "Windows" )
set( NVML_LIB_PATHS "C:\Program Files\NVIDIA Corporation\GDK" )
set( NVML_LIB_PATHS "C:/Program Files/NVIDIA Corporation/GDK/nvml/lib" )
if(GPU_DEPLOYMENT_KIT_ROOT_DIR)
list(APPEND NVML_LIB_PATHS "${GPU_DEPLOYMENT_KIT_ROOT_DIR}\nvml\lib")
list(APPEND NVML_LIB_PATHS "${GPU_DEPLOYMENT_KIT_ROOT_DIR}/nvml/lib")
endif()
set(NVML_NAMES nvml)

set( NVML_INC_PATHS "C:\Program Files\NVIDIA Corporation\GDK\nvml\include" )
set( NVML_INC_PATHS "C:/Program Files/NVIDIA Corporation/GDK/nvml/include" )
if(GPU_DEPLOYMENT_KIT_ROOT_DIR)
list(APPEND NVML_INC_PATHS "${GPU_DEPLOYMENT_KIT_ROOT_DIR}\nvml\include")
list(APPEND NVML_INC_PATHS "${GPU_DEPLOYMENT_KIT_ROOT_DIR}/nvml/include")
endif()
else()
set( NVML_LIB_PATHS /usr/lib64 )
Expand All @@ -76,7 +75,7 @@ find_path(NVML_INCLUDE_DIR nvml.h PATHS ${NVML_INC_PATHS})

# handle the QUIETLY and REQUIRED arguments and set NVML_FOUND to TRUE if
# all listed variables are TRUE
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(NVML DEFAULT_MSG NVML_LIBRARY NVML_INCLUDE_DIR)

mark_as_advanced(NVML_LIBRARY NVML_INCLUDE_DIR)