nvcc not going to complain based on the specific GPUs you installed. It will be compiled for any type of GPU that you tell it to compile. The problem is that you specify sm_30 , which is not a valid option for --gpu-architecture , when the --gpu-code option is also specified.
You must pass compute_30 for --gpu-architecture and sm_30 for --gpu-code
Also make sure that you have the correct nvcc to use and it is no coincidence that you are using any old version of the CUDA toolkit.
After fixing the compilation problem, there is a CUDA_DEVICE environment variable that pycuda will observe to select the specific GPU installed.
From here :
CUDA_DEVICE=2 python my-script.py
By the way, someone else had your problem. Are you sure that you do not have an old version of the CUDA toolkit lying around what PyCUDA uses?
source share