sudo apt install python-pycuda
$ wget http://pypi.python.org/pypi/pycuda
$ tar xfz pycuda-VERSION.tar.gz
$ cd pycuda-VERSION # if you're not there already
$ python configure.py --cuda-root=/where/ever/you/installed/cuda
$ su -c "make install"
$ cd pycuda-VERSION/test
$ python test_driver.py
Output OK is successful.
$ cd pycuda-VERSION/examples
$ python test_demo.py
import pycuda.autoinit
import pycuda.driver
free_bytes, total_bytes = pycuda.driver.mem_get_info() #Query the total video memory of the current graphics card, available video memory
Recommended Posts