0
votes

I am using Andrej Karpathy's code to train a rnn. When I give the flag "-opencl 1" to tell it to use an opencl gpu, it uses integrated graphics and nothing else.

I tried reinstalling cltorch and using different flags, but nothing has seemed to work. To add to this I can't see if my gpu is under load because I'm on macos. I looked through the code and I could't find any errors, but I have little experience with lua.

Code can be found here: https://github.com/karpathy/char-rnn.

I expect with the flag "opencl 1" or something to the like, my radeon pro 560x will be used to train on my dataset and not my cpu or integrated graphics.

1
Have you tried different values for opt.gpuid into setDevice? Reading cltorch there is a "getDeviceCount" which probably returns 2 or 3; CPU, integrated graphics and discrete GPU, depending on what you have installed drivers for. - Andreas
I have tried using a 2 instead of 1 but it defaulted to the CPU. I’ll have to try getDeviceCount. Thanks for the comment. - AWOLASAP

1 Answers

0
votes

When reading instructions I thought just -opencl flag needed to be used but it turns out -gpuid needs to be used in conjuction with it as well. This was also after a reinstall of torch and opencl drivers, so that could have been a problem as well.