Files
mines/rin/miner/gpu/RinHash-cuda/build-cuda.bat
Dobromir Popov e0c0d886f6 more gpu
2025-09-05 08:49:25 +03:00

98 lines
2.4 KiB
Batchfile

@echo off
REM RinHash CUDA Build Script
REM This script attempts to build the CUDA implementation of RinHash
echo ======================================
echo RinHash CUDA Miner Build Script
echo ======================================
REM Check if NVCC is available
where nvcc >nul 2>nul
if errorlevel 1 (
echo ERROR: NVCC not found in PATH
echo Please install CUDA Toolkit
goto :error
)
echo NVCC found:
nvcc --version
echo.
REM Try to find Visual Studio
set "VS2019_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
set "VS2022_PATH=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
if exist "%VS2022_PATH%" (
echo Using Visual Studio 2022...
call "%VS2022_PATH%"
goto :compile
)
if exist "%VS2019_PATH%" (
echo Using Visual Studio 2019 Build Tools...
call "%VS2019_PATH%"
goto :compile
)
echo ERROR: No Visual Studio installation found
echo.
echo SOLUTION 1: Install Visual Studio Community 2022 (free)
echo - Download from: https://visualstudio.microsoft.com/downloads/
echo - Make sure to include "Desktop development with C++" workload
echo - Include Windows 10/11 SDK
echo.
echo SOLUTION 2: Install Visual Studio Build Tools 2022
echo - Download from: https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022
echo - Include C++ build tools and Windows SDK
echo.
goto :error
:compile
echo.
echo Building RinHash CUDA miner...
echo.
REM Compile with NVCC (enable device linking for dynamic parallelism)
nvcc -O3 -rdc=true -arch=sm_50 ^
-gencode arch=compute_50,code=sm_50 ^
-I. rinhash.cu sha3-256.cu ^
-o rinhash-cuda-miner.exe ^
-lcuda -lcudart -lcudadevrt
if errorlevel 1 (
echo.
echo BUILD FAILED!
echo.
echo Common issues:
echo 1. Missing Windows SDK - install via Visual Studio Installer
echo 2. Incompatible Visual Studio version
echo 3. Missing CUDA runtime libraries
echo.
goto :error
)
echo.
echo ======================================
echo BUILD SUCCESSFUL!
echo ======================================
echo.
echo Executable created: rinhash-cuda-miner.exe
echo.
echo To test the miner:
echo rinhash-cuda-miner.exe --help
echo.
goto :end
:error
echo.
echo ======================================
echo BUILD FAILED!
echo ======================================
echo.
pause
exit /b 1
:end
echo Build completed successfully!
pause