andersbll/neural_artistic_style

Selecting the GPU

Closed this issue · 2 comments

Hey, is it possible to select the GPU where the computations are done?

Thanks

filmo commented

cudarray calls during initialization.

_gpu_id = int(os.getenv('CUDARRAY_DEVICE', '0'))

so if you use os.putenv prior to importing the deeppy library on the main script, you can alter the device.

This needs to be done before you call deeppy !!

Thank you!
I now just call CUDARRAY_DEVICE=2 python neural_artistic_style.py ...