@albanD Thank you so much.
I adopted above code os.popen('"<path\to\NVSMI>\nvidia-smi" --query-gpu=memory.total,memory.used --format=csv,nounits,noheader').read().split(",")  to query single specific GPU card when several cards available.
    deviceid = 1
    os.environ['CUDA_VISIBLE_DEVICES'] = "%d"%deviceid

    # ================================================
    total, used = os.popen(
        '"nvidia-smi" --query-gpu=memory.total,memory.used --format=csv,nounits,noheader'
            ).read().split('\n')[deviceid].split(',')
    total = int(total)
    used = int(used)

    print(deviceid, 'Total GPU mem:', total, 'used:', used)