qubic-li / client

251 stars 27 forks source link

The type initializer for 'System.Management.WmiNetUtilsHelper' threw an exception when trying to use CUDA #42

Closed sec closed 6 months ago

sec commented 6 months ago

Windows, CUDA 12.3 installed, RTX 3060 - when trying to run with GPU, it throws this exception and start training using CPU.

2024-03-14 11:50:32     INFO    Starting Client 1.8.7.1
2024-03-14 11:50:32     INFO    Check for updates
2024-03-14 11:50:32     INFO    Your Client is up to date
System.TypeInitializationException: The type initializer for 'System.Management.WmiNetUtilsHelper' threw an exception.
 ---> System.TypeLoadException
   at System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointerInternal(IntPtr, Type)
   at System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointer[TDelegate](IntPtr)
   at System.Management.WmiNetUtilsHelper.LoadDelegate[TDelegate](TDelegate&, IntPtr, String)
   at System.Management.WmiNetUtilsHelper..cctor()
   --- End of inner exception stack trace ---
   at System.Management.MTAHelper.IsNoContextMTA()
   at System.Management.MTAHelper.CreateInMTA(Type)
   at System.Management.ManagementPath.CreateWbemPath(String)
   at System.Management.ManagementObjectSearcher..ctor(String, String)
   at li.qubic.trainer.Helper.HardwareHelper.GetCpuModelWindows()
   at li.qubic.trainer.Helper.HardwareHelper.GetCPUModel()
System.TypeInitializationException: The type initializer for 'System.Management.WmiNetUtilsHelper' threw an exception.
 ---> System.TypeLoadException
   at System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointerInternal(IntPtr, Type)
   at System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointer[TDelegate](IntPtr)
   at System.Management.WmiNetUtilsHelper.LoadDelegate[TDelegate](TDelegate&, IntPtr, String)
   at System.Management.WmiNetUtilsHelper..cctor()
   --- End of inner exception stack trace ---
   at System.Management.MTAHelper.IsNoContextMTA()
   at System.Management.MTAHelper.CreateInMTA(Type)
   at System.Management.ManagementPath.CreateWbemPath(String)
   at li.qubic.trainer.Helper.HardwareHelper.GetCPUCacheWindows()
   at li.qubic.trainer.Helper.HardwareHelper.GetCPUCache()
SevenXP commented 6 months ago

I have this problem and don't know how to solve this problem OS Windows 11 GPU RTX 3080 Ti I used last drivers for GPU I tried the version app (1.8.7.1 - 1.8.8)

for example my appsetings.json -> { "Settings": { "baseUrl": "https://mine.qubic.li/", "allowHwInfoCollect": true, "overwrites": { "CUDA": "10240" }, "accessToken": "......", "alias": "....." } }

J0ET0M commented 6 months ago

fixed in 1.8.9

SevenXP commented 6 months ago

@J0ET0M Unfortunately 1.8.9.0 didn't help me :(

2024-03-17 08:43:32 INFO Starting Client 1.8.9.0 2024-03-17 08:43:32 INFO Check for updates 2024-03-17 08:43:32 INFO Your Client is up to date System.TypeInitializationException: The type initializer for 'System.Management.WmiNetUtilsHelper' threw an exception. ---> System.TypeLoadException at System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointerInternal(IntPtr, Type) at System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointerTDelegate at System.Management.WmiNetUtilsHelper.LoadDelegate[TDelegate](TDelegate&, IntPtr, String) at System.Management.WmiNetUtilsHelper..cctor() --- End of inner exception stack trace --- at System.Management.MTAHelper.IsNoContextMTA() at System.Management.MTAHelper.CreateInMTA(Type) at System.Management.ManagementPath.CreateWbemPath(String) at li.qubic.trainer.Helper.HardwareHelper.GetCPUCacheWindows() at li.qubic.trainer.Helper.HardwareHelper.GetCPUCache() 2024-03-17 08:43:34 INFO AI Training Starting. Your Alias is RTX_3080_Ti 2024-03-17 08:43:34 INFO Waiting for task (0) 2024-03-17 08:43:35 INFO Trainer: cpu version 100.2 is starting. 2024-03-17 08:43:35 INFO Trainer: Version: AVX2 2024-03-17 08:43:35 INFO Trainer: Solution threshold: 44 2024-03-17 08:43:35 INFO Trainer: Accept score range [0,84] & [172,256] 2024-03-17 08:43:35 INFO Trainer: Neuron value limit: 0x10000000000 2024-03-17 08:43:35 INFO Trainer: Mining seed: ad04a287a144ba3f10e663d531908bde1b8eee712092903f485414dc22c8428b 2024-03-17 08:43:36 INFO E:100 | SOL: 0/0 | Try GYKP...ELQC | 4 it/s | 4 avg it/s 2024-03-17 08:43:37 INFO E:100 | SOL: 0/0 | Try GYKP...ELQC | 5 it/s | 4 avg it/s

I installed -> The runner on Windows also requires the VC Redistributable I had last version Windows and Nvidia Driver

CPU is working correct Ryzen 9 7900X ~ 104 it/s GPU RTX 3080 Ti - I can't start mining on GPU

sec commented 6 months ago

Issie is still there, even with the newest version. btw. where sources for miner can be found?

christoph2005 commented 6 months ago

I'm also having this problem on Windows 11 I'm pretty sure I've installed the necessary redistributibles. Cuda 12, .Net Runtime 6 and VC Redistributable

{ "Settings": { "baseUrl": "https://mine.qubic.li/", "amountOfThreads": 12, "allowHwInfoCollect":true, "overwrites":{"CUDA":12}, "accessToken": "", "alias": "" } }

2024-03-28 12:27:05 INFO Starting Client 1.8.10.0 2024-03-28 12:27:05 INFO Check for updates 2024-03-28 12:27:06 INFO Your Client is up to date System.TypeInitializationException: The type initializer for 'System.Management.WmiNetUtilsHelper' threw an exception. ---> System.TypeLoadException at System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointerInternal(IntPtr, Type) at System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointerTDelegate at System.Management.WmiNetUtilsHelper.LoadDelegate[TDelegate](TDelegate&, IntPtr, String) at System.Management.WmiNetUtilsHelper..cctor() --- End of inner exception stack trace --- at System.Management.MTAHelper.IsNoContextMTA() at System.Management.MTAHelper.CreateInMTA(Type) at System.Management.ManagementPath.CreateWbemPath(String) at li.qubic.trainer.Helper.HardwareHelper.GetCPUCacheWindows() at li.qubic.trainer.Helper.HardwareHelper.GetCPUCache() 2024-03-28 12:27:06 INFO AI Training Starting. Your Alias is *** 2024-03-28 12:33:30 INFO Waiting for task (0) 2024-03-28 12:33:35 INFO Trainer: cpu version 102.0 is starting. 2024-03-28 12:33:35 INFO Trainer: Version: AVX2 2024-03-28 12:33:35 INFO Trainer: Solution threshold: 43 2024-03-28 12:33:35 INFO Trainer: Accept score range [0,42] & [128,256] 2024-03-28 12:33:35 INFO Trainer: Neuron value limit: 0x1 2024-03-28 12:33:35 INFO Trainer: Mining seed: d0043409e683de0e3ff516b2c35ecb99f4cf2318e88d7e1f394567e314393671