Skip to content

Commit 4ccc171

Browse files
authored
fix Automatic GPU detection failed on windows (#28148) (#28182)
1 parent 51b7bbe commit 4ccc171

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

cmake/cuda.cmake

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ function(detect_installed_gpus out_variable)
6262
if(NOT CUDA_gpu_detect_output)
6363
message(STATUS "Automatic GPU detection failed. Building for all known architectures.")
6464
set(${out_variable} ${paddle_known_gpu_archs} PARENT_SCOPE)
65-
#Todo: fix Automatic GPU detection failed on windows
66-
if(WIN32)
67-
set(${out_variable} "61 75" PARENT_SCOPE)
68-
endif()
6965
else()
7066
set(${out_variable} ${CUDA_gpu_detect_output} PARENT_SCOPE)
7167
endif()

paddle/scripts/paddle_build.bat

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
@ECHO ON
2-
SETLOCAL
3-
41
rem Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
52
rem
63
rem Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,9 +16,13 @@ rem =================================================
1916
rem Paddle CI Task On Windows Platform
2017
rem =================================================
2118

19+
@ECHO ON
20+
SETLOCAL
21+
2222
rem -------clean up environment-----------
2323
set work_dir=%cd%
24-
wmic process where name="op_function_generator.exe" call terminate 2>NUL
24+
taskkill /f /im op_function_generator.exe
25+
wmic process where name="op_function_generator.exe" call terminate
2526

2627
rem ------initialize common variable------
2728
if not defined CUDA_TOOLKIT_ROOT_DIR set CUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0"
@@ -175,6 +176,7 @@ rem ----------------------------------------------------------------------------
175176
echo ========================================
176177
echo Step 1. Cmake ...
177178
echo ========================================
179+
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
178180

179181
for /F %%# in ('wmic os get localdatetime^|findstr 20') do set start=%%#
180182
set start=%start:~4,10%
@@ -201,9 +203,8 @@ rem ----------------------------------------------------------------------------
201203
echo ========================================
202204
echo Step 2. Buile Paddle ...
203205
echo ========================================
204-
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
205206

206-
for /F %%# in ('wmic cpu get NumberOfLogicalProcessors^|findstr [0-9]') do set /a PARALLEL_PROJECT_COUNT=%%#*8/10
207+
for /F %%# in ('wmic cpu get NumberOfLogicalProcessors^|findstr [0-9]') do set /a PARALLEL_PROJECT_COUNT=%%#*9/10
207208
set build_times=1
208209
:build_tp
209210
echo Build third_party the %build_times% time:
@@ -248,19 +249,25 @@ echo ========================================
248249
echo Step 3. Test pip install whl package ...
249250
echo ========================================
250251

252+
setlocal enabledelayedexpansion
253+
251254
for /F %%# in ('wmic os get localdatetime^|findstr 20') do set end=%%#
252255
set end=%end:~4,10%
253256
call :timestamp "%start%" "%end%" "Build"
257+
@ECHO OFF
254258
tree /F %cd%\paddle_inference_install_dir\paddle
255-
%cache_dir%\tools\busybox64.exe du -h -d 0 %cd%\paddle_inference_install_dir\paddle\lib > lib_size.txt
259+
%cache_dir%\tools\busybox64.exe du -h -d 0 -k %cd%\paddle_inference_install_dir\paddle\lib > lib_size.txt
256260
set /p libsize=< lib_size.txt
257-
for /F %%i in ("%libsize%") do echo "Windows Paddle_Inference Size: %%i"
261+
for /F %%i in ("%libsize%") do (
262+
set /a libsize_m=%%i/1024
263+
echo "Windows Paddle_Inference Size: !libsize_m!M"
264+
)
258265
%cache_dir%\tools\busybox64.exe du -h -d 0 %cd%\python\dist > whl_size.txt
259266
set /p whlsize=< whl_size.txt
260267
for /F %%i in ("%whlsize%") do echo "Windows PR whl Size: %%i"
261268
dir /s /b python\dist\*.whl > whl_file.txt
262269
set /p PADDLE_WHL_FILE_WIN=< whl_file.txt
263-
270+
@ECHO ON
264271
pip uninstall -y paddlepaddle
265272
pip uninstall -y paddlepaddle-gpu
266273
pip install -U %PADDLE_WHL_FILE_WIN% --user

0 commit comments

Comments
 (0)