Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
log, fixes, double key add fix (parameters parse)
Browse files Browse the repository at this point in the history
  • Loading branch information
S74nk0 committed Sep 26, 2016
1 parent 8705801 commit df526b2
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 12 deletions.
83 changes: 83 additions & 0 deletions AMDOpenCLDeviceDetection/AMDOpenCLDeviceDetection.vcxproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
Expand All @@ -22,31 +30,56 @@
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
Expand All @@ -67,6 +100,29 @@
<Command>copy /Y "$(AMDAPPSDKROOT)\bin\x86_64\OpenCL.dll" "$(SolutionDir)$(Configuration)\OpenCL.dll"
REM the path is absolute maybe fix
copy /Y "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\x64\Microsoft.VC120.CRT\msvcp120.dll" "$(SolutionDir)$(Configuration)\msvcp120.dll"
copy /Y "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\x64\Microsoft.VC120.CRT\msvcr120.dll" "$(SolutionDir)$(Configuration)\msvcr120.dll"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>.;$(AMDAPPSDKROOT)\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>OpenCL.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(AMDAPPSDKROOT)\lib\x86\</AdditionalLibraryDirectories>
</Link>
<PostBuildEvent>
<Command>copy /Y "$(AMDAPPSDKROOT)\bin\x86_64\OpenCL.dll" "$(SolutionDir)$(Configuration)\OpenCL.dll"
REM the path is absolute maybe fix
copy /Y "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\x64\Microsoft.VC120.CRT\msvcp120.dll" "$(SolutionDir)$(Configuration)\msvcp120.dll"
copy /Y "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\x64\Microsoft.VC120.CRT\msvcr120.dll" "$(SolutionDir)$(Configuration)\msvcr120.dll"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
Expand Down Expand Up @@ -94,6 +150,33 @@ copy /Y "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\x64\Micro
<Command>copy /Y "$(AMDAPPSDKROOT)\bin\x86_64\OpenCL.dll" "$(SolutionDir)$(Configuration)\OpenCL.dll"
REM the path is absolute maybe fix
copy /Y "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\x64\Microsoft.VC120.CRT\msvcp120.dll" "$(SolutionDir)$(Configuration)\msvcp120.dll"
copy /Y "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\x64\Microsoft.VC120.CRT\msvcr120.dll" "$(SolutionDir)$(Configuration)\msvcr120.dll"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>.;$(AMDAPPSDKROOT)\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>$(AMDAPPSDKROOT)\lib\x86\</AdditionalLibraryDirectories>
<AdditionalDependencies>OpenCL.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>copy /Y "$(AMDAPPSDKROOT)\bin\x86_64\OpenCL.dll" "$(SolutionDir)$(Configuration)\OpenCL.dll"
REM the path is absolute maybe fix
copy /Y "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\x64\Microsoft.VC120.CRT\msvcp120.dll" "$(SolutionDir)$(Configuration)\msvcp120.dll"
copy /Y "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\x64\Microsoft.VC120.CRT\msvcr120.dll" "$(SolutionDir)$(Configuration)\msvcr120.dll"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
Expand Down
2 changes: 1 addition & 1 deletion NiceHashMiner.sln
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Global
{36DC07F9-A4A6-4877-A146-1B960083CF6F}.Release|Win32.Build.0 = Release|x64
{36DC07F9-A4A6-4877-A146-1B960083CF6F}.Release|x64.ActiveCfg = Release|x64
{36DC07F9-A4A6-4877-A146-1B960083CF6F}.Release|x64.Build.0 = Release|x64
{F4D88D6A-2321-4431-AFD1-8B6A1760358B}.Debug|Any CPU.ActiveCfg = Debug|x64
{F4D88D6A-2321-4431-AFD1-8B6A1760358B}.Debug|Any CPU.ActiveCfg = Debug|Win32
{F4D88D6A-2321-4431-AFD1-8B6A1760358B}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
{F4D88D6A-2321-4431-AFD1-8B6A1760358B}.Debug|Mixed Platforms.Build.0 = Debug|x64
{F4D88D6A-2321-4431-AFD1-8B6A1760358B}.Debug|Win32.ActiveCfg = Debug|x64
Expand Down
1 change: 1 addition & 0 deletions NiceHashMiner/Forms/Form_Main.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 10 additions & 6 deletions NiceHashMiner/Miners/ExtraLaunchParametersParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,25 +78,29 @@ private static void LogParser(string msg) {
private static string Parse(List<ComputeDevice> CDevs, List<MinerOption> options, bool useIfDefaults = false, List<MinerOption> ignoreLogOpions = null) {
const string IGNORE_PARAM = "Cannot parse \"{0}\", not supported, set to ignore, or wrong extra launch parameter settings";
List<MinerOptionType> optionsOrder = new List<MinerOptionType>();
Dictionary<MinerOptionType, string> paramsFlags = new Dictionary<MinerOptionType, string>();
//Dictionary<MinerOptionType, string> paramsFlags = new Dictionary<MinerOptionType, string>();
Dictionary<string, Dictionary<MinerOptionType, string>> cdevOptions = new Dictionary<string, Dictionary<MinerOptionType, string>>();
Dictionary<MinerOptionType, bool> isOptionDefaults = new Dictionary<MinerOptionType, bool>();
Dictionary<MinerOptionType, bool> isOptionExist = new Dictionary<MinerOptionType, bool>();
// init devs options, and defaults
foreach (var cDev in CDevs) {
var defaults = new Dictionary<MinerOptionType, string>();
foreach (var option in options) {
defaults.Add(option.Type, option.Default);
//defaults.Add(option.Type, option.Default);
defaults[option.Type] = option.Default;
}
cdevOptions.Add(cDev.UUID, defaults);
//cdevOptions.Add(cDev.UUID, defaults);
cdevOptions[cDev.UUID] = defaults;
}
// init order and params flags, and params list
foreach (var option in options) {
MinerOptionType optionType = option.Type;
optionsOrder.Add(optionType);
paramsFlags.Add(optionType, option.LongName);
isOptionDefaults.Add(option.Type, true);
isOptionExist.Add(option.Type, false);

//isOptionDefaults.Add(optionType, true);
//isOptionExist.Add(optionType, false);
isOptionDefaults[optionType] = true;
isOptionExist[optionType] = false;
}
// parse
foreach (var cDev in CDevs) {
Expand Down
6 changes: 3 additions & 3 deletions NiceHashMiner/Miners/Miner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ protected Algorithm BenchmarkAlgorithm {
_benchmarkAlgorithm = value;
}
}
public BenchmarkProcessStatus BenchmarkProcessStatus { get; private set; }
private string BenchmarkProcessPath;
public BenchmarkProcessStatus BenchmarkProcessStatus { get; protected set; }
protected string BenchmarkProcessPath { get; private set; }
private Process BenchmarkHandle = null;
protected Exception BenchmarkException = null;
protected int BenchmarkTimeInSeconds;
Expand Down Expand Up @@ -435,7 +435,7 @@ protected double BenchmarkParseLine_cpu_ccminer_extra(string outdata) {

// killing proccesses can take time
virtual public void EndBenchmarkProcces() {
if (BenchmarkHandle != null && BenchmarkProcessStatus != BenchmarkProcessStatus.Killing) {
if (BenchmarkHandle != null && BenchmarkProcessStatus != BenchmarkProcessStatus.Killing && BenchmarkProcessStatus != BenchmarkProcessStatus.DoneKilling) {
BenchmarkProcessStatus = BenchmarkProcessStatus.Killing;
try {
Helpers.ConsolePrint("BENCHMARK", String.Format("Trying to kill benchmark process {0} algorithm {1}", BenchmarkProcessPath, BenchmarkAlgorithm.NiceHashName));
Expand Down
13 changes: 11 additions & 2 deletions NiceHashMiner/Miners/sgminer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,17 @@ public void KillSGMiner() {
}

public override void EndBenchmarkProcces() {
base.EndBenchmarkProcces();
KillSGMiner();
if (BenchmarkProcessStatus != BenchmarkProcessStatus.Killing && BenchmarkProcessStatus != BenchmarkProcessStatus.DoneKilling) {
BenchmarkProcessStatus = BenchmarkProcessStatus.Killing;
try {
Helpers.ConsolePrint("BENCHMARK", String.Format("Trying to kill benchmark process {0} algorithm {1}", BenchmarkProcessPath, BenchmarkAlgorithm.NiceHashName));
KillSGMiner();
} catch { } finally {
BenchmarkProcessStatus = BenchmarkProcessStatus.DoneKilling;
Helpers.ConsolePrint("BENCHMARK", String.Format("Benchmark process {0} algorithm {1} KILLED", BenchmarkProcessPath, BenchmarkAlgorithm.NiceHashName));
//BenchmarkHandle = null;
}
}
}

protected override int GET_MAX_CooldownTimeInMilliseconds() {
Expand Down

0 comments on commit df526b2

Please sign in to comment.