Skip to content

Commit

Permalink
Merge pull request xmrig#1 from Spudz76/ocean-master-fixups
Browse files Browse the repository at this point in the history
Cleanup patchset
  • Loading branch information
MoneroOcean authored Jul 14, 2020
2 parents 510c54f + 8924264 commit 4bb6f6f
Show file tree
Hide file tree
Showing 16 changed files with 440 additions and 108 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
run: |
powershell -Command "Invoke-WebRequest http://developer.download.nvidia.com/compute/cuda/11.0.1/network_installers/cuda_11.0.1_win10_network.exe -OutFile .\cuda_setup.exe"
start /wait .\cuda_setup.exe -s nvcc_11.0 cudart_11.0 nvrtc_11.0 nvrtc_dev_11.0
shell: cmd
shell: cmd
- name: Build project on Windows
run: |
cmake . -G "Visual Studio 16 2019" -DCUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.0"
Expand All @@ -41,7 +41,7 @@ jobs:
run: |
powershell -Command "Invoke-WebRequest http://developer.download.nvidia.com/compute/cuda/10.2/Prod/network_installers/cuda_10.2.89_win10_network.exe -OutFile .\cuda_setup.exe"
start /wait .\cuda_setup.exe -s nvcc_10.2 cudart_10.2 nvrtc_10.2 nvrtc_dev_10.2
shell: cmd
shell: cmd
- name: Build project on Windows
run: |
cmake . -G "Visual Studio 16 2019" -DCUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2"
Expand All @@ -66,7 +66,7 @@ jobs:
run: |
powershell -Command "Invoke-WebRequest https://developer.nvidia.com/compute/cuda/10.1/Prod/network_installers/cuda_10.1.105_win10_network.exe -OutFile .\cuda_setup.exe"
start /wait .\cuda_setup.exe -s nvcc_10.1 cudart_10.1 nvrtc_10.1 nvrtc_dev_10.1
shell: cmd
shell: cmd
- name: Build project on Windows
run: |
cmake . -G "Visual Studio 16 2019" -DCUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1"
Expand All @@ -91,7 +91,7 @@ jobs:
run: |
powershell -Command "Invoke-WebRequest https://developer.nvidia.com/compute/cuda/10.0/Prod/network_installers/cuda_10.0.130_win10_network -OutFile .\cuda_setup.exe"
start /wait .\cuda_setup.exe -s nvcc_10.0 cudart_10.0 nvrtc_10.0 nvrtc_dev_10.0
shell: cmd
shell: cmd
- name: Build project on Windows
run: |
cmake . -G "Visual Studio 15 2017 Win64" -DCUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0"
Expand All @@ -116,7 +116,7 @@ jobs:
run: |
powershell -Command "Invoke-WebRequest https://developer.nvidia.com/compute/cuda/9.2/Prod2/network_installers2/cuda_9.2.148_win10_network -OutFile .\cuda_setup.exe"
start /wait .\cuda_setup.exe -s nvcc_9.2 cudart_9.2 nvrtc_9.2 nvrtc_dev_9.2
shell: cmd
shell: cmd
- name: Build project on Windows
run: |
cmake . -G "Visual Studio 15 2017 Win64" -DCUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.2"
Expand All @@ -141,7 +141,7 @@ jobs:
run: |
powershell -Command "Invoke-WebRequest https://developer.nvidia.com/compute/cuda/9.1/Prod/network_installers/cuda_9.1.85_win10_network -OutFile .\cuda_setup.exe"
start /wait .\cuda_setup.exe -s nvcc_9.1 cudart_9.1 nvrtc_9.1 nvrtc_dev_9.1
shell: cmd
shell: cmd
- name: Build project on Windows
run: |
cmake . -G "Visual Studio 15 2017 Win64" -DCUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.1"
Expand Down
36 changes: 26 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
- name: Install CUDA
run: |
powershell -Command "Invoke-WebRequest http://developer.download.nvidia.com/compute/cuda/11.0.1/network_installers/cuda_11.0.1_win10_network.exe -OutFile .\cuda_setup.exe"
start /wait .\cuda_setup.exe -s nvcc_11.0 cudart_11.0 nvrtc_11.0 nvrtc_dev_11.0
shell: cmd
start /wait .\cuda_setup.exe -s nvcc_11.0 cudart_11.0 nvrtc_11.0 nvrtc_dev_11.0 nvml_dev_11.0
shell: cmd
- name: Build project on Windows
run: |
cmake . -G "Visual Studio 16 2019" -DCUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.0"
Expand All @@ -29,8 +29,8 @@ jobs:
- name: Install CUDA
run: |
powershell -Command "Invoke-WebRequest http://developer.download.nvidia.com/compute/cuda/10.2/Prod/network_installers/cuda_10.2.89_win10_network.exe -OutFile .\cuda_setup.exe"
start /wait .\cuda_setup.exe -s nvcc_10.2 cudart_10.2 nvrtc_10.2 nvrtc_dev_10.2
shell: cmd
start /wait .\cuda_setup.exe -s nvcc_10.2 cudart_10.2 nvrtc_10.2 nvrtc_dev_10.2 nvml_dev_10.2
shell: cmd
- name: Build project on Windows
run: |
cmake . -G "Visual Studio 16 2019" -DCUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2"
Expand All @@ -46,8 +46,8 @@ jobs:
- name: Install CUDA
run: |
powershell -Command "Invoke-WebRequest https://developer.nvidia.com/compute/cuda/10.1/Prod/network_installers/cuda_10.1.105_win10_network.exe -OutFile .\cuda_setup.exe"
start /wait .\cuda_setup.exe -s nvcc_10.1 cudart_10.1 nvrtc_10.1 nvrtc_dev_10.1
shell: cmd
start /wait .\cuda_setup.exe -s nvcc_10.1 cudart_10.1 nvrtc_10.1 nvrtc_dev_10.1 nvml_dev_10.1
shell: cmd
- name: Build project on Windows
run: |
cmake . -G "Visual Studio 16 2019" -DCUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1"
Expand All @@ -63,8 +63,8 @@ jobs:
- name: Install CUDA
run: |
powershell -Command "Invoke-WebRequest https://developer.nvidia.com/compute/cuda/10.0/Prod/network_installers/cuda_10.0.130_win10_network -OutFile .\cuda_setup.exe"
start /wait .\cuda_setup.exe -s nvcc_10.0 cudart_10.0 nvrtc_10.0 nvrtc_dev_10.0
shell: cmd
start /wait .\cuda_setup.exe -s nvcc_10.0 cudart_10.0 nvrtc_10.0 nvrtc_dev_10.0 nvml_dev_10.0
shell: cmd
- name: Build project on Windows
run: |
cmake . -G "Visual Studio 15 2017 Win64" -DCUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0"
Expand All @@ -80,7 +80,7 @@ jobs:
- name: Install CUDA
run: |
Invoke-WebRequest https://developer.nvidia.com/compute/cuda/9.2/Prod2/network_installers2/cuda_9.2.148_win10_network -OutFile .\cuda_setup.exe
cmd /c start /wait .\cuda_setup.exe -s nvcc_9.2 cudart_9.2 nvrtc_9.2 nvrtc_dev_9.2
cmd /c start /wait .\cuda_setup.exe -s nvcc_9.2 cudart_9.2 nvrtc_9.2 nvrtc_dev_9.2 nvml_dev_9.2
Select-String -Path "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include\crt\host_config.h" -Pattern "_MSC_VER"
(Get-Content -Path "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include\crt\host_config.h") -replace "1913","1920" | Set-Content "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include\crt\host_config.h"
Select-String -Path "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include\crt\host_config.h" -Pattern "_MSC_VER"
Expand All @@ -100,7 +100,7 @@ jobs:
- name: Install CUDA
run: |
Invoke-WebRequest https://developer.nvidia.com/compute/cuda/9.1/Prod/network_installers/cuda_9.1.85_win10_network -OutFile .\cuda_setup.exe
cmd /c start /wait .\cuda_setup.exe -s nvcc_9.1 cudart_9.1 nvrtc_9.1 nvrtc_dev_9.1
cmd /c start /wait .\cuda_setup.exe -s nvcc_9.1 cudart_9.1 nvrtc_9.1 nvrtc_dev_9.1 nvml_dev_9.1
Select-String -Path "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\include\crt\host_config.h" -Pattern "_MSC_VER"
(Get-Content -Path "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\include\crt\host_config.h") -replace "1911","1920" | Set-Content "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\include\crt\host_config.h"
Select-String -Path "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\include\crt\host_config.h" -Pattern "_MSC_VER"
Expand All @@ -110,3 +110,19 @@ jobs:
cmake . -G "Visual Studio 15 2017 Win64" -DCUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.1"
cd "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin"
.\MSBuild.exe /p:Configuration=Release $Env:GITHUB_WORKSPACE\xmrig-cuda.sln
# build_win_cuda8_0:
# name: Windows CUDA 8.0
# runs-on: windows-2016
# steps:
# - name: Checkout code
# uses: actions/checkout@master
# - name: Install CUDA
# run: |
# Invoke-WebRequest https://developer.nvidia.com/compute/cuda/8.0/Prod2/network_installers/cuda_8.0.61_win10_network-exe -OutFile .\cuda_setup.exe
# cmd /c start /wait .\cuda_setup.exe -s compiler_8.0 cudart_8.0 nvrtc_8.0 nvrtc_dev_8.0 nvml_dev_8.0
# shell: powershell
# - name: Build project on Windows
# run: |
# cmake . -G "Visual Studio 15 2017 Win64" -T v140,host=x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON -DCUDA_VERBOSE_BUILD=ON -DCUDA_SHOW_REGISTER=ON -DCUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0"
# cmake --build . --config Release
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/CMakeLists.txt.user
/build
49 changes: 47 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,57 @@
cmake_minimum_required(VERSION 2.8)
project(xmrig-cuda)
include(cmake/CUDA-Version.cmake)


option(WITH_RANDOMX "Enable RandomX algorithms family" ON)
option(WITH_CN_LITE "Enable CryptoNight-Lite algorithms family" ON)
option(WITH_CN_HEAVY "Enable CryptoNight-Heavy algorithms family" ON)
option(WITH_CN_PICO "Enable CryptoNight-Pico algorithm" ON)
option(WITH_CN_GPU "Enable CryptoNight-GPU algorithm" ON)
option(WITH_ARGON2 "Enable Argon2 algorithms family" OFF) #unsupported
if (CUDA_VERSION VERSION_LESS 9.0)
message(STATUS "CUDA ${CUDA_VERSION}: RandomX, AstroBWT, and KawPow disabled, they do not work with old CUDA")
option(WITH_RANDOMX "Enable RandomX algorithms family" OFF)
option(WITH_ASTROBWT "Enable AstroBWT algorithms family" OFF)
option(WITH_KAWPOW "Enable KawPow algorithms family" OFF)
else()
option(WITH_RANDOMX "Enable RandomX algorithms family" ON)
option(WITH_ASTROBWT "Enable AstroBWT algorithms family" ON)
option(WITH_KAWPOW "Enable KawPow algorithms family" ON)
endif()

if (WITH_CN_LITE)
add_definitions(/DXMRIG_ALGO_CN_LITE)
endif()

if (WITH_CN_HEAVY)
add_definitions(/DXMRIG_ALGO_CN_HEAVY)
endif()

if (WITH_CN_PICO)
add_definitions(/DXMRIG_ALGO_CN_PICO)
endif()

if (WITH_CN_GPU)
add_definitions(/DXMRIG_ALGO_CN_GPU)
endif()

if (WITH_RANDOMX)
add_definitions(/DXMRIG_ALGO_RANDOMX)
endif()

if (WITH_ARGON2)
add_definitions(/DXMRIG_ALGO_ARGON2)
endif()

if (WITH_ASTROBWT)
add_definitions(/DXMRIG_ALGO_ASTROBWT)
endif()

if (WITH_KAWPOW)
add_definitions(/DXMRIG_ALGO_KAWPOW)
endif()

include_directories(src)
add_definitions(/DXMRIG_ALGO_CN_LITE /DXMRIG_ALGO_CN_HEAVY /DXMRIG_ALGO_CN_PICO /DXMRIG_ALGO_CN_GPU)
add_definitions(/DCUB_IGNORE_DEPRECATED_CPP_DIALECT)


Expand Down
19 changes: 19 additions & 0 deletions cmake/CUDA-Version.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
set(DEVICE_COMPILER "nvcc")
set(CUDA_COMPILER "${DEVICE_COMPILER}" CACHE STRING "Select the device compiler")

if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
list(APPEND DEVICE_COMPILER "clang")
endif()

set_property(CACHE CUDA_COMPILER PROPERTY STRINGS "${DEVICE_COMPILER}")

list(APPEND CMAKE_PREFIX_PATH "$ENV{CUDA_ROOT}")
list(APPEND CMAKE_PREFIX_PATH "$ENV{CMAKE_PREFIX_PATH}")

set(CUDA_STATIC ON)
find_package(CUDA 8.0 REQUIRED)

find_library(CUDA_LIB libcuda cuda HINTS "${CUDA_TOOLKIT_ROOT_DIR}/lib64" "${LIBCUDA_LIBRARY_DIR}" "${CUDA_TOOLKIT_ROOT_DIR}/lib/x64" /usr/lib64 /usr/local/cuda/lib64)
find_library(CUDA_NVRTC_LIB libnvrtc nvrtc HINTS "${CUDA_TOOLKIT_ROOT_DIR}/lib64" "${LIBNVRTC_LIBRARY_DIR}" "${CUDA_TOOLKIT_ROOT_DIR}/lib/x64" /usr/lib64 /usr/local/cuda/lib64)

set(LIBS ${LIBS} ${CUDA_LIBRARIES} ${CUDA_LIB} ${CUDA_NVRTC_LIB})
Loading

0 comments on commit 4bb6f6f

Please sign in to comment.