@echo off echo ======================================== echo RFCP GPU Build — ONEDIR mode echo CuPy-cuda13x + CUDA Toolkit 13.x echo ======================================== echo. REM ── Check CuPy ── echo [1/5] Checking CuPy installation... python -c "import cupy; print(f' CuPy {cupy.__version__}')" 2>nul if errorlevel 1 ( echo ERROR: CuPy not installed. echo Run: pip install cupy-cuda13x exit /b 1 ) REM ── Check CUDA compute ── echo [2/5] Testing GPU compute... python -c "import cupy; a = cupy.array([1,2,3]); assert a.sum() == 6; print(' GPU compute: OK')" 2>nul if errorlevel 1 ( echo ERROR: CuPy installed but GPU compute failed. echo Check: CUDA Toolkit installed? nvidia-smi works? exit /b 1 ) REM ── Check CUDA_PATH ── echo [3/5] Checking CUDA Toolkit... if defined CUDA_PATH ( echo CUDA_PATH: %CUDA_PATH% ) else ( echo WARNING: CUDA_PATH not set ) REM ── Check nvidia pip DLLs ── echo [4/5] Checking nvidia pip packages... python -c "import nvidia; import os; base=os.path.dirname(nvidia.__file__); dlls=[f for d in os.listdir(base) if os.path.isdir(os.path.join(base,d,'bin')) for f in os.listdir(os.path.join(base,d,'bin')) if f.endswith('.dll')]; print(f' nvidia pip DLLs: {len(dlls)}')" 2>nul if errorlevel 1 ( echo No nvidia pip packages (will use CUDA Toolkit) ) REM ── Build ── echo. echo [5/5] Building rfcp-server (ONEDIR mode)... echo This may take 3-5 minutes... echo. cd /d "%~dp0\..\backend" pyinstaller "..\installer\rfcp-server-gpu.spec" --clean --noconfirm echo. echo ======================================== if exist "dist\rfcp-server\rfcp-server.exe" ( echo BUILD COMPLETE! (ONEDIR mode) echo. echo Output: backend\dist\rfcp-server\ dir /b dist\rfcp-server\*.exe dist\rfcp-server\*.dll 2>nul | find /c /v "" > nul echo. echo Test commands: echo cd dist\rfcp-server echo rfcp-server.exe echo curl http://localhost:8090/api/health echo curl http://localhost:8090/api/gpu/status echo ======================================== ) else ( echo BUILD FAILED — check errors above echo ======================================== exit /b 1 ) pause