Skip to content

Commit

Permalink
Fix python detection in cuda.cmake (pytorch#130651)
Browse files Browse the repository at this point in the history
If Python package has not been detected previously, call it here

This fixes regression introduced by pytorch#128801 that results in annoying, but harmless warning reported in pytorch#129777

Pull Request resolved: pytorch#130651
Approved by: https://github.com/Skylion007
  • Loading branch information
malfet authored and pytorchmergebot committed Jul 15, 2024
1 parent c089791 commit c547b2e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cmake/public/cuda.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ endif()
# find lbnvrtc.so
set(CUDA_NVRTC_LIB "${CUDA_nvrtc_LIBRARY}" CACHE FILEPATH "")
if(CUDA_NVRTC_LIB AND NOT CUDA_NVRTC_SHORTHASH)
find_package(Python COMPONENTS Interpreter)
execute_process(
COMMAND Python::Interpreter -c
"import hashlib;hash=hashlib.sha256();hash.update(open('${CUDA_NVRTC_LIB}','rb').read());print(hash.hexdigest()[:8])"
Expand Down

0 comments on commit c547b2e

Please sign in to comment.