The Hogwild example doesn't use my GPU when executing

I implemented the Hogwild example program from here. My PC has a GPU, but when I execute the program it does not use the GPU but all the CPU cores, why? How can I indicate I want it to be run with the GPU instead?

You can use the GPU by passing the --cuda argument as seen here.

Thanks, but I get an error: RuntimeError: Cannot pickle CUDA storage; try pickling a CUDA tensor instead, do you know how I can fix it?

Could you try to move these two lines right after the args = parser.parse_args() call?
I needed to move them as I got an error as:

RuntimeError: context has already been set

I’ll create an issue with a fix if I can reproduce it using the nightly (my current PyTorch build is a source build from a few weeks ago).

I did the moving of those lines and after running the program I got the context error, were you able to fix it?

I got the before changing anything. After I moved the lines of code it worked.
Are you only seeing the error after moving?

Hi, the context error displays when moving the lines as you told me, the pickle error occurs when running the posted code as is.