LogicError: cuCtxCreate failed: invalid device ordinal

I was using cuda/10.1.168.