add cuda
This commit is contained in:
104
rin/miner/gpu/RinHash-cuda/build-cuda.bat
Normal file
104
rin/miner/gpu/RinHash-cuda/build-cuda.bat
Normal file
@@ -0,0 +1,104 @@
|
||||
@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
|
||||
nvcc -O3 -arch=sm_50 ^
|
||||
-gencode arch=compute_50,code=sm_50 ^
|
||||
-gencode arch=compute_52,code=sm_52 ^
|
||||
-gencode arch=compute_60,code=sm_60 ^
|
||||
-gencode arch=compute_61,code=sm_61 ^
|
||||
-gencode arch=compute_70,code=sm_70 ^
|
||||
-gencode arch=compute_75,code=sm_75 ^
|
||||
-gencode arch=compute_80,code=sm_80 ^
|
||||
-gencode arch=compute_86,code=sm_86 ^
|
||||
-I. rinhash.cu sha3-256.cu ^
|
||||
-o rinhash-cuda-miner.exe ^
|
||||
-lcuda -lcudart
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user