Click here to Skip to main content
15,923,689 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a Radeon AMD GPU, how can I run this script on my gpu to make it run faster:
Python
from cryptotools.BTC.HD import check, WORDS

with open("combo.txt", "r") as a_file:
    for line in a_file:
        stripped_line = line.strip()
        for word in WORDS:
            mnemonic = stripped_line.format(x=word)
            if check(mnemonic):
                print(mnemonic)
                with open("print.txt", "a") as i:
                    i.write(mnemonic)
                    i.write("\n")


What I have tried:

This is very new to me and I need some ideas to work from
Posted
Updated 22-Aug-21 5:12am

1 solution

You can't, or at least not without some serious thinking about what you are doing.
Code that runs on a GPU doesn't have any direct access to the host computer file system - it's an isolated device intended for processing, not I/O.

Basically, this is just your question yesterday in slightly different clothes: and nothing has changed since then.
Multithreading - no matter if done on the CPU or the GPU - is not a magic bullet which will automatically speed your computer up and allow you to process billion line files in moments. It can help, but it has to be thought about in great detail before you start work on designing a system to do it if you are going to get any sensible results out of it (and that pretty much means no file I/O at all on CPU or GPU!). Go back to yesterday's question, and read the answers again: nothing has changed sine they were written!
 
Share this answer
 
Comments
X_strong 22-Aug-21 11:19am    
Yes, you are right I read through yesterday's suggestions and realized the 5 million lines will not work, and researched Pyopencl options as an alternative since I have seen many open cl projects that run on python run extremely fast. I will have to go back to the drawing board on this
OriginalGriff 22-Aug-21 11:27am    
:D

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900