Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ForEach Object Error #920

Closed
markusvonplunkett opened this issue Jan 3, 2018 · 21 comments
Closed

ForEach Object Error #920

markusvonplunkett opened this issue Jan 3, 2018 · 21 comments

Comments

@markusvonplunkett
Copy link

markusvonplunkett commented Jan 3, 2018

I have just updated to the latest version of MPM (v2.7.1.0) and I am getting the following error when running and occasionally whilst mining:

`ForEach-Object : You cannot call a method on a null-valued expression.
At C:\Users\Mark\Desktop\MultiPoolMiner - v2.7.1.0\Include.psm1:174 char:61

  • ... ($_ | Get-Content | ConvertFrom-Json) | ForEach-Object {
  •                                                      ~~~~~~~~~~~~~~~~
    
  • CategoryInfo : InvalidOperation: (:) [ForEach-Object], RuntimeException
  • FullyQualifiedErrorId : InvokeMethodOnNull,Microsoft.PowerShell.Commands.ForEachObjectCommand`

Screenshot: https://www.dropbox.com/s/zps6uobnixddpwx/error.PNG?dl=0

@IDontKnow-YouTube
Copy link

Had the same issue on a fresh install that I interrupted during benchmarking. Ran ResetBenchmark and it cleared the issue.

@almothafar
Copy link

Got the same issue, ResetBenchmark not worked for me, I followed all important notes but was not helpful.

@UselessGuru
Copy link
Contributor

Please try after deleting ALL files in the stats folder.

@almothafar
Copy link

@UselessGuru I really tried that many times, and even with a fresh version, by removing all files, extract the files again and modifying .bat files and run it again.

@UselessGuru
Copy link
Contributor

@almothafar

Does the error occur already on first start, or after subsequent runs?

The error comes from reading one of the files in one of the following directories:
\Stats
\Pools
\Miners

We have to find out which file is causing it. Can you do a fresh install (yes - once more). Do NOT edit any files!

Then BEFORE you start:

  • remove all miner files (stats folder is still empty)
  • Run MPM -> error still here? You might get 'no miners available' - that expected
  • If yes, remove all stats files, remove all but on pool files
  • Run MPM -> Error still here? -> If yes than I am puzzled
  • if not (you will see no miners available, but that's expected), then add another pool file, delete all stats, run MPM again. Loop until you find the Pool file causing problems
    -If all pools are working then:
  • Put the miner files back one by one, alwas deleting all the stat before each try.

Also could you please upload the logs for the problematic run.

Please note that future releases will include extra functionality to aid debugging this like this.

@almothafar
Copy link

almothafar commented Jan 11, 2018

@UselessGuru actually the issue was happening with any Miner, without miners, I get no issues but the warning.

For pools I have only "MiningPoolHub.ps1" and "MiningPoolHubCoins.ps1", I don't need anything else anyway.

Logs.zip

Edit:

And this is will all pools in:

2018-01-11_23-30-09.txt

Still in progress but you can many issues.

@aaronsace
Copy link
Member

aaronsace commented Jan 11, 2018

There is something wrong with your opencl.dll that is needed for the AMD miner files like sgminer.

Exception calling "GetPlatformIDs" with "0" argument(s): "OpenCl error -1001: -1001."

OpenCL support is included in the latest NVIDIA GPU drivers, available at www.nvidia.com/drivers

@almothafar
Copy link

almothafar commented Jan 11, 2018

@aaronsace

I have the version of nVidia driver is 388, currently, I'm updating it to 390

Anyway, this is the log file for just extract and run, nothing changed:
2018-01-11_23-38-58.txt

@aaronsace
Copy link
Member

Same error; OpenCL. Delete the miner files for now.

@aaronsace
Copy link
Member

This is the function that the AMD miner files use that's not working:

public static Platform[] GetPlatformIDs()
{
	ErrorCode error;
	uint count;

	error = NativeMethods.clGetPlatformIDs(0, null, out count);
	if (error != ErrorCode.Success) {
		throw new OpenClException(error);
	}

	var ids = new IntPtr[count] ;
	error = NativeMethods.clGetPlatformIDs(count, ids, out count);
	if (error != ErrorCode.Success) {
		throw new OpenClException(error);
	}

	var res = new Platform[count];
	for (var i=0; i<count; i++) {
		res[i] = new Platform(ids[i]);
	}
	return res;
}

@almothafar
Copy link

Why it is AMD I got Intel here, is it normal?

@aaronsace
Copy link
Member

aaronsace commented Jan 11, 2018

There has been 23 commits to the wrapper that I'm using, maybe it's been fixed:
https://github.com/aaronsace/opencl-sharp

@almothafar Does this fix any of the OpenCL issues:
OpenCL.zip

@aaronsace
Copy link
Member

@almothafar You have NVidia not Intel.

@almothafar
Copy link

Oh nvm, I thought it is CPU not GPU, anyway, I tried new OpenCL files and have no logs, only the following errors:


WARNING: (2110) : 'UnmanagedType.Struct' is obsolete: 'Applying UnmanagedType.Struct is unnecessary when marshalling a struct. Support for UnmanagedType.Struct when marshalling a reference type may be unavailable in future releases.'

WARNING: (2123) : 'UnmanagedType.Struct' is obsolete: 'Applying UnmanagedType.Struct is unnecessary when marshalling a struct. Support for UnmanagedType.Struct when marshalling a reference type may be unavailable in future releases.'

WARNING: (2136) : 'UnmanagedType.Struct' is obsolete: 'Applying UnmanagedType.Struct is unnecessary when marshalling a struct. Support for UnmanagedType.Struct when marshalling a reference type may be unavailable in future releases.'

WARNING: (2147) : 'UnmanagedType.Struct' is obsolete: 'Applying UnmanagedType.Struct is unnecessary when marshalling a struct. Support for UnmanagedType.Struct when marshalling a reference type may be unavailable in future releases.'

WARNING: (2158) : 'UnmanagedType.Struct' is obsolete: 'Applying UnmanagedType.Struct is unnecessary when marshalling a struct. Support for UnmanagedType.Struct when marshalling a reference type may be unavailable in future releases.'

WARNING: (2169) : 'UnmanagedType.Struct' is obsolete: 'Applying UnmanagedType.Struct is unnecessary when marshalling a struct. Support for UnmanagedType.Struct when marshalling a reference type may be unavailable in future releases.'

WARNING: (2180) : 'UnmanagedType.Struct' is obsolete: 'Applying UnmanagedType.Struct is unnecessary when marshalling a struct. Support for UnmanagedType.Struct when marshalling a reference type may be unavailable in future releases.'

WARNING: (2194) : 'UnmanagedType.Struct' is obsolete: 'Applying UnmanagedType.Struct is unnecessary when marshalling a struct. Support for UnmanagedType.Struct when marshalling a reference type may be unavailable in future releases.'

WARNING: (2203) : 'UnmanagedType.Struct' is obsolete: 'Applying UnmanagedType.Struct is unnecessary when marshalling a struct. Support for UnmanagedType.Struct when marshalling a reference type may be unavailable in future releases.'

WARNING: (2247) : 'UnmanagedType.Struct' is obsolete: 'Applying UnmanagedType.Struct is unnecessary when marshalling a struct. Support for UnmanagedType.Struct when marshalling a reference type may be unavailable in future releases.'

WARNING: (2252) : 'UnmanagedType.Struct' is obsolete: 'Applying UnmanagedType.Struct is unnecessary when marshalling a struct. Support for UnmanagedType.Struct when marshalling a reference type may be unavailable in future releases.'

& : (373) : A using clause must precede all other elements defined in the namespace except extern alias declarations
At line:1 char:3
+ & .\multipoolminer.ps1 -username almothafar -workername mariam -regio ...
+   ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (D:\MultiPoolMiner\Include.psm1:String) [], RuntimeException
+ FullyQualifiedErrorId : SOURCE_CODE_ERROR,Microsoft.PowerShell.Commands.AddTypeCommand

@aaronsace
Copy link
Member

aaronsace commented Jan 12, 2018

Fixed compilation issues, try now:
OpenCL.zip

Send me the output of 'Test.bat'.

@almothafar
Copy link

Still failing, test.bat output was:

D:\MultiPoolMiner\OpenCL>pwsh -noexit -executionpolicy bypass -windowstyle maximized -command "Add-Type -Path .\*.cs; [OpenCl.Platform]::GetPlatformIDs()"
Exception calling "GetPlatformIDs" with "0" argument(s): "OpenCl error -1001: -1001."
At line:1 char:24
+ Add-Type -Path .\*.cs; [OpenCl.Platform]::GetPlatformIDs()
+                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : OpenClException

PS D:\MultiPoolMiner\OpenCL>

Logfile:
2018-01-14_16-44-31.txt

@aaronsace
Copy link
Member

aaronsace commented Jan 14, 2018

Try running the test bat as an admin; do you get the same output?

Are you using remote desktop?

Have you tried completely uninstalling the driver then downloading and installing the new one?

@aaronsace
Copy link
Member

I've found an official NVidia test example:
oclDeviceQuery.zip

If that works then I know it's something wrong with what I'm doing.
If that doesn't work then I know there is something wrong with your system.

@almothafar
Copy link

I was always doing run as administrator.
No, I'm on the machine.
Yes, many times, and I tried to see if any of those drivers software can fix driver issues (if found any), like Device Doctor, Driver Booster and so on.

For the Device Query, it seems not working, so it is my system?
oclDeviceQuery.txt

@aaronsace
Copy link
Member

Must be, as it says here that OpenCL is included in that drivers link and has the example usage below:
https://developer.nvidia.com/opencl

From the perspective of getting MultiPoolMiner to run, delete any files in the folder called 'miners' that contain the word 'opencl'.

@almothafar
Copy link

Thanks for your efforts, I started the benchmark now and it seems going without any error as initial run, not completed the run yet it is ongoing now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants