Skip to content

Commit

Permalink
Merge branch '2.2-branch'
Browse files Browse the repository at this point in the history
  • Loading branch information
lwYeo committed Feb 9, 2019
2 parents f24d60e + f44dd11 commit a82f1e2
Show file tree
Hide file tree
Showing 41 changed files with 277 additions and 385 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ build/
*.asm
*.vcxproj.user
*.csproj.user
SoliditySHA3Miner/Properties/PublishProfiles/Publish.pubxml.user
4 changes: 2 additions & 2 deletions CPUSoliditySHA3Solver/CPUSoliditySHA3Solver.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)$(SolutionName)\bin\$(Configuration)\netcoreapp2.1\</OutDir>
<OutDir>$(SolutionDir)$(SolutionName)\bin\$(Configuration)\netcoreapp2.2\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(SolutionDir)$(SolutionName)\bin\$(Configuration)\netcoreapp2.1\</OutDir>
<OutDir>$(SolutionDir)$(SolutionName)\bin\$(Configuration)\netcoreapp2.2\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
Expand Down
5 changes: 0 additions & 5 deletions CudaSoliditySHA3Solver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,10 @@ set(CUDA_NVCC_FLAGS
-std=c++11
-Xptxas=-v,-warn-spills
-gencode arch=compute_30,code=sm_30
-gencode arch=compute_32,code=sm_32
-gencode arch=compute_35,code=sm_35
-gencode arch=compute_50,code=sm_50
-gencode arch=compute_52,code=sm_52
-gencode arch=compute_53,code=sm_53
-gencode arch=compute_60,code=sm_60
-gencode arch=compute_61,code=sm_61
-gencode arch=compute_62,code=sm_62
-gencode arch=compute_70,code=sm_70
)

if(NOT MSVC)
Expand Down
12 changes: 6 additions & 6 deletions CudaSoliditySHA3Solver/CudaSoliditySHA3Solver.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 9.2.props" />
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 10.0.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
Expand All @@ -44,10 +44,10 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(SolutionDir)$(SolutionName)\bin\$(Configuration)\netcoreapp2.1\</OutDir>
<OutDir>$(SolutionDir)$(SolutionName)\bin\$(Configuration)\netcoreapp2.2\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)$(SolutionName)\bin\$(Configuration)\netcoreapp2.1\</OutDir>
<OutDir>$(SolutionDir)$(SolutionName)\bin\$(Configuration)\netcoreapp2.2\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
Expand All @@ -59,7 +59,7 @@
</Link>
<CudaCompile>
<TargetMachinePlatform>64</TargetMachinePlatform>
<CodeGeneration>compute_30,sm_30;compute_32,sm_32;compute_35,sm_35;compute_50,sm_50;compute_52,sm_52;compute_53,sm_53;compute_60,sm_60;compute_61,sm_61;compute_62,sm_62;compute_70,sm_70;%(CodeGeneration)</CodeGeneration>
<CodeGeneration>compute_30,sm_30;compute_35,sm_35;compute_50,sm_50;compute_52,sm_52;compute_61,sm_61;compute_75,sm_75</CodeGeneration>
<PtxAsOptionV>true</PtxAsOptionV>
</CudaCompile>
</ItemDefinitionGroup>
Expand All @@ -79,7 +79,7 @@
</Link>
<CudaCompile>
<TargetMachinePlatform>64</TargetMachinePlatform>
<CodeGeneration>compute_30,sm_30;compute_32,sm_32;compute_35,sm_35;compute_50,sm_50;compute_52,sm_52;compute_53,sm_53;compute_60,sm_60;compute_61,sm_61;compute_62,sm_62;compute_70,sm_70;%(CodeGeneration)</CodeGeneration>
<CodeGeneration>compute_30,sm_30;compute_35,sm_35;compute_50,sm_50;compute_52,sm_52;compute_61,sm_61;compute_75,sm_75</CodeGeneration>
<Optimization>O2</Optimization>
<PtxAsOptionV>true</PtxAsOptionV>
</CudaCompile>
Expand All @@ -105,6 +105,6 @@
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 9.2.targets" />
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 10.0.targets" />
</ImportGroup>
</Project>
20 changes: 20 additions & 0 deletions CudaSoliditySHA3Solver/device/nv_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ NV_API::DLL_ClientPowerPoliciesGetStatus_t NV_API::DLL_ClientPowerPoliciesGetSta
NV_API::DLL_ClientThermalPoliciesGetLimit_t NV_API::DLL_ClientThermalPoliciesGetLimit{ NULL };
NV_API::GPU_GetCoolersSettings_t NV_API::GPU_GetCoolersSettings{ NULL };

NV_API::GPU_GetMemoryInfo_t NV_API::GPU_GetMemoryInfo{ NULL };

NV_API::GPU_GetTachReading_t NV_API::GPU_GetTachReading{ NULL };
NV_API::GPU_GetThermalSettings_t NV_API::GPU_GetThermalSettings{ NULL };
NV_API::GPU_GetCurrentPstate_t NV_API::GPU_GetCurrentPstate{ NULL };
Expand Down Expand Up @@ -85,6 +87,8 @@ void NV_API::initialize()
DLL_ClientThermalPoliciesGetLimit = (DLL_ClientThermalPoliciesGetLimit_t)QueryInterface(NvAPI_FUNCTIONS::ClientThermalPoliciesGetLimit);
GPU_GetCoolersSettings = (GPU_GetCoolersSettings_t)QueryInterface(NvAPI_FUNCTIONS::GetCoolersSettings);

GPU_GetMemoryInfo = (GPU_GetMemoryInfo_t)QueryInterface(NvAPI_FUNCTIONS::GetMemoryInfo);

GPU_GetTachReading = (GPU_GetTachReading_t)QueryInterface(NvAPI_FUNCTIONS::GetTachReading);
GPU_GetThermalSettings = (GPU_GetThermalSettings_t)QueryInterface(NvAPI_FUNCTIONS::GetThermalSettings);
GPU_GetPstates20 = (GPU_GetPstates20_t)QueryInterface(NvAPI_FUNCTIONS::GetPstates20);
Expand Down Expand Up @@ -140,6 +144,22 @@ NvAPI_Status NV_API::getErrorMessage(NvAPI_Status errStatus, std::string *messag
return NVAPI_OK;
}

NvAPI_Status NV_API::getDeviceMemory(int *memorySize)
{
*memorySize = 0;
if (deviceHandle == NULL) return NVAPI_NVIDIA_DEVICE_NOT_FOUND;

NV_DISPLAY_DRIVER_MEMORY_INFO_V3 memoryInfo{ 0 };
memoryInfo.version = NV_DISPLAY_DRIVER_MEMORY_INFO_VER_3;

auto status = GPU_GetMemoryInfo(deviceHandle, &memoryInfo);
if (status != NVAPI_OK) return status;

*memorySize = memoryInfo.dedicatedVideoMemory;

return NVAPI_OK;
}

NvAPI_Status NV_API::getSettingMaxCoreClock(int *maxCoreClock)
{
*maxCoreClock = -1;
Expand Down
21 changes: 20 additions & 1 deletion CudaSoliditySHA3Solver/device/nv_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,19 @@ class NV_API
} NV_GPU_COOLER_SETTINGS_V2;
# define NV_GPU_COOLER_SETTINGS_VER_2 MAKE_NVAPI_VERSION(NV_GPU_COOLER_SETTINGS_V2, 2)

typedef struct _NV_DISPLAY_DRIVER_MEMORY_INFO_V3
{
NvU32 version;
NvU32 dedicatedVideoMemory;
NvU32 availableDedicatedVideoMemory;
NvU32 systemVideoMemory;
NvU32 sharedSystemMemory;
NvU32 curAvailableDedicatedVideoMemory;
NvU32 dedicatedVideoMemoryEvictionsSize;
NvU32 dedicatedVideoMemoryEvictionCount;
} NV_DISPLAY_DRIVER_MEMORY_INFO_V3;
# define NV_DISPLAY_DRIVER_MEMORY_INFO_VER_3 MAKE_NVAPI_VERSION(NV_DISPLAY_DRIVER_MEMORY_INFO_V3, 2)

typedef void *(*QueryInterface_t) (NvAPI_FUNCTIONS offset);
typedef NvAPI_Status(*GetErrorMessage_t) (NvAPI_Status status, NvAPI_ShortString message);

Expand All @@ -260,7 +273,9 @@ class NV_API
typedef NvAPI_Status(*GPU_GetAllClockFrequencies_t) (NvPhysicalGpuHandle handle, NV_GPU_CLOCK_FREQUENCIES_V2 *pClkFreqs);
typedef NvAPI_Status(*DLL_ClientPowerPoliciesGetStatus_t) (NvPhysicalGpuHandle handle, NVAPI_GPU_POWER_STATUS *powerStatus);
typedef NvAPI_Status(*DLL_ClientThermalPoliciesGetLimit_t) (NvPhysicalGpuHandle handle, NVAPI_GPU_THERMAL_LIMIT_V2 *thermalLimit);
typedef NvAPI_Status(*GPU_GetCoolersSettings_t) (NvPhysicalGpuHandle handle, NvU32 coolerIndex, NV_GPU_COOLER_SETTINGS_V2* coolerSettings);
typedef NvAPI_Status(*GPU_GetCoolersSettings_t) (NvPhysicalGpuHandle handle, NvU32 coolerIndex, NV_GPU_COOLER_SETTINGS_V2 *coolerSettings);

typedef NvAPI_Status(*GPU_GetMemoryInfo_t) (NvPhysicalGpuHandle handle, NV_DISPLAY_DRIVER_MEMORY_INFO_V3 *memoryInfo);

typedef NvAPI_Status(*GPU_GetTachReading_t) (NvPhysicalGpuHandle handle, NvU32 *value);
typedef NvAPI_Status(*GPU_GetThermalSettings_t) (NvPhysicalGpuHandle handle, NvU32 sensorIndex, NV_GPU_THERMAL_SETTINGS_V2 *thermalSettings);
Expand All @@ -282,6 +297,8 @@ class NV_API
static DLL_ClientThermalPoliciesGetLimit_t DLL_ClientThermalPoliciesGetLimit;
static GPU_GetCoolersSettings_t GPU_GetCoolersSettings;

static GPU_GetMemoryInfo_t GPU_GetMemoryInfo;

static GPU_GetTachReading_t GPU_GetTachReading;
static GPU_GetThermalSettings_t GPU_GetThermalSettings;
static GPU_GetPstates20_t GPU_GetPstates20;
Expand All @@ -308,6 +325,8 @@ class NV_API

NvAPI_Status getErrorMessage(NvAPI_Status status, std::string *message);

NvAPI_Status getDeviceMemory(int *memorySize);

NvAPI_Status getSettingMaxCoreClock(int *maxCoreClock);
NvAPI_Status getSettingMaxMemoryClock(int *maxMemoryClock);
NvAPI_Status getSettingPowerLimit(int *powerLimit);
Expand Down
2 changes: 2 additions & 0 deletions CudaSoliditySHA3Solver/device/nv_apiEnum.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ typedef enum _NvAPI_FUNCTIONS
ClientThermalPoliciesGetLimit = 0xE9C425A1,
GetCoolersSettings = 0xDA141340,

GetMemoryInfo = 0x07F9B368,

GetTachReading = 0x5F608315,
GetThermalSettings = 0xE3640A56,
GetPstates20 = 0x6FF81213,
Expand Down
4 changes: 2 additions & 2 deletions OpenCLSoliditySHA3Solver/OpenCLSoliditySHA3Solver.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)$(SolutionName)\bin\$(Configuration)\netcoreapp2.1\</OutDir>
<OutDir>$(SolutionDir)$(SolutionName)\bin\$(Configuration)\netcoreapp2.2\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(SolutionDir)$(SolutionName)\bin\$(Configuration)\netcoreapp2.1\</OutDir>
<OutDir>$(SolutionDir)$(SolutionName)\bin\$(Configuration)\netcoreapp2.2\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
Expand Down
115 changes: 82 additions & 33 deletions OpenCLSoliditySHA3Solver/device/adl_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ ADL_API::ADL2_OVERDRIVEN_TEMPERATURE_GET ADL_API::ADL2_OverdriveN_Temperature_G

int ADL_API::numberOfAdapters{ -1 };
LPAdapterInfo ADL_API::lpAdapterInfo{ NULL };
bool ADL_API::apiFailedToLoad{ false };
bool ADL_API::isInitialized{ false };

void* __stdcall ADL_API::ADL_Main_Memory_Alloc(int iSize)
Expand All @@ -75,44 +76,49 @@ void* __stdcall ADL_API::ADL_Main_Memory_Alloc(int iSize)

bool ADL_API::FoundAdlApi()
{
if (apiFailedToLoad) return false;
return (LoadLibrary(TEXT(ADL64_API)) != NULL);
}

void ADL_API::initialize()
{
hDLL = LoadLibrary(TEXT(ADL64_API));
if (hDLL == NULL) throw std::runtime_error("Failed to initialize ADL64_API.");
try
{
hDLL = LoadLibrary(TEXT(ADL64_API));
if (hDLL == NULL) throw std::runtime_error("Failed to initialize ADL64_API.");

ADL_Main_Control_Create = (ADL_MAIN_CONTROL_CREATE)GetProcAddress(hDLL, "ADL_Main_Control_Create");
ADL_Main_Control_Destroy = (ADL_MAIN_CONTROL_DESTROY)GetProcAddress(hDLL, "ADL_Main_Control_Destroy");
ADL_Main_Control_Create = (ADL_MAIN_CONTROL_CREATE)GetProcAddress(hDLL, "ADL_Main_Control_Create");
ADL_Main_Control_Destroy = (ADL_MAIN_CONTROL_DESTROY)GetProcAddress(hDLL, "ADL_Main_Control_Destroy");

if (NULL == ADL_Main_Control_Create || NULL == ADL_Main_Control_Destroy)
throw std::runtime_error("Failed to get ADL function pointers.");
if (NULL == ADL_Main_Control_Create || NULL == ADL_Main_Control_Destroy)
throw std::runtime_error("Failed to get ADL function pointers.");

ADL_Adapter_NumberOfAdapters_Get = (ADL_ADAPTER_NUMBEROFADAPTERS_GET)GetProcAddress(hDLL, "ADL_Adapter_NumberOfAdapters_Get");
ADL_Adapter_AdapterInfo_Get = (ADL_ADAPTER_ADAPTERINFO_GET)GetProcAddress(hDLL, "ADL_Adapter_AdapterInfo_Get");
ADL2_OverdriveN_Capabilities_Get = (ADL2_OVERDRIVEN_CAPABILITIES_GET)GetProcAddress(hDLL, "ADL2_OverdriveN_Capabilities_Get");
ADL2_OverdriveN_SystemClocks_Get = (ADL2_OVERDRIVEN_SYSTEMCLOCKS_GET)GetProcAddress(hDLL, "ADL2_OverdriveN_SystemClocks_Get");
ADL2_OverdriveN_MemoryClocks_Get = (ADL2_OVERDRIVEN_MEMORYCLOCKS_GET)GetProcAddress(hDLL, "ADL2_OverdriveN_MemoryClocks_Get");
ADL2_OverdriveN_PerformanceStatus_Get = (ADL2_OVERDRIVEN_PERFORMANCESTATUS_GET)GetProcAddress(hDLL, "ADL2_OverdriveN_PerformanceStatus_Get");
ADL2_OverdriveN_FanControl_Get = (ADL2_OVERDRIVEN_FANCONTROL_GET)GetProcAddress(hDLL, "ADL2_OverdriveN_FanControl_Get");
ADL2_OverdriveN_PowerLimit_Get = (ADL2_OVERDRIVEN_POWERLIMIT_GET)GetProcAddress(hDLL, "ADL2_OverdriveN_PowerLimit_Get");
ADL2_OverdriveN_Temperature_Get = (ADL2_OVERDRIVEN_TEMPERATURE_GET)GetProcAddress(hDLL, "ADL2_OverdriveN_Temperature_Get");
ADL2_Overdrive_Caps = (ADL2_OVERDRIVE_CAPS)GetProcAddress(hDLL, "ADL2_Overdrive_Caps");
ADL_Adapter_NumberOfAdapters_Get = (ADL_ADAPTER_NUMBEROFADAPTERS_GET)GetProcAddress(hDLL, "ADL_Adapter_NumberOfAdapters_Get");
ADL_Adapter_AdapterInfo_Get = (ADL_ADAPTER_ADAPTERINFO_GET)GetProcAddress(hDLL, "ADL_Adapter_AdapterInfo_Get");
ADL2_OverdriveN_Capabilities_Get = (ADL2_OVERDRIVEN_CAPABILITIES_GET)GetProcAddress(hDLL, "ADL2_OverdriveN_Capabilities_Get");
ADL2_OverdriveN_SystemClocks_Get = (ADL2_OVERDRIVEN_SYSTEMCLOCKS_GET)GetProcAddress(hDLL, "ADL2_OverdriveN_SystemClocks_Get");
ADL2_OverdriveN_MemoryClocks_Get = (ADL2_OVERDRIVEN_MEMORYCLOCKS_GET)GetProcAddress(hDLL, "ADL2_OverdriveN_MemoryClocks_Get");
ADL2_OverdriveN_PerformanceStatus_Get = (ADL2_OVERDRIVEN_PERFORMANCESTATUS_GET)GetProcAddress(hDLL, "ADL2_OverdriveN_PerformanceStatus_Get");
ADL2_OverdriveN_FanControl_Get = (ADL2_OVERDRIVEN_FANCONTROL_GET)GetProcAddress(hDLL, "ADL2_OverdriveN_FanControl_Get");
ADL2_OverdriveN_PowerLimit_Get = (ADL2_OVERDRIVEN_POWERLIMIT_GET)GetProcAddress(hDLL, "ADL2_OverdriveN_PowerLimit_Get");
ADL2_OverdriveN_Temperature_Get = (ADL2_OVERDRIVEN_TEMPERATURE_GET)GetProcAddress(hDLL, "ADL2_OverdriveN_Temperature_Get");
ADL2_Overdrive_Caps = (ADL2_OVERDRIVE_CAPS)GetProcAddress(hDLL, "ADL2_Overdrive_Caps");

if (ADL_Main_Control_Create(ADL_Main_Memory_Alloc, 1) != ADL_OK)
throw std::runtime_error("Failed to initialize nested ADL2 context.");
if (ADL_Main_Control_Create(ADL_Main_Memory_Alloc, 1) != ADL_OK)
throw std::runtime_error("Failed to initialize nested ADL2 context.");

if (ADL_Adapter_NumberOfAdapters_Get(&numberOfAdapters) != ADL_OK)
throw std::runtime_error("Cannot get the number of adapters!\n");
if (ADL_Adapter_NumberOfAdapters_Get(&numberOfAdapters) != ADL_OK)
throw std::runtime_error("Cannot get the number of adapters!\n");

if (0 < numberOfAdapters)
{
lpAdapterInfo = (LPAdapterInfo)malloc(sizeof(AdapterInfo) * numberOfAdapters);
std::memset(lpAdapterInfo, 0, sizeof(AdapterInfo) * numberOfAdapters);
if (numberOfAdapters > 0)
{
lpAdapterInfo = (LPAdapterInfo)malloc(sizeof(AdapterInfo) * numberOfAdapters);
std::memset(lpAdapterInfo, 0, sizeof(AdapterInfo) * numberOfAdapters);

ADL_Adapter_AdapterInfo_Get(lpAdapterInfo, sizeof(AdapterInfo) * numberOfAdapters);
ADL_Adapter_AdapterInfo_Get(lpAdapterInfo, sizeof(AdapterInfo) * numberOfAdapters);
}
}
catch (...) { apiFailedToLoad = true; }
}

void ADL_API::unload()
Expand All @@ -124,12 +130,45 @@ void ADL_API::unload()

void ADL_API::GetAdapterName(int adapterBusID, char *adapterName)
{
for (int i = 0; i < numberOfAdapters; ++i)
if (lpAdapterInfo[i].iBusNumber == adapterBusID)
if (lpAdapterInfo == NULL) return;
try
{
for (int i = 0; i < numberOfAdapters; ++i)
{
if (lpAdapterInfo[i].iBusNumber == adapterBusID)
{
std::memcpy((void *)adapterName, lpAdapterInfo[i].strAdapterName, sizeof(lpAdapterInfo[i].strAdapterName));
return;
}
}
}
catch (...)
{
if (apiFailedToLoad) return;
try
{
std::memcpy((void *)adapterName, lpAdapterInfo[i].strAdapterName, sizeof(lpAdapterInfo[i].strAdapterName));
return;
if (ADL_Adapter_NumberOfAdapters_Get(&numberOfAdapters) != ADL_OK)
throw std::runtime_error("Cannot get the number of adapters!\n");

if (numberOfAdapters > 0)
{
lpAdapterInfo = (LPAdapterInfo)malloc(sizeof(AdapterInfo) * numberOfAdapters);
std::memset(lpAdapterInfo, 0, sizeof(AdapterInfo) * numberOfAdapters);

ADL_Adapter_AdapterInfo_Get(lpAdapterInfo, sizeof(AdapterInfo) * numberOfAdapters);
}

for (int i = 0; i < numberOfAdapters; ++i)
{
if (lpAdapterInfo[i].iBusNumber == adapterBusID)
{
std::memcpy((void *)adapterName, lpAdapterInfo[i].strAdapterName, sizeof(lpAdapterInfo[i].strAdapterName));
return;
}
}
}
catch (...) {}
}
}

// --------------------------------------------------------------------
Expand Down Expand Up @@ -167,10 +206,20 @@ void ADL_API::AssignPciBusID(uint32_t adapterBusID)
m_supported = 0;
this->m_adapterBusID = adapterBusID;

for (int i = 0; i < numberOfAdapters; ++i)
if (lpAdapterInfo[i].iBusNumber == (int)adapterBusID) m_adapterInfo = lpAdapterInfo[i];

ADL2_Overdrive_Caps(m_context, m_adapterInfo.iAdapterIndex, &m_supported, &m_enabled, &m_version);
if (lpAdapterInfo != NULL)
for (int i = 0; i < numberOfAdapters; ++i)
{
try
{
if (lpAdapterInfo[i].iBusNumber == (int)adapterBusID) m_adapterInfo = lpAdapterInfo[i];
}
catch (...) {}
}
try
{
ADL2_Overdrive_Caps(m_context, m_adapterInfo.iAdapterIndex, &m_supported, &m_enabled, &m_version);
}
catch (...) {}
}

void ADL_API::GetAdapterName(std::string *adapterName)
Expand Down
1 change: 1 addition & 0 deletions OpenCLSoliditySHA3Solver/device/adl_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class ADL_API

static int numberOfAdapters;
static LPAdapterInfo lpAdapterInfo;
static bool apiFailedToLoad;

static void* __stdcall ADL_Main_Memory_Alloc(int iSize); // Memory allocation function

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# SoliditySHA3Miner
All-in-one mixed multi-GPU (nVidia, AMD, Intel) & CPU miner solves proof of work to mine supported EIP918 tokens in a single instance (with API).

Current latest public release version: [2.2.0](https://github.com/lwYeo/SoliditySHA3Miner/releases/latest)
Current latest public release version: [2.2.2](https://github.com/lwYeo/SoliditySHA3Miner/releases/latest)

Runs on Windows x64, HiveOS, EthOS, and Ubuntu.

Built with .NET Core 2.1.5 SDK, VC++ 2017, gcc 4.8.5, nVidia CUDA SDK 9.2 64-bits, and AMD APP SDK v3.0.130.135 (OpenCL)
Built with .NET Core 2.2 SDK, VC++ 2017, gcc 4.8.5, nVidia CUDA SDK 10.0 64-bit, and AMD APP SDK v3.0.130.135 (OpenCL)

- .NET Core 2.1 can be downloaded from [https://www.microsoft.com/net/download]

Expand Down
2 changes: 2 additions & 0 deletions SoliditySHA3Miner/.vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"args": [
"build",
"${workspaceFolder}/SoliditySHA3Miner.csproj",
"-f",
"netcoreapp2.2",
"-c",
"Release",
"-o",
Expand Down
Loading

0 comments on commit a82f1e2

Please sign in to comment.