November 2018
Intermediate to advanced
310 pages
7h 54m
English
Now, finally, we will begin our foray into the world of GPU programming by writing our own version of deviceQuery in Python. Here, we will primarily concern ourselves with only the amount of available memory on the device, the compute capability, the number of multiprocessors, and the total number of CUDA cores.
We will begin by initializing CUDA as follows:
import pycuda.driver as drvdrv.init()
We can now immediately check how many GPU devices we have on our host computer with this line:
print 'Detected {} CUDA Capable device(s)'.format(drv.Device.count())
Read now
Unlock full access