Pages:
Author

Topic: New .Net Miner (now with GPU and long poll!) (Read 8499 times)

full member
Activity: 175
Merit: 102
August 11, 2011, 08:12:18 PM
#50
Sweet. Any places you feel the code needs immediate attention? I'll probably screw around with it this weekend.

Well, BFI_INT stuff needs to be added. That's pretty crappy to do though.

Most of the outstanding stuff I need to do requires a bit of rearch. I want to add support for running miner plugins out of process of the main program. Once that is in, the processes can be started and stopped dynamically in the Console session, so they have GPU access.

I need more events flowing from the miner processes up to the main program. They already expose Resources, which represent something like a CPU, or a GPU, but those Resources can be a bit more descriptive. Hash count tracking per-resource would be nice. Then, when the main program is getting events from all of the stuff it's running, the console UI can be updated a bit (maybe using curses stuff) to show exactly what's happening. What GPUs are running. What pools are running. What GPUs are working on work from what pool, etc.

I'd like a miner plugin factory to be able to, with a resource, also advertise possible run-modes of the miner. Such as work group size, vector modes, etc. This way, instead of the user having to specify what options he wants the program to use, it just tries them all during the test phase, and picks the fastest.

Pool configuration stored in some other structure than System.Configuration would be nice. Or maybe System.Configuration is fine, but it needs to be configurable at runtime. You need to be able to alter the pools at runtime... for a future WPF UI.



Finally have gotten around to taking a look at this, now that my other stuff is more or less complete -

BFI_INT stuff - I'm guessing you say this is crappy because it requires doing brand detection, yes?  Being that it's supported on AMD/ATI cards you'd have to be sure to pass it only on those cards.

Miners running outside the main program - how do you feel about implementing a WCF service between them for communication?  It's a simple enough thing to do, although some might consider it a somewhat heavy-handed method of communication.
hero member
Activity: 658
Merit: 500
tried running it, just stuck on 0 mhash/s
any ideas? I'm running straight from the package, I edited my console.exe.config to




    
    
                    name="bitmaker.miner"
            type="BitMaker.Miner.ConfigurationSection, BitMaker.Miner" />
    


    
   
                        url="http://iopq.me:***@mineco.in:3000/" />
    

    



running windows 7 64 bit
sr. member
Activity: 254
Merit: 250
I'd like to support the .Net solution. I always want to write one but too lazy...
hero member
Activity: 700
Merit: 507
Hm... do i need something special to make it run with GPU?
Tried it on two machines, one with a 4670 and one with a 6850 - both gave me but 1.500kh - so i guess it was using only CPU...

Any ideas someone here?



*edit*
Bugreport:

After a while the program throws an exception: factory is "null"
Code:
        private IMiner StartMiner(IMinerFactory factory, MinerResource resource, IMinerContext context)
        {
            lock (syncRoot)
            {
                var miner = factory.StartMiner(context, resource); //here it throws it. Factory is NULL
                Miners.Add(new MinerEntry(miner, resource));
                return miner;
            }
        }


*edit2*
After changing the previous code to check wether factory is null or not i got INVALIDS and SOLUTIONS - but they dont get reported to my proxy or the pool. It also says it was using GPU - though i doubt that at 1 to 5 kh...
newbie
Activity: 39
Merit: 0
Hmm. I had this problem on a Windows Server 2008 box. I just did a little work, and I think it's a missing dependency for the C++ stuff.

I believe you need the Microsoft Visual C++ Runtime (x64) installed.

http://www.microsoft.com/download/en/details.aspx?id=14632

I might be wrong.
sr. member
Activity: 418
Merit: 250
I edited both config files, and tried running both EXE's, and both crashed.

One had some information as it crashed, so I took a screenshot (it then proceeded to crash my display driver)

Hardware is an i5 Lynnfield that gets 15.5 MH/s on Ufasoft's SSE2 miner, and a GTX570 with ForceWare 275.50

newbie
Activity: 39
Merit: 0
I should also note that I'm kind of an architecture snob. I don't like hacks. I like clean, well designed code, with lots of separation between layers, and lots of comments. This is mostly just a for-fun project for me, so I will probably have strong opinions about how something should be designed. It's practice.
newbie
Activity: 39
Merit: 0
Sweet. Any places you feel the code needs immediate attention? I'll probably screw around with it this weekend.

Well, BFI_INT stuff needs to be added. That's pretty crappy to do though.

Most of the outstanding stuff I need to do requires a bit of rearch. I want to add support for running miner plugins out of process of the main program. Once that is in, the processes can be started and stopped dynamically in the Console session, so they have GPU access.

I need more events flowing from the miner processes up to the main program. They already expose Resources, which represent something like a CPU, or a GPU, but those Resources can be a bit more descriptive. Hash count tracking per-resource would be nice. Then, when the main program is getting events from all of the stuff it's running, the console UI can be updated a bit (maybe using curses stuff) to show exactly what's happening. What GPUs are running. What pools are running. What GPUs are working on work from what pool, etc.

I'd like a miner plugin factory to be able to, with a resource, also advertise possible run-modes of the miner. Such as work group size, vector modes, etc. This way, instead of the user having to specify what options he wants the program to use, it just tries them all during the test phase, and picks the fastest.

Pool configuration stored in some other structure than System.Configuration would be nice. Or maybe System.Configuration is fine, but it needs to be configurable at runtime. You need to be able to alter the pools at runtime... for a future WPF UI.

full member
Activity: 302
Merit: 100
Presale is live!
Ok, this is very cool.  I was looking for someone who had done this. If you need help with this, give me a hollar.  There is a reason I may be an ideal coding partner on this, which I will share over PM if you're interested.

You beat me to it.  I was still on the OpenCL .NET wrapper step.  That said, I've only been looking into Bitcoin for 9 days Smiley

Next step:  .NET pushpool.

That may be my next "side" project...

Already being worked on: https://github.com/Zagitta/Zetlon.Coinster :p
full member
Activity: 175
Merit: 102
Ok, this is very cool.  I was looking for someone who had done this. If you need help with this, give me a hollar.  There is a reason I may be an ideal coding partner on this, which I will share over PM if you're interested.

You beat me to it.  I was still on the OpenCL .NET wrapper step.  That said, I've only been looking into Bitcoin for 9 days Smiley

Next step:  .NET pushpool.

That may be my next "side" project...

Well there's work to be done on it, so just do it. Wink

Sweet. Any places you feel the code needs immediate attention? I'll probably screw around with it this weekend.
XIU
member
Activity: 84
Merit: 10

I've never even noticed this! Assumed you were talking about the SHA256 one. I'm still going to assume it's faster for all the same reasons minus the P/Invoke.

Don't forget that on WinXP (yeah lol) only the Managed one is supported. We use the following code in our systems:

var sha256provider = Environment.OSVersion.Version.Major >= 6 ? new SHA256CryptoServiceProvider() : SHA256.Create();
newbie
Activity: 39
Merit: 0
Ok, this is very cool.  I was looking for someone who had done this. If you need help with this, give me a hollar.  There is a reason I may be an ideal coding partner on this, which I will share over PM if you're interested.

You beat me to it.  I was still on the OpenCL .NET wrapper step.  That said, I've only been looking into Bitcoin for 9 days Smiley

Next step:  .NET pushpool.

That may be my next "side" project...

Well there's work to be done on it, so just do it. Wink
full member
Activity: 175
Merit: 102
Ok, this is very cool.  I was looking for someone who had done this. If you need help with this, give me a hollar.  There is a reason I may be an ideal coding partner on this, which I will share over PM if you're interested.

You beat me to it.  I was still on the OpenCL .NET wrapper step.  That said, I've only been looking into Bitcoin for 9 days Smiley

Next step:  .NET pushpool.

That may be my next "side" project...
newbie
Activity: 39
Merit: 0

I've never even noticed this! Assumed you were talking about the SHA256 one. I'm still going to assume it's faster for all the same reasons minus the P/Invoke.
full member
Activity: 302
Merit: 100
Presale is live!
What speed are you seeing on the completly managed SHA256 hasher you've made compared to the one built into the .net libary?

Don't know. Never tried the .Net one. I assume much faster. The .Net one's interface requires you to submit a byte[] of the data, which it no doubt has to split up internally into 64 byte blocks, and add the padding to. Additionally, when output, it probably reverses the endian. And thus it has to reverse it again when doing the second hash. And the second hash no doubt has to be copied, and padded, too. Also, I suspect that it probably uses CryptoAPI, so results in a P/Invoke.

You're probably right about the first part however i only think the non managed version in the .net framework uses P/Invoke, i mean why else would they also have a managed version?

http://msdn.microsoft.com/en-us/library/system.security.cryptography.sha256managed.aspx vs  http://msdn.microsoft.com/en-us/library/system.security.cryptography.sha256cryptoserviceprovider.aspx
newbie
Activity: 35
Merit: 0
I can't get the miner to log into deepbit.  It keeps giving me an authentication error.

Is anyone else having this problem?

--E
newbie
Activity: 39
Merit: 0
What speed are you seeing on the completly managed SHA256 hasher you've made compared to the one built into the .net libary?

Don't know. Never tried the .Net one. I assume much faster. The .Net one's interface requires you to submit a byte[] of the data, which it no doubt has to split up internally into 64 byte blocks, and add the padding to. Additionally, when output, it probably reverses the endian. And thus it has to reverse it again when doing the second hash. And the second hash no doubt has to be copied, and padded, too. Also, I suspect that it probably uses CryptoAPI, so results in a P/Invoke.
full member
Activity: 302
Merit: 100
Presale is live!
What speed are you seeing on the completly managed SHA256 hasher you've made compared to the one built into the .net libary?
newbie
Activity: 39
Merit: 0
Okay. I now support multiple pools. The format of the .config file has changed.


   
       
                            url="http://user:pass@host:8332/" />
                            url="http://user:pass@host:8332/" />
                            url="http://user:pass@host:8332/" />
       

   



Each time a thread desires work, it starts at the top and works it's way down. So, the pool at the top, if it's working, is currently always used. If it fails, the next one is tried. Work gets submitted back to the correct pool.

Thinking of implementing some sort of priority classing and load balancing to that. Maybe poolGroup or something.
newbie
Activity: 39
Merit: 0
It's decent. It's a proper wrapping of OpenCL. There's a small annoyance with a memory leak of ComputeEvent's being generated even though you pass null as a event list for most calls. That's easy enough to solve by passing a list to put them in and disposing of them immediately though. The only thing really wrongn with it is a complete lack of documentation as far as I can see. That's fine though, since it's nothing but a loose wrapper over OpenCL itself.
Pages:
Jump to: