0

i am trying to make my code run on my GTX970m but instead it is running on my intel integrated graphics

i have tried

cp.cuda.Device(1).use()

since 0 is my intel graphics but i got

cupy.cuda.runtime.CUDARuntimeError: cudaErrorInvalidDevice: invalid device ordinal

my computer is runnig windows 10 64bit and on the intel graphics my code executes perfectly(and slowly)

here is what my code is doing: i have a 1000 by 1000 numpy matrix called phi then i do this:

def matrix_step_alt_gpu(phi):
    phiNPlus1 = phi.copy()
    phiNPlus1_c = (1 / (DX ** 2 + DY ** 2)) * ((DY ** 2 * cp.dot(LEFT, phi)) + (DX ** 2 * cp.dot(phi, LEFT)))
    phiNPlus1[1:-1, 1:-1] = phiNPlus1_c[1:-1, 1:-1]
    return phiNPlus1

and i repeat until this number(np.float64...) is maller the 10^-6:

np.float64(np.max(np.abs(phiNPlus1 - phi)) / PHI_0[0, 1])

just to remove any doubts i have also checked using my task manager's performance tab

nothing running:

nothing running

some code using cupy running:

enter image description here

Edo Mor
  • 33
  • 4
  • you have an optimus laptop. You may need to [set an optimus profile](https://nvidia.custhelp.com/app/answers/detail/a_id/2615/~/how-do-i-customize-optimus-profiles-and-settings%3F) to get the NVIDIA GPU to be active during your python session. – Robert Crovella Aug 19 '19 at 14:42

2 Answers2

0

You may need to set your CUDA_VISIBLE_DEVICES variable first:

How do I select which GPU to run a job on?

Hope the answer to that question helps.

Spiderbro
  • 359
  • 2
  • 10
  • i tried set CUDA_VISIBLE_DEVICES that is what i found for windows but no luck also tried ``` import os os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" os.environ["CUDA_VISIBLE_DEVICES"]="1" ``` but it returns ``` cupy.cuda.runtime.CUDARuntimeError: cudaErrorNoDevice: no CUDA-capable device is detected – Edo Mor Aug 18 '19 at 20:00
0

CuPy won't run on Intel Integrated Graphics as it does not support CUDA. Try using nvidia-smi.exe command instead of the task manager to see if your GPU is actually used.

kmaehashi
  • 879
  • 6
  • 10