File size: 380,891 Bytes
76672a3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
#
# This code was automatically generated across versions from 12.9.1 to 13.0.1. Do not modify it directly.

from libc.stdint cimport intptr_t, uintptr_t

import threading

from .utils import FunctionNotFoundError, NotSupportedError

from cuda.pathfinder import load_nvidia_dynamic_lib


###############################################################################
# Extern
###############################################################################

# You must 'from .utils import NotSupportedError' before using this template

cdef extern from "<dlfcn.h>" nogil:
    void* dlopen(const char*, int)
    char* dlerror()
    void* dlsym(void*, const char*)
    int dlclose(void*)

    enum:
        RTLD_LAZY
        RTLD_NOW
        RTLD_GLOBAL
        RTLD_LOCAL

    const void* RTLD_DEFAULT 'RTLD_DEFAULT'

cdef int get_cuda_version():
    cdef void* handle = NULL
    cdef int err, driver_ver = 0

    # Load driver to check version
    handle = dlopen('libcuda.so.1', RTLD_NOW | RTLD_GLOBAL)
    if handle == NULL:
        err_msg = dlerror()
        raise NotSupportedError(f'CUDA driver is not found ({err_msg.decode()})')
    cuDriverGetVersion = dlsym(handle, "cuDriverGetVersion")
    if cuDriverGetVersion == NULL:
        raise RuntimeError('Did not find cuDriverGetVersion symbol in libcuda.so.1')
    err = (<int (*)(int*) noexcept nogil>cuDriverGetVersion)(&driver_ver)
    if err != 0:
        raise RuntimeError(f'cuDriverGetVersion returned error code {err}')

    return driver_ver



###############################################################################
# Wrapper init
###############################################################################

cdef object __symbol_lock = threading.Lock()
cdef bint __py_nvml_init = False

cdef void* __nvmlInit_v2 = NULL
cdef void* __nvmlInitWithFlags = NULL
cdef void* __nvmlShutdown = NULL
cdef void* __nvmlErrorString = NULL
cdef void* __nvmlSystemGetDriverVersion = NULL
cdef void* __nvmlSystemGetNVMLVersion = NULL
cdef void* __nvmlSystemGetCudaDriverVersion = NULL
cdef void* __nvmlSystemGetCudaDriverVersion_v2 = NULL
cdef void* __nvmlSystemGetProcessName = NULL
cdef void* __nvmlSystemGetHicVersion = NULL
cdef void* __nvmlSystemGetTopologyGpuSet = NULL
cdef void* __nvmlSystemGetDriverBranch = NULL
cdef void* __nvmlUnitGetCount = NULL
cdef void* __nvmlUnitGetHandleByIndex = NULL
cdef void* __nvmlUnitGetUnitInfo = NULL
cdef void* __nvmlUnitGetLedState = NULL
cdef void* __nvmlUnitGetPsuInfo = NULL
cdef void* __nvmlUnitGetTemperature = NULL
cdef void* __nvmlUnitGetFanSpeedInfo = NULL
cdef void* __nvmlUnitGetDevices = NULL
cdef void* __nvmlDeviceGetCount_v2 = NULL
cdef void* __nvmlDeviceGetAttributes_v2 = NULL
cdef void* __nvmlDeviceGetHandleByIndex_v2 = NULL
cdef void* __nvmlDeviceGetHandleBySerial = NULL
cdef void* __nvmlDeviceGetHandleByUUID = NULL
cdef void* __nvmlDeviceGetHandleByUUIDV = NULL
cdef void* __nvmlDeviceGetHandleByPciBusId_v2 = NULL
cdef void* __nvmlDeviceGetName = NULL
cdef void* __nvmlDeviceGetBrand = NULL
cdef void* __nvmlDeviceGetIndex = NULL
cdef void* __nvmlDeviceGetSerial = NULL
cdef void* __nvmlDeviceGetModuleId = NULL
cdef void* __nvmlDeviceGetC2cModeInfoV = NULL
cdef void* __nvmlDeviceGetMemoryAffinity = NULL
cdef void* __nvmlDeviceGetCpuAffinityWithinScope = NULL
cdef void* __nvmlDeviceGetCpuAffinity = NULL
cdef void* __nvmlDeviceSetCpuAffinity = NULL
cdef void* __nvmlDeviceClearCpuAffinity = NULL
cdef void* __nvmlDeviceGetNumaNodeId = NULL
cdef void* __nvmlDeviceGetTopologyCommonAncestor = NULL
cdef void* __nvmlDeviceGetTopologyNearestGpus = NULL
cdef void* __nvmlDeviceGetP2PStatus = NULL
cdef void* __nvmlDeviceGetUUID = NULL
cdef void* __nvmlDeviceGetMinorNumber = NULL
cdef void* __nvmlDeviceGetBoardPartNumber = NULL
cdef void* __nvmlDeviceGetInforomVersion = NULL
cdef void* __nvmlDeviceGetInforomImageVersion = NULL
cdef void* __nvmlDeviceGetInforomConfigurationChecksum = NULL
cdef void* __nvmlDeviceValidateInforom = NULL
cdef void* __nvmlDeviceGetLastBBXFlushTime = NULL
cdef void* __nvmlDeviceGetDisplayMode = NULL
cdef void* __nvmlDeviceGetDisplayActive = NULL
cdef void* __nvmlDeviceGetPersistenceMode = NULL
cdef void* __nvmlDeviceGetPciInfoExt = NULL
cdef void* __nvmlDeviceGetPciInfo_v3 = NULL
cdef void* __nvmlDeviceGetMaxPcieLinkGeneration = NULL
cdef void* __nvmlDeviceGetGpuMaxPcieLinkGeneration = NULL
cdef void* __nvmlDeviceGetMaxPcieLinkWidth = NULL
cdef void* __nvmlDeviceGetCurrPcieLinkGeneration = NULL
cdef void* __nvmlDeviceGetCurrPcieLinkWidth = NULL
cdef void* __nvmlDeviceGetPcieThroughput = NULL
cdef void* __nvmlDeviceGetPcieReplayCounter = NULL
cdef void* __nvmlDeviceGetClockInfo = NULL
cdef void* __nvmlDeviceGetMaxClockInfo = NULL
cdef void* __nvmlDeviceGetGpcClkVfOffset = NULL
cdef void* __nvmlDeviceGetClock = NULL
cdef void* __nvmlDeviceGetMaxCustomerBoostClock = NULL
cdef void* __nvmlDeviceGetSupportedMemoryClocks = NULL
cdef void* __nvmlDeviceGetSupportedGraphicsClocks = NULL
cdef void* __nvmlDeviceGetAutoBoostedClocksEnabled = NULL
cdef void* __nvmlDeviceGetFanSpeed = NULL
cdef void* __nvmlDeviceGetFanSpeed_v2 = NULL
cdef void* __nvmlDeviceGetFanSpeedRPM = NULL
cdef void* __nvmlDeviceGetTargetFanSpeed = NULL
cdef void* __nvmlDeviceGetMinMaxFanSpeed = NULL
cdef void* __nvmlDeviceGetFanControlPolicy_v2 = NULL
cdef void* __nvmlDeviceGetNumFans = NULL
cdef void* __nvmlDeviceGetCoolerInfo = NULL
cdef void* __nvmlDeviceGetTemperatureV = NULL
cdef void* __nvmlDeviceGetTemperatureThreshold = NULL
cdef void* __nvmlDeviceGetMarginTemperature = NULL
cdef void* __nvmlDeviceGetThermalSettings = NULL
cdef void* __nvmlDeviceGetPerformanceState = NULL
cdef void* __nvmlDeviceGetCurrentClocksEventReasons = NULL
cdef void* __nvmlDeviceGetSupportedClocksEventReasons = NULL
cdef void* __nvmlDeviceGetPowerState = NULL
cdef void* __nvmlDeviceGetDynamicPstatesInfo = NULL
cdef void* __nvmlDeviceGetMemClkVfOffset = NULL
cdef void* __nvmlDeviceGetMinMaxClockOfPState = NULL
cdef void* __nvmlDeviceGetSupportedPerformanceStates = NULL
cdef void* __nvmlDeviceGetGpcClkMinMaxVfOffset = NULL
cdef void* __nvmlDeviceGetMemClkMinMaxVfOffset = NULL
cdef void* __nvmlDeviceGetClockOffsets = NULL
cdef void* __nvmlDeviceSetClockOffsets = NULL
cdef void* __nvmlDeviceGetPerformanceModes = NULL
cdef void* __nvmlDeviceGetCurrentClockFreqs = NULL
cdef void* __nvmlDeviceGetPowerManagementLimit = NULL
cdef void* __nvmlDeviceGetPowerManagementLimitConstraints = NULL
cdef void* __nvmlDeviceGetPowerManagementDefaultLimit = NULL
cdef void* __nvmlDeviceGetPowerUsage = NULL
cdef void* __nvmlDeviceGetTotalEnergyConsumption = NULL
cdef void* __nvmlDeviceGetEnforcedPowerLimit = NULL
cdef void* __nvmlDeviceGetGpuOperationMode = NULL
cdef void* __nvmlDeviceGetMemoryInfo_v2 = NULL
cdef void* __nvmlDeviceGetComputeMode = NULL
cdef void* __nvmlDeviceGetCudaComputeCapability = NULL
cdef void* __nvmlDeviceGetDramEncryptionMode = NULL
cdef void* __nvmlDeviceSetDramEncryptionMode = NULL
cdef void* __nvmlDeviceGetEccMode = NULL
cdef void* __nvmlDeviceGetDefaultEccMode = NULL
cdef void* __nvmlDeviceGetBoardId = NULL
cdef void* __nvmlDeviceGetMultiGpuBoard = NULL
cdef void* __nvmlDeviceGetTotalEccErrors = NULL
cdef void* __nvmlDeviceGetMemoryErrorCounter = NULL
cdef void* __nvmlDeviceGetUtilizationRates = NULL
cdef void* __nvmlDeviceGetEncoderUtilization = NULL
cdef void* __nvmlDeviceGetEncoderCapacity = NULL
cdef void* __nvmlDeviceGetEncoderStats = NULL
cdef void* __nvmlDeviceGetEncoderSessions = NULL
cdef void* __nvmlDeviceGetDecoderUtilization = NULL
cdef void* __nvmlDeviceGetJpgUtilization = NULL
cdef void* __nvmlDeviceGetOfaUtilization = NULL
cdef void* __nvmlDeviceGetFBCStats = NULL
cdef void* __nvmlDeviceGetFBCSessions = NULL
cdef void* __nvmlDeviceGetDriverModel_v2 = NULL
cdef void* __nvmlDeviceGetVbiosVersion = NULL
cdef void* __nvmlDeviceGetBridgeChipInfo = NULL
cdef void* __nvmlDeviceGetComputeRunningProcesses_v3 = NULL
cdef void* __nvmlDeviceGetMPSComputeRunningProcesses_v3 = NULL
cdef void* __nvmlDeviceGetRunningProcessDetailList = NULL
cdef void* __nvmlDeviceOnSameBoard = NULL
cdef void* __nvmlDeviceGetAPIRestriction = NULL
cdef void* __nvmlDeviceGetSamples = NULL
cdef void* __nvmlDeviceGetBAR1MemoryInfo = NULL
cdef void* __nvmlDeviceGetIrqNum = NULL
cdef void* __nvmlDeviceGetNumGpuCores = NULL
cdef void* __nvmlDeviceGetPowerSource = NULL
cdef void* __nvmlDeviceGetMemoryBusWidth = NULL
cdef void* __nvmlDeviceGetPcieLinkMaxSpeed = NULL
cdef void* __nvmlDeviceGetPcieSpeed = NULL
cdef void* __nvmlDeviceGetAdaptiveClockInfoStatus = NULL
cdef void* __nvmlDeviceGetBusType = NULL
cdef void* __nvmlDeviceGetGpuFabricInfoV = NULL
cdef void* __nvmlSystemGetConfComputeCapabilities = NULL
cdef void* __nvmlSystemGetConfComputeState = NULL
cdef void* __nvmlDeviceGetConfComputeMemSizeInfo = NULL
cdef void* __nvmlSystemGetConfComputeGpusReadyState = NULL
cdef void* __nvmlDeviceGetConfComputeProtectedMemoryUsage = NULL
cdef void* __nvmlDeviceGetConfComputeGpuCertificate = NULL
cdef void* __nvmlDeviceGetConfComputeGpuAttestationReport = NULL
cdef void* __nvmlSystemGetConfComputeKeyRotationThresholdInfo = NULL
cdef void* __nvmlDeviceSetConfComputeUnprotectedMemSize = NULL
cdef void* __nvmlSystemSetConfComputeGpusReadyState = NULL
cdef void* __nvmlSystemSetConfComputeKeyRotationThresholdInfo = NULL
cdef void* __nvmlSystemGetConfComputeSettings = NULL
cdef void* __nvmlDeviceGetGspFirmwareVersion = NULL
cdef void* __nvmlDeviceGetGspFirmwareMode = NULL
cdef void* __nvmlDeviceGetSramEccErrorStatus = NULL
cdef void* __nvmlDeviceGetAccountingMode = NULL
cdef void* __nvmlDeviceGetAccountingStats = NULL
cdef void* __nvmlDeviceGetAccountingPids = NULL
cdef void* __nvmlDeviceGetAccountingBufferSize = NULL
cdef void* __nvmlDeviceGetRetiredPages = NULL
cdef void* __nvmlDeviceGetRetiredPages_v2 = NULL
cdef void* __nvmlDeviceGetRetiredPagesPendingStatus = NULL
cdef void* __nvmlDeviceGetRemappedRows = NULL
cdef void* __nvmlDeviceGetRowRemapperHistogram = NULL
cdef void* __nvmlDeviceGetArchitecture = NULL
cdef void* __nvmlDeviceGetClkMonStatus = NULL
cdef void* __nvmlDeviceGetProcessUtilization = NULL
cdef void* __nvmlDeviceGetProcessesUtilizationInfo = NULL
cdef void* __nvmlDeviceGetPlatformInfo = NULL
cdef void* __nvmlUnitSetLedState = NULL
cdef void* __nvmlDeviceSetPersistenceMode = NULL
cdef void* __nvmlDeviceSetComputeMode = NULL
cdef void* __nvmlDeviceSetEccMode = NULL
cdef void* __nvmlDeviceClearEccErrorCounts = NULL
cdef void* __nvmlDeviceSetDriverModel = NULL
cdef void* __nvmlDeviceSetGpuLockedClocks = NULL
cdef void* __nvmlDeviceResetGpuLockedClocks = NULL
cdef void* __nvmlDeviceSetMemoryLockedClocks = NULL
cdef void* __nvmlDeviceResetMemoryLockedClocks = NULL
cdef void* __nvmlDeviceSetAutoBoostedClocksEnabled = NULL
cdef void* __nvmlDeviceSetDefaultAutoBoostedClocksEnabled = NULL
cdef void* __nvmlDeviceSetDefaultFanSpeed_v2 = NULL
cdef void* __nvmlDeviceSetFanControlPolicy = NULL
cdef void* __nvmlDeviceSetTemperatureThreshold = NULL
cdef void* __nvmlDeviceSetPowerManagementLimit = NULL
cdef void* __nvmlDeviceSetGpuOperationMode = NULL
cdef void* __nvmlDeviceSetAPIRestriction = NULL
cdef void* __nvmlDeviceSetFanSpeed_v2 = NULL
cdef void* __nvmlDeviceSetAccountingMode = NULL
cdef void* __nvmlDeviceClearAccountingPids = NULL
cdef void* __nvmlDeviceSetPowerManagementLimit_v2 = NULL
cdef void* __nvmlDeviceGetNvLinkState = NULL
cdef void* __nvmlDeviceGetNvLinkVersion = NULL
cdef void* __nvmlDeviceGetNvLinkCapability = NULL
cdef void* __nvmlDeviceGetNvLinkRemotePciInfo_v2 = NULL
cdef void* __nvmlDeviceGetNvLinkErrorCounter = NULL
cdef void* __nvmlDeviceResetNvLinkErrorCounters = NULL
cdef void* __nvmlDeviceGetNvLinkRemoteDeviceType = NULL
cdef void* __nvmlDeviceSetNvLinkDeviceLowPowerThreshold = NULL
cdef void* __nvmlSystemSetNvlinkBwMode = NULL
cdef void* __nvmlSystemGetNvlinkBwMode = NULL
cdef void* __nvmlDeviceGetNvlinkSupportedBwModes = NULL
cdef void* __nvmlDeviceGetNvlinkBwMode = NULL
cdef void* __nvmlDeviceSetNvlinkBwMode = NULL
cdef void* __nvmlEventSetCreate = NULL
cdef void* __nvmlDeviceRegisterEvents = NULL
cdef void* __nvmlDeviceGetSupportedEventTypes = NULL
cdef void* __nvmlEventSetWait_v2 = NULL
cdef void* __nvmlEventSetFree = NULL
cdef void* __nvmlSystemEventSetCreate = NULL
cdef void* __nvmlSystemEventSetFree = NULL
cdef void* __nvmlSystemRegisterEvents = NULL
cdef void* __nvmlSystemEventSetWait = NULL
cdef void* __nvmlDeviceModifyDrainState = NULL
cdef void* __nvmlDeviceQueryDrainState = NULL
cdef void* __nvmlDeviceRemoveGpu_v2 = NULL
cdef void* __nvmlDeviceDiscoverGpus = NULL
cdef void* __nvmlDeviceGetFieldValues = NULL
cdef void* __nvmlDeviceClearFieldValues = NULL
cdef void* __nvmlDeviceGetVirtualizationMode = NULL
cdef void* __nvmlDeviceGetHostVgpuMode = NULL
cdef void* __nvmlDeviceSetVirtualizationMode = NULL
cdef void* __nvmlDeviceGetVgpuHeterogeneousMode = NULL
cdef void* __nvmlDeviceSetVgpuHeterogeneousMode = NULL
cdef void* __nvmlVgpuInstanceGetPlacementId = NULL
cdef void* __nvmlDeviceGetVgpuTypeSupportedPlacements = NULL
cdef void* __nvmlDeviceGetVgpuTypeCreatablePlacements = NULL
cdef void* __nvmlVgpuTypeGetGspHeapSize = NULL
cdef void* __nvmlVgpuTypeGetFbReservation = NULL
cdef void* __nvmlVgpuInstanceGetRuntimeStateSize = NULL
cdef void* __nvmlDeviceSetVgpuCapabilities = NULL
cdef void* __nvmlDeviceGetGridLicensableFeatures_v4 = NULL
cdef void* __nvmlGetVgpuDriverCapabilities = NULL
cdef void* __nvmlDeviceGetVgpuCapabilities = NULL
cdef void* __nvmlDeviceGetSupportedVgpus = NULL
cdef void* __nvmlDeviceGetCreatableVgpus = NULL
cdef void* __nvmlVgpuTypeGetClass = NULL
cdef void* __nvmlVgpuTypeGetName = NULL
cdef void* __nvmlVgpuTypeGetGpuInstanceProfileId = NULL
cdef void* __nvmlVgpuTypeGetDeviceID = NULL
cdef void* __nvmlVgpuTypeGetFramebufferSize = NULL
cdef void* __nvmlVgpuTypeGetNumDisplayHeads = NULL
cdef void* __nvmlVgpuTypeGetResolution = NULL
cdef void* __nvmlVgpuTypeGetLicense = NULL
cdef void* __nvmlVgpuTypeGetFrameRateLimit = NULL
cdef void* __nvmlVgpuTypeGetMaxInstances = NULL
cdef void* __nvmlVgpuTypeGetMaxInstancesPerVm = NULL
cdef void* __nvmlVgpuTypeGetBAR1Info = NULL
cdef void* __nvmlDeviceGetActiveVgpus = NULL
cdef void* __nvmlVgpuInstanceGetVmID = NULL
cdef void* __nvmlVgpuInstanceGetUUID = NULL
cdef void* __nvmlVgpuInstanceGetVmDriverVersion = NULL
cdef void* __nvmlVgpuInstanceGetFbUsage = NULL
cdef void* __nvmlVgpuInstanceGetLicenseStatus = NULL
cdef void* __nvmlVgpuInstanceGetType = NULL
cdef void* __nvmlVgpuInstanceGetFrameRateLimit = NULL
cdef void* __nvmlVgpuInstanceGetEccMode = NULL
cdef void* __nvmlVgpuInstanceGetEncoderCapacity = NULL
cdef void* __nvmlVgpuInstanceSetEncoderCapacity = NULL
cdef void* __nvmlVgpuInstanceGetEncoderStats = NULL
cdef void* __nvmlVgpuInstanceGetEncoderSessions = NULL
cdef void* __nvmlVgpuInstanceGetFBCStats = NULL
cdef void* __nvmlVgpuInstanceGetFBCSessions = NULL
cdef void* __nvmlVgpuInstanceGetGpuInstanceId = NULL
cdef void* __nvmlVgpuInstanceGetGpuPciId = NULL
cdef void* __nvmlVgpuTypeGetCapabilities = NULL
cdef void* __nvmlVgpuInstanceGetMdevUUID = NULL
cdef void* __nvmlGpuInstanceGetCreatableVgpus = NULL
cdef void* __nvmlVgpuTypeGetMaxInstancesPerGpuInstance = NULL
cdef void* __nvmlGpuInstanceGetActiveVgpus = NULL
cdef void* __nvmlGpuInstanceSetVgpuSchedulerState = NULL
cdef void* __nvmlGpuInstanceGetVgpuSchedulerState = NULL
cdef void* __nvmlGpuInstanceGetVgpuSchedulerLog = NULL
cdef void* __nvmlGpuInstanceGetVgpuTypeCreatablePlacements = NULL
cdef void* __nvmlGpuInstanceGetVgpuHeterogeneousMode = NULL
cdef void* __nvmlGpuInstanceSetVgpuHeterogeneousMode = NULL
cdef void* __nvmlVgpuInstanceGetMetadata = NULL
cdef void* __nvmlDeviceGetVgpuMetadata = NULL
cdef void* __nvmlGetVgpuCompatibility = NULL
cdef void* __nvmlDeviceGetPgpuMetadataString = NULL
cdef void* __nvmlDeviceGetVgpuSchedulerLog = NULL
cdef void* __nvmlDeviceGetVgpuSchedulerState = NULL
cdef void* __nvmlDeviceGetVgpuSchedulerCapabilities = NULL
cdef void* __nvmlDeviceSetVgpuSchedulerState = NULL
cdef void* __nvmlGetVgpuVersion = NULL
cdef void* __nvmlSetVgpuVersion = NULL
cdef void* __nvmlDeviceGetVgpuUtilization = NULL
cdef void* __nvmlDeviceGetVgpuInstancesUtilizationInfo = NULL
cdef void* __nvmlDeviceGetVgpuProcessUtilization = NULL
cdef void* __nvmlDeviceGetVgpuProcessesUtilizationInfo = NULL
cdef void* __nvmlVgpuInstanceGetAccountingMode = NULL
cdef void* __nvmlVgpuInstanceGetAccountingPids = NULL
cdef void* __nvmlVgpuInstanceGetAccountingStats = NULL
cdef void* __nvmlVgpuInstanceClearAccountingPids = NULL
cdef void* __nvmlVgpuInstanceGetLicenseInfo_v2 = NULL
cdef void* __nvmlGetExcludedDeviceCount = NULL
cdef void* __nvmlGetExcludedDeviceInfoByIndex = NULL
cdef void* __nvmlDeviceSetMigMode = NULL
cdef void* __nvmlDeviceGetMigMode = NULL
cdef void* __nvmlDeviceGetGpuInstanceProfileInfoV = NULL
cdef void* __nvmlDeviceGetGpuInstancePossiblePlacements_v2 = NULL
cdef void* __nvmlDeviceGetGpuInstanceRemainingCapacity = NULL
cdef void* __nvmlDeviceCreateGpuInstance = NULL
cdef void* __nvmlDeviceCreateGpuInstanceWithPlacement = NULL
cdef void* __nvmlGpuInstanceDestroy = NULL
cdef void* __nvmlDeviceGetGpuInstances = NULL
cdef void* __nvmlDeviceGetGpuInstanceById = NULL
cdef void* __nvmlGpuInstanceGetInfo = NULL
cdef void* __nvmlGpuInstanceGetComputeInstanceProfileInfoV = NULL
cdef void* __nvmlGpuInstanceGetComputeInstanceRemainingCapacity = NULL
cdef void* __nvmlGpuInstanceGetComputeInstancePossiblePlacements = NULL
cdef void* __nvmlGpuInstanceCreateComputeInstance = NULL
cdef void* __nvmlGpuInstanceCreateComputeInstanceWithPlacement = NULL
cdef void* __nvmlComputeInstanceDestroy = NULL
cdef void* __nvmlGpuInstanceGetComputeInstances = NULL
cdef void* __nvmlGpuInstanceGetComputeInstanceById = NULL
cdef void* __nvmlComputeInstanceGetInfo_v2 = NULL
cdef void* __nvmlDeviceIsMigDeviceHandle = NULL
cdef void* __nvmlDeviceGetGpuInstanceId = NULL
cdef void* __nvmlDeviceGetComputeInstanceId = NULL
cdef void* __nvmlDeviceGetMaxMigDeviceCount = NULL
cdef void* __nvmlDeviceGetMigDeviceHandleByIndex = NULL
cdef void* __nvmlDeviceGetDeviceHandleFromMigDeviceHandle = NULL
cdef void* __nvmlGpmSampleGet = NULL
cdef void* __nvmlGpmMigSampleGet = NULL
cdef void* __nvmlGpmQueryDeviceSupport = NULL
cdef void* __nvmlGpmQueryIfStreamingEnabled = NULL
cdef void* __nvmlGpmSetStreamingEnabled = NULL
cdef void* __nvmlDeviceGetCapabilities = NULL
cdef void* __nvmlDeviceWorkloadPowerProfileClearRequestedProfiles = NULL
cdef void* __nvmlDevicePowerSmoothingActivatePresetProfile = NULL
cdef void* __nvmlDevicePowerSmoothingUpdatePresetProfileParam = NULL
cdef void* __nvmlDevicePowerSmoothingSetState = NULL
cdef void* __nvmlDeviceGetAddressingMode = NULL
cdef void* __nvmlDeviceGetRepairStatus = NULL
cdef void* __nvmlDeviceGetPowerMizerMode_v1 = NULL
cdef void* __nvmlDeviceSetPowerMizerMode_v1 = NULL
cdef void* __nvmlDeviceGetPdi = NULL
cdef void* __nvmlDeviceSetHostname_v1 = NULL
cdef void* __nvmlDeviceGetHostname_v1 = NULL
cdef void* __nvmlDeviceGetNvLinkInfo = NULL
cdef void* __nvmlDeviceReadWritePRM_v1 = NULL
cdef void* __nvmlDeviceGetGpuInstanceProfileInfoByIdV = NULL
cdef void* __nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts = NULL


cdef void* load_library() except* with gil:
    return dlopen("libnvidia-ml.so.1", RTLD_NOW | RTLD_GLOBAL)


cdef int _init_nvml() except -1 nogil:
    global __py_nvml_init
    cdef void* handle = NULL

    with gil, __symbol_lock:
        # Recheck the flag after obtaining the locks
        if __py_nvml_init:
            return 0

        # Load function
        global __nvmlInit_v2
        __nvmlInit_v2 = dlsym(RTLD_DEFAULT, 'nvmlInit_v2')
        if __nvmlInit_v2 == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlInit_v2 = dlsym(handle, 'nvmlInit_v2')

        global __nvmlInitWithFlags
        __nvmlInitWithFlags = dlsym(RTLD_DEFAULT, 'nvmlInitWithFlags')
        if __nvmlInitWithFlags == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlInitWithFlags = dlsym(handle, 'nvmlInitWithFlags')

        global __nvmlShutdown
        __nvmlShutdown = dlsym(RTLD_DEFAULT, 'nvmlShutdown')
        if __nvmlShutdown == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlShutdown = dlsym(handle, 'nvmlShutdown')

        global __nvmlErrorString
        __nvmlErrorString = dlsym(RTLD_DEFAULT, 'nvmlErrorString')
        if __nvmlErrorString == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlErrorString = dlsym(handle, 'nvmlErrorString')

        global __nvmlSystemGetDriverVersion
        __nvmlSystemGetDriverVersion = dlsym(RTLD_DEFAULT, 'nvmlSystemGetDriverVersion')
        if __nvmlSystemGetDriverVersion == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlSystemGetDriverVersion = dlsym(handle, 'nvmlSystemGetDriverVersion')

        global __nvmlSystemGetNVMLVersion
        __nvmlSystemGetNVMLVersion = dlsym(RTLD_DEFAULT, 'nvmlSystemGetNVMLVersion')
        if __nvmlSystemGetNVMLVersion == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlSystemGetNVMLVersion = dlsym(handle, 'nvmlSystemGetNVMLVersion')

        global __nvmlSystemGetCudaDriverVersion
        __nvmlSystemGetCudaDriverVersion = dlsym(RTLD_DEFAULT, 'nvmlSystemGetCudaDriverVersion')
        if __nvmlSystemGetCudaDriverVersion == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlSystemGetCudaDriverVersion = dlsym(handle, 'nvmlSystemGetCudaDriverVersion')

        global __nvmlSystemGetCudaDriverVersion_v2
        __nvmlSystemGetCudaDriverVersion_v2 = dlsym(RTLD_DEFAULT, 'nvmlSystemGetCudaDriverVersion_v2')
        if __nvmlSystemGetCudaDriverVersion_v2 == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlSystemGetCudaDriverVersion_v2 = dlsym(handle, 'nvmlSystemGetCudaDriverVersion_v2')

        global __nvmlSystemGetProcessName
        __nvmlSystemGetProcessName = dlsym(RTLD_DEFAULT, 'nvmlSystemGetProcessName')
        if __nvmlSystemGetProcessName == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlSystemGetProcessName = dlsym(handle, 'nvmlSystemGetProcessName')

        global __nvmlSystemGetHicVersion
        __nvmlSystemGetHicVersion = dlsym(RTLD_DEFAULT, 'nvmlSystemGetHicVersion')
        if __nvmlSystemGetHicVersion == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlSystemGetHicVersion = dlsym(handle, 'nvmlSystemGetHicVersion')

        global __nvmlSystemGetTopologyGpuSet
        __nvmlSystemGetTopologyGpuSet = dlsym(RTLD_DEFAULT, 'nvmlSystemGetTopologyGpuSet')
        if __nvmlSystemGetTopologyGpuSet == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlSystemGetTopologyGpuSet = dlsym(handle, 'nvmlSystemGetTopologyGpuSet')

        global __nvmlSystemGetDriverBranch
        __nvmlSystemGetDriverBranch = dlsym(RTLD_DEFAULT, 'nvmlSystemGetDriverBranch')
        if __nvmlSystemGetDriverBranch == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlSystemGetDriverBranch = dlsym(handle, 'nvmlSystemGetDriverBranch')

        global __nvmlUnitGetCount
        __nvmlUnitGetCount = dlsym(RTLD_DEFAULT, 'nvmlUnitGetCount')
        if __nvmlUnitGetCount == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlUnitGetCount = dlsym(handle, 'nvmlUnitGetCount')

        global __nvmlUnitGetHandleByIndex
        __nvmlUnitGetHandleByIndex = dlsym(RTLD_DEFAULT, 'nvmlUnitGetHandleByIndex')
        if __nvmlUnitGetHandleByIndex == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlUnitGetHandleByIndex = dlsym(handle, 'nvmlUnitGetHandleByIndex')

        global __nvmlUnitGetUnitInfo
        __nvmlUnitGetUnitInfo = dlsym(RTLD_DEFAULT, 'nvmlUnitGetUnitInfo')
        if __nvmlUnitGetUnitInfo == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlUnitGetUnitInfo = dlsym(handle, 'nvmlUnitGetUnitInfo')

        global __nvmlUnitGetLedState
        __nvmlUnitGetLedState = dlsym(RTLD_DEFAULT, 'nvmlUnitGetLedState')
        if __nvmlUnitGetLedState == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlUnitGetLedState = dlsym(handle, 'nvmlUnitGetLedState')

        global __nvmlUnitGetPsuInfo
        __nvmlUnitGetPsuInfo = dlsym(RTLD_DEFAULT, 'nvmlUnitGetPsuInfo')
        if __nvmlUnitGetPsuInfo == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlUnitGetPsuInfo = dlsym(handle, 'nvmlUnitGetPsuInfo')

        global __nvmlUnitGetTemperature
        __nvmlUnitGetTemperature = dlsym(RTLD_DEFAULT, 'nvmlUnitGetTemperature')
        if __nvmlUnitGetTemperature == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlUnitGetTemperature = dlsym(handle, 'nvmlUnitGetTemperature')

        global __nvmlUnitGetFanSpeedInfo
        __nvmlUnitGetFanSpeedInfo = dlsym(RTLD_DEFAULT, 'nvmlUnitGetFanSpeedInfo')
        if __nvmlUnitGetFanSpeedInfo == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlUnitGetFanSpeedInfo = dlsym(handle, 'nvmlUnitGetFanSpeedInfo')

        global __nvmlUnitGetDevices
        __nvmlUnitGetDevices = dlsym(RTLD_DEFAULT, 'nvmlUnitGetDevices')
        if __nvmlUnitGetDevices == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlUnitGetDevices = dlsym(handle, 'nvmlUnitGetDevices')

        global __nvmlDeviceGetCount_v2
        __nvmlDeviceGetCount_v2 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetCount_v2')
        if __nvmlDeviceGetCount_v2 == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetCount_v2 = dlsym(handle, 'nvmlDeviceGetCount_v2')

        global __nvmlDeviceGetAttributes_v2
        __nvmlDeviceGetAttributes_v2 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetAttributes_v2')
        if __nvmlDeviceGetAttributes_v2 == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetAttributes_v2 = dlsym(handle, 'nvmlDeviceGetAttributes_v2')

        global __nvmlDeviceGetHandleByIndex_v2
        __nvmlDeviceGetHandleByIndex_v2 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetHandleByIndex_v2')
        if __nvmlDeviceGetHandleByIndex_v2 == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetHandleByIndex_v2 = dlsym(handle, 'nvmlDeviceGetHandleByIndex_v2')

        global __nvmlDeviceGetHandleBySerial
        __nvmlDeviceGetHandleBySerial = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetHandleBySerial')
        if __nvmlDeviceGetHandleBySerial == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetHandleBySerial = dlsym(handle, 'nvmlDeviceGetHandleBySerial')

        global __nvmlDeviceGetHandleByUUID
        __nvmlDeviceGetHandleByUUID = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetHandleByUUID')
        if __nvmlDeviceGetHandleByUUID == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetHandleByUUID = dlsym(handle, 'nvmlDeviceGetHandleByUUID')

        global __nvmlDeviceGetHandleByUUIDV
        __nvmlDeviceGetHandleByUUIDV = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetHandleByUUIDV')
        if __nvmlDeviceGetHandleByUUIDV == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetHandleByUUIDV = dlsym(handle, 'nvmlDeviceGetHandleByUUIDV')

        global __nvmlDeviceGetHandleByPciBusId_v2
        __nvmlDeviceGetHandleByPciBusId_v2 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetHandleByPciBusId_v2')
        if __nvmlDeviceGetHandleByPciBusId_v2 == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetHandleByPciBusId_v2 = dlsym(handle, 'nvmlDeviceGetHandleByPciBusId_v2')

        global __nvmlDeviceGetName
        __nvmlDeviceGetName = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetName')
        if __nvmlDeviceGetName == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetName = dlsym(handle, 'nvmlDeviceGetName')

        global __nvmlDeviceGetBrand
        __nvmlDeviceGetBrand = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetBrand')
        if __nvmlDeviceGetBrand == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetBrand = dlsym(handle, 'nvmlDeviceGetBrand')

        global __nvmlDeviceGetIndex
        __nvmlDeviceGetIndex = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetIndex')
        if __nvmlDeviceGetIndex == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetIndex = dlsym(handle, 'nvmlDeviceGetIndex')

        global __nvmlDeviceGetSerial
        __nvmlDeviceGetSerial = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetSerial')
        if __nvmlDeviceGetSerial == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetSerial = dlsym(handle, 'nvmlDeviceGetSerial')

        global __nvmlDeviceGetModuleId
        __nvmlDeviceGetModuleId = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetModuleId')
        if __nvmlDeviceGetModuleId == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetModuleId = dlsym(handle, 'nvmlDeviceGetModuleId')

        global __nvmlDeviceGetC2cModeInfoV
        __nvmlDeviceGetC2cModeInfoV = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetC2cModeInfoV')
        if __nvmlDeviceGetC2cModeInfoV == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetC2cModeInfoV = dlsym(handle, 'nvmlDeviceGetC2cModeInfoV')

        global __nvmlDeviceGetMemoryAffinity
        __nvmlDeviceGetMemoryAffinity = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetMemoryAffinity')
        if __nvmlDeviceGetMemoryAffinity == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetMemoryAffinity = dlsym(handle, 'nvmlDeviceGetMemoryAffinity')

        global __nvmlDeviceGetCpuAffinityWithinScope
        __nvmlDeviceGetCpuAffinityWithinScope = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetCpuAffinityWithinScope')
        if __nvmlDeviceGetCpuAffinityWithinScope == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetCpuAffinityWithinScope = dlsym(handle, 'nvmlDeviceGetCpuAffinityWithinScope')

        global __nvmlDeviceGetCpuAffinity
        __nvmlDeviceGetCpuAffinity = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetCpuAffinity')
        if __nvmlDeviceGetCpuAffinity == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetCpuAffinity = dlsym(handle, 'nvmlDeviceGetCpuAffinity')

        global __nvmlDeviceSetCpuAffinity
        __nvmlDeviceSetCpuAffinity = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetCpuAffinity')
        if __nvmlDeviceSetCpuAffinity == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetCpuAffinity = dlsym(handle, 'nvmlDeviceSetCpuAffinity')

        global __nvmlDeviceClearCpuAffinity
        __nvmlDeviceClearCpuAffinity = dlsym(RTLD_DEFAULT, 'nvmlDeviceClearCpuAffinity')
        if __nvmlDeviceClearCpuAffinity == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceClearCpuAffinity = dlsym(handle, 'nvmlDeviceClearCpuAffinity')

        global __nvmlDeviceGetNumaNodeId
        __nvmlDeviceGetNumaNodeId = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetNumaNodeId')
        if __nvmlDeviceGetNumaNodeId == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetNumaNodeId = dlsym(handle, 'nvmlDeviceGetNumaNodeId')

        global __nvmlDeviceGetTopologyCommonAncestor
        __nvmlDeviceGetTopologyCommonAncestor = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetTopologyCommonAncestor')
        if __nvmlDeviceGetTopologyCommonAncestor == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetTopologyCommonAncestor = dlsym(handle, 'nvmlDeviceGetTopologyCommonAncestor')

        global __nvmlDeviceGetTopologyNearestGpus
        __nvmlDeviceGetTopologyNearestGpus = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetTopologyNearestGpus')
        if __nvmlDeviceGetTopologyNearestGpus == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetTopologyNearestGpus = dlsym(handle, 'nvmlDeviceGetTopologyNearestGpus')

        global __nvmlDeviceGetP2PStatus
        __nvmlDeviceGetP2PStatus = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetP2PStatus')
        if __nvmlDeviceGetP2PStatus == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetP2PStatus = dlsym(handle, 'nvmlDeviceGetP2PStatus')

        global __nvmlDeviceGetUUID
        __nvmlDeviceGetUUID = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetUUID')
        if __nvmlDeviceGetUUID == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetUUID = dlsym(handle, 'nvmlDeviceGetUUID')

        global __nvmlDeviceGetMinorNumber
        __nvmlDeviceGetMinorNumber = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetMinorNumber')
        if __nvmlDeviceGetMinorNumber == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetMinorNumber = dlsym(handle, 'nvmlDeviceGetMinorNumber')

        global __nvmlDeviceGetBoardPartNumber
        __nvmlDeviceGetBoardPartNumber = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetBoardPartNumber')
        if __nvmlDeviceGetBoardPartNumber == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetBoardPartNumber = dlsym(handle, 'nvmlDeviceGetBoardPartNumber')

        global __nvmlDeviceGetInforomVersion
        __nvmlDeviceGetInforomVersion = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetInforomVersion')
        if __nvmlDeviceGetInforomVersion == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetInforomVersion = dlsym(handle, 'nvmlDeviceGetInforomVersion')

        global __nvmlDeviceGetInforomImageVersion
        __nvmlDeviceGetInforomImageVersion = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetInforomImageVersion')
        if __nvmlDeviceGetInforomImageVersion == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetInforomImageVersion = dlsym(handle, 'nvmlDeviceGetInforomImageVersion')

        global __nvmlDeviceGetInforomConfigurationChecksum
        __nvmlDeviceGetInforomConfigurationChecksum = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetInforomConfigurationChecksum')
        if __nvmlDeviceGetInforomConfigurationChecksum == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetInforomConfigurationChecksum = dlsym(handle, 'nvmlDeviceGetInforomConfigurationChecksum')

        global __nvmlDeviceValidateInforom
        __nvmlDeviceValidateInforom = dlsym(RTLD_DEFAULT, 'nvmlDeviceValidateInforom')
        if __nvmlDeviceValidateInforom == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceValidateInforom = dlsym(handle, 'nvmlDeviceValidateInforom')

        global __nvmlDeviceGetLastBBXFlushTime
        __nvmlDeviceGetLastBBXFlushTime = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetLastBBXFlushTime')
        if __nvmlDeviceGetLastBBXFlushTime == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetLastBBXFlushTime = dlsym(handle, 'nvmlDeviceGetLastBBXFlushTime')

        global __nvmlDeviceGetDisplayMode
        __nvmlDeviceGetDisplayMode = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetDisplayMode')
        if __nvmlDeviceGetDisplayMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetDisplayMode = dlsym(handle, 'nvmlDeviceGetDisplayMode')

        global __nvmlDeviceGetDisplayActive
        __nvmlDeviceGetDisplayActive = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetDisplayActive')
        if __nvmlDeviceGetDisplayActive == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetDisplayActive = dlsym(handle, 'nvmlDeviceGetDisplayActive')

        global __nvmlDeviceGetPersistenceMode
        __nvmlDeviceGetPersistenceMode = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetPersistenceMode')
        if __nvmlDeviceGetPersistenceMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetPersistenceMode = dlsym(handle, 'nvmlDeviceGetPersistenceMode')

        global __nvmlDeviceGetPciInfoExt
        __nvmlDeviceGetPciInfoExt = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetPciInfoExt')
        if __nvmlDeviceGetPciInfoExt == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetPciInfoExt = dlsym(handle, 'nvmlDeviceGetPciInfoExt')

        global __nvmlDeviceGetPciInfo_v3
        __nvmlDeviceGetPciInfo_v3 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetPciInfo_v3')
        if __nvmlDeviceGetPciInfo_v3 == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetPciInfo_v3 = dlsym(handle, 'nvmlDeviceGetPciInfo_v3')

        global __nvmlDeviceGetMaxPcieLinkGeneration
        __nvmlDeviceGetMaxPcieLinkGeneration = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetMaxPcieLinkGeneration')
        if __nvmlDeviceGetMaxPcieLinkGeneration == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetMaxPcieLinkGeneration = dlsym(handle, 'nvmlDeviceGetMaxPcieLinkGeneration')

        global __nvmlDeviceGetGpuMaxPcieLinkGeneration
        __nvmlDeviceGetGpuMaxPcieLinkGeneration = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetGpuMaxPcieLinkGeneration')
        if __nvmlDeviceGetGpuMaxPcieLinkGeneration == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetGpuMaxPcieLinkGeneration = dlsym(handle, 'nvmlDeviceGetGpuMaxPcieLinkGeneration')

        global __nvmlDeviceGetMaxPcieLinkWidth
        __nvmlDeviceGetMaxPcieLinkWidth = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetMaxPcieLinkWidth')
        if __nvmlDeviceGetMaxPcieLinkWidth == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetMaxPcieLinkWidth = dlsym(handle, 'nvmlDeviceGetMaxPcieLinkWidth')

        global __nvmlDeviceGetCurrPcieLinkGeneration
        __nvmlDeviceGetCurrPcieLinkGeneration = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetCurrPcieLinkGeneration')
        if __nvmlDeviceGetCurrPcieLinkGeneration == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetCurrPcieLinkGeneration = dlsym(handle, 'nvmlDeviceGetCurrPcieLinkGeneration')

        global __nvmlDeviceGetCurrPcieLinkWidth
        __nvmlDeviceGetCurrPcieLinkWidth = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetCurrPcieLinkWidth')
        if __nvmlDeviceGetCurrPcieLinkWidth == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetCurrPcieLinkWidth = dlsym(handle, 'nvmlDeviceGetCurrPcieLinkWidth')

        global __nvmlDeviceGetPcieThroughput
        __nvmlDeviceGetPcieThroughput = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetPcieThroughput')
        if __nvmlDeviceGetPcieThroughput == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetPcieThroughput = dlsym(handle, 'nvmlDeviceGetPcieThroughput')

        global __nvmlDeviceGetPcieReplayCounter
        __nvmlDeviceGetPcieReplayCounter = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetPcieReplayCounter')
        if __nvmlDeviceGetPcieReplayCounter == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetPcieReplayCounter = dlsym(handle, 'nvmlDeviceGetPcieReplayCounter')

        global __nvmlDeviceGetClockInfo
        __nvmlDeviceGetClockInfo = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetClockInfo')
        if __nvmlDeviceGetClockInfo == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetClockInfo = dlsym(handle, 'nvmlDeviceGetClockInfo')

        global __nvmlDeviceGetMaxClockInfo
        __nvmlDeviceGetMaxClockInfo = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetMaxClockInfo')
        if __nvmlDeviceGetMaxClockInfo == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetMaxClockInfo = dlsym(handle, 'nvmlDeviceGetMaxClockInfo')

        global __nvmlDeviceGetGpcClkVfOffset
        __nvmlDeviceGetGpcClkVfOffset = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetGpcClkVfOffset')
        if __nvmlDeviceGetGpcClkVfOffset == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetGpcClkVfOffset = dlsym(handle, 'nvmlDeviceGetGpcClkVfOffset')

        global __nvmlDeviceGetClock
        __nvmlDeviceGetClock = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetClock')
        if __nvmlDeviceGetClock == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetClock = dlsym(handle, 'nvmlDeviceGetClock')

        global __nvmlDeviceGetMaxCustomerBoostClock
        __nvmlDeviceGetMaxCustomerBoostClock = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetMaxCustomerBoostClock')
        if __nvmlDeviceGetMaxCustomerBoostClock == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetMaxCustomerBoostClock = dlsym(handle, 'nvmlDeviceGetMaxCustomerBoostClock')

        global __nvmlDeviceGetSupportedMemoryClocks
        __nvmlDeviceGetSupportedMemoryClocks = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetSupportedMemoryClocks')
        if __nvmlDeviceGetSupportedMemoryClocks == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetSupportedMemoryClocks = dlsym(handle, 'nvmlDeviceGetSupportedMemoryClocks')

        global __nvmlDeviceGetSupportedGraphicsClocks
        __nvmlDeviceGetSupportedGraphicsClocks = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetSupportedGraphicsClocks')
        if __nvmlDeviceGetSupportedGraphicsClocks == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetSupportedGraphicsClocks = dlsym(handle, 'nvmlDeviceGetSupportedGraphicsClocks')

        global __nvmlDeviceGetAutoBoostedClocksEnabled
        __nvmlDeviceGetAutoBoostedClocksEnabled = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetAutoBoostedClocksEnabled')
        if __nvmlDeviceGetAutoBoostedClocksEnabled == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetAutoBoostedClocksEnabled = dlsym(handle, 'nvmlDeviceGetAutoBoostedClocksEnabled')

        global __nvmlDeviceGetFanSpeed
        __nvmlDeviceGetFanSpeed = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetFanSpeed')
        if __nvmlDeviceGetFanSpeed == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetFanSpeed = dlsym(handle, 'nvmlDeviceGetFanSpeed')

        global __nvmlDeviceGetFanSpeed_v2
        __nvmlDeviceGetFanSpeed_v2 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetFanSpeed_v2')
        if __nvmlDeviceGetFanSpeed_v2 == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetFanSpeed_v2 = dlsym(handle, 'nvmlDeviceGetFanSpeed_v2')

        global __nvmlDeviceGetFanSpeedRPM
        __nvmlDeviceGetFanSpeedRPM = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetFanSpeedRPM')
        if __nvmlDeviceGetFanSpeedRPM == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetFanSpeedRPM = dlsym(handle, 'nvmlDeviceGetFanSpeedRPM')

        global __nvmlDeviceGetTargetFanSpeed
        __nvmlDeviceGetTargetFanSpeed = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetTargetFanSpeed')
        if __nvmlDeviceGetTargetFanSpeed == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetTargetFanSpeed = dlsym(handle, 'nvmlDeviceGetTargetFanSpeed')

        global __nvmlDeviceGetMinMaxFanSpeed
        __nvmlDeviceGetMinMaxFanSpeed = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetMinMaxFanSpeed')
        if __nvmlDeviceGetMinMaxFanSpeed == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetMinMaxFanSpeed = dlsym(handle, 'nvmlDeviceGetMinMaxFanSpeed')

        global __nvmlDeviceGetFanControlPolicy_v2
        __nvmlDeviceGetFanControlPolicy_v2 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetFanControlPolicy_v2')
        if __nvmlDeviceGetFanControlPolicy_v2 == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetFanControlPolicy_v2 = dlsym(handle, 'nvmlDeviceGetFanControlPolicy_v2')

        global __nvmlDeviceGetNumFans
        __nvmlDeviceGetNumFans = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetNumFans')
        if __nvmlDeviceGetNumFans == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetNumFans = dlsym(handle, 'nvmlDeviceGetNumFans')

        global __nvmlDeviceGetCoolerInfo
        __nvmlDeviceGetCoolerInfo = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetCoolerInfo')
        if __nvmlDeviceGetCoolerInfo == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetCoolerInfo = dlsym(handle, 'nvmlDeviceGetCoolerInfo')

        global __nvmlDeviceGetTemperatureV
        __nvmlDeviceGetTemperatureV = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetTemperatureV')
        if __nvmlDeviceGetTemperatureV == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetTemperatureV = dlsym(handle, 'nvmlDeviceGetTemperatureV')

        global __nvmlDeviceGetTemperatureThreshold
        __nvmlDeviceGetTemperatureThreshold = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetTemperatureThreshold')
        if __nvmlDeviceGetTemperatureThreshold == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetTemperatureThreshold = dlsym(handle, 'nvmlDeviceGetTemperatureThreshold')

        global __nvmlDeviceGetMarginTemperature
        __nvmlDeviceGetMarginTemperature = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetMarginTemperature')
        if __nvmlDeviceGetMarginTemperature == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetMarginTemperature = dlsym(handle, 'nvmlDeviceGetMarginTemperature')

        global __nvmlDeviceGetThermalSettings
        __nvmlDeviceGetThermalSettings = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetThermalSettings')
        if __nvmlDeviceGetThermalSettings == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetThermalSettings = dlsym(handle, 'nvmlDeviceGetThermalSettings')

        global __nvmlDeviceGetPerformanceState
        __nvmlDeviceGetPerformanceState = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetPerformanceState')
        if __nvmlDeviceGetPerformanceState == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetPerformanceState = dlsym(handle, 'nvmlDeviceGetPerformanceState')

        global __nvmlDeviceGetCurrentClocksEventReasons
        __nvmlDeviceGetCurrentClocksEventReasons = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetCurrentClocksEventReasons')
        if __nvmlDeviceGetCurrentClocksEventReasons == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetCurrentClocksEventReasons = dlsym(handle, 'nvmlDeviceGetCurrentClocksEventReasons')

        global __nvmlDeviceGetSupportedClocksEventReasons
        __nvmlDeviceGetSupportedClocksEventReasons = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetSupportedClocksEventReasons')
        if __nvmlDeviceGetSupportedClocksEventReasons == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetSupportedClocksEventReasons = dlsym(handle, 'nvmlDeviceGetSupportedClocksEventReasons')

        global __nvmlDeviceGetPowerState
        __nvmlDeviceGetPowerState = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetPowerState')
        if __nvmlDeviceGetPowerState == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetPowerState = dlsym(handle, 'nvmlDeviceGetPowerState')

        global __nvmlDeviceGetDynamicPstatesInfo
        __nvmlDeviceGetDynamicPstatesInfo = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetDynamicPstatesInfo')
        if __nvmlDeviceGetDynamicPstatesInfo == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetDynamicPstatesInfo = dlsym(handle, 'nvmlDeviceGetDynamicPstatesInfo')

        global __nvmlDeviceGetMemClkVfOffset
        __nvmlDeviceGetMemClkVfOffset = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetMemClkVfOffset')
        if __nvmlDeviceGetMemClkVfOffset == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetMemClkVfOffset = dlsym(handle, 'nvmlDeviceGetMemClkVfOffset')

        global __nvmlDeviceGetMinMaxClockOfPState
        __nvmlDeviceGetMinMaxClockOfPState = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetMinMaxClockOfPState')
        if __nvmlDeviceGetMinMaxClockOfPState == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetMinMaxClockOfPState = dlsym(handle, 'nvmlDeviceGetMinMaxClockOfPState')

        global __nvmlDeviceGetSupportedPerformanceStates
        __nvmlDeviceGetSupportedPerformanceStates = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetSupportedPerformanceStates')
        if __nvmlDeviceGetSupportedPerformanceStates == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetSupportedPerformanceStates = dlsym(handle, 'nvmlDeviceGetSupportedPerformanceStates')

        global __nvmlDeviceGetGpcClkMinMaxVfOffset
        __nvmlDeviceGetGpcClkMinMaxVfOffset = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetGpcClkMinMaxVfOffset')
        if __nvmlDeviceGetGpcClkMinMaxVfOffset == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetGpcClkMinMaxVfOffset = dlsym(handle, 'nvmlDeviceGetGpcClkMinMaxVfOffset')

        global __nvmlDeviceGetMemClkMinMaxVfOffset
        __nvmlDeviceGetMemClkMinMaxVfOffset = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetMemClkMinMaxVfOffset')
        if __nvmlDeviceGetMemClkMinMaxVfOffset == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetMemClkMinMaxVfOffset = dlsym(handle, 'nvmlDeviceGetMemClkMinMaxVfOffset')

        global __nvmlDeviceGetClockOffsets
        __nvmlDeviceGetClockOffsets = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetClockOffsets')
        if __nvmlDeviceGetClockOffsets == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetClockOffsets = dlsym(handle, 'nvmlDeviceGetClockOffsets')

        global __nvmlDeviceSetClockOffsets
        __nvmlDeviceSetClockOffsets = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetClockOffsets')
        if __nvmlDeviceSetClockOffsets == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetClockOffsets = dlsym(handle, 'nvmlDeviceSetClockOffsets')

        global __nvmlDeviceGetPerformanceModes
        __nvmlDeviceGetPerformanceModes = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetPerformanceModes')
        if __nvmlDeviceGetPerformanceModes == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetPerformanceModes = dlsym(handle, 'nvmlDeviceGetPerformanceModes')

        global __nvmlDeviceGetCurrentClockFreqs
        __nvmlDeviceGetCurrentClockFreqs = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetCurrentClockFreqs')
        if __nvmlDeviceGetCurrentClockFreqs == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetCurrentClockFreqs = dlsym(handle, 'nvmlDeviceGetCurrentClockFreqs')

        global __nvmlDeviceGetPowerManagementLimit
        __nvmlDeviceGetPowerManagementLimit = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetPowerManagementLimit')
        if __nvmlDeviceGetPowerManagementLimit == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetPowerManagementLimit = dlsym(handle, 'nvmlDeviceGetPowerManagementLimit')

        global __nvmlDeviceGetPowerManagementLimitConstraints
        __nvmlDeviceGetPowerManagementLimitConstraints = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetPowerManagementLimitConstraints')
        if __nvmlDeviceGetPowerManagementLimitConstraints == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetPowerManagementLimitConstraints = dlsym(handle, 'nvmlDeviceGetPowerManagementLimitConstraints')

        global __nvmlDeviceGetPowerManagementDefaultLimit
        __nvmlDeviceGetPowerManagementDefaultLimit = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetPowerManagementDefaultLimit')
        if __nvmlDeviceGetPowerManagementDefaultLimit == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetPowerManagementDefaultLimit = dlsym(handle, 'nvmlDeviceGetPowerManagementDefaultLimit')

        global __nvmlDeviceGetPowerUsage
        __nvmlDeviceGetPowerUsage = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetPowerUsage')
        if __nvmlDeviceGetPowerUsage == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetPowerUsage = dlsym(handle, 'nvmlDeviceGetPowerUsage')

        global __nvmlDeviceGetTotalEnergyConsumption
        __nvmlDeviceGetTotalEnergyConsumption = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetTotalEnergyConsumption')
        if __nvmlDeviceGetTotalEnergyConsumption == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetTotalEnergyConsumption = dlsym(handle, 'nvmlDeviceGetTotalEnergyConsumption')

        global __nvmlDeviceGetEnforcedPowerLimit
        __nvmlDeviceGetEnforcedPowerLimit = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetEnforcedPowerLimit')
        if __nvmlDeviceGetEnforcedPowerLimit == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetEnforcedPowerLimit = dlsym(handle, 'nvmlDeviceGetEnforcedPowerLimit')

        global __nvmlDeviceGetGpuOperationMode
        __nvmlDeviceGetGpuOperationMode = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetGpuOperationMode')
        if __nvmlDeviceGetGpuOperationMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetGpuOperationMode = dlsym(handle, 'nvmlDeviceGetGpuOperationMode')

        global __nvmlDeviceGetMemoryInfo_v2
        __nvmlDeviceGetMemoryInfo_v2 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetMemoryInfo_v2')
        if __nvmlDeviceGetMemoryInfo_v2 == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetMemoryInfo_v2 = dlsym(handle, 'nvmlDeviceGetMemoryInfo_v2')

        global __nvmlDeviceGetComputeMode
        __nvmlDeviceGetComputeMode = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetComputeMode')
        if __nvmlDeviceGetComputeMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetComputeMode = dlsym(handle, 'nvmlDeviceGetComputeMode')

        global __nvmlDeviceGetCudaComputeCapability
        __nvmlDeviceGetCudaComputeCapability = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetCudaComputeCapability')
        if __nvmlDeviceGetCudaComputeCapability == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetCudaComputeCapability = dlsym(handle, 'nvmlDeviceGetCudaComputeCapability')

        global __nvmlDeviceGetDramEncryptionMode
        __nvmlDeviceGetDramEncryptionMode = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetDramEncryptionMode')
        if __nvmlDeviceGetDramEncryptionMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetDramEncryptionMode = dlsym(handle, 'nvmlDeviceGetDramEncryptionMode')

        global __nvmlDeviceSetDramEncryptionMode
        __nvmlDeviceSetDramEncryptionMode = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetDramEncryptionMode')
        if __nvmlDeviceSetDramEncryptionMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetDramEncryptionMode = dlsym(handle, 'nvmlDeviceSetDramEncryptionMode')

        global __nvmlDeviceGetEccMode
        __nvmlDeviceGetEccMode = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetEccMode')
        if __nvmlDeviceGetEccMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetEccMode = dlsym(handle, 'nvmlDeviceGetEccMode')

        global __nvmlDeviceGetDefaultEccMode
        __nvmlDeviceGetDefaultEccMode = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetDefaultEccMode')
        if __nvmlDeviceGetDefaultEccMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetDefaultEccMode = dlsym(handle, 'nvmlDeviceGetDefaultEccMode')

        global __nvmlDeviceGetBoardId
        __nvmlDeviceGetBoardId = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetBoardId')
        if __nvmlDeviceGetBoardId == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetBoardId = dlsym(handle, 'nvmlDeviceGetBoardId')

        global __nvmlDeviceGetMultiGpuBoard
        __nvmlDeviceGetMultiGpuBoard = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetMultiGpuBoard')
        if __nvmlDeviceGetMultiGpuBoard == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetMultiGpuBoard = dlsym(handle, 'nvmlDeviceGetMultiGpuBoard')

        global __nvmlDeviceGetTotalEccErrors
        __nvmlDeviceGetTotalEccErrors = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetTotalEccErrors')
        if __nvmlDeviceGetTotalEccErrors == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetTotalEccErrors = dlsym(handle, 'nvmlDeviceGetTotalEccErrors')

        global __nvmlDeviceGetMemoryErrorCounter
        __nvmlDeviceGetMemoryErrorCounter = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetMemoryErrorCounter')
        if __nvmlDeviceGetMemoryErrorCounter == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetMemoryErrorCounter = dlsym(handle, 'nvmlDeviceGetMemoryErrorCounter')

        global __nvmlDeviceGetUtilizationRates
        __nvmlDeviceGetUtilizationRates = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetUtilizationRates')
        if __nvmlDeviceGetUtilizationRates == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetUtilizationRates = dlsym(handle, 'nvmlDeviceGetUtilizationRates')

        global __nvmlDeviceGetEncoderUtilization
        __nvmlDeviceGetEncoderUtilization = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetEncoderUtilization')
        if __nvmlDeviceGetEncoderUtilization == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetEncoderUtilization = dlsym(handle, 'nvmlDeviceGetEncoderUtilization')

        global __nvmlDeviceGetEncoderCapacity
        __nvmlDeviceGetEncoderCapacity = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetEncoderCapacity')
        if __nvmlDeviceGetEncoderCapacity == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetEncoderCapacity = dlsym(handle, 'nvmlDeviceGetEncoderCapacity')

        global __nvmlDeviceGetEncoderStats
        __nvmlDeviceGetEncoderStats = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetEncoderStats')
        if __nvmlDeviceGetEncoderStats == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetEncoderStats = dlsym(handle, 'nvmlDeviceGetEncoderStats')

        global __nvmlDeviceGetEncoderSessions
        __nvmlDeviceGetEncoderSessions = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetEncoderSessions')
        if __nvmlDeviceGetEncoderSessions == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetEncoderSessions = dlsym(handle, 'nvmlDeviceGetEncoderSessions')

        global __nvmlDeviceGetDecoderUtilization
        __nvmlDeviceGetDecoderUtilization = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetDecoderUtilization')
        if __nvmlDeviceGetDecoderUtilization == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetDecoderUtilization = dlsym(handle, 'nvmlDeviceGetDecoderUtilization')

        global __nvmlDeviceGetJpgUtilization
        __nvmlDeviceGetJpgUtilization = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetJpgUtilization')
        if __nvmlDeviceGetJpgUtilization == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetJpgUtilization = dlsym(handle, 'nvmlDeviceGetJpgUtilization')

        global __nvmlDeviceGetOfaUtilization
        __nvmlDeviceGetOfaUtilization = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetOfaUtilization')
        if __nvmlDeviceGetOfaUtilization == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetOfaUtilization = dlsym(handle, 'nvmlDeviceGetOfaUtilization')

        global __nvmlDeviceGetFBCStats
        __nvmlDeviceGetFBCStats = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetFBCStats')
        if __nvmlDeviceGetFBCStats == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetFBCStats = dlsym(handle, 'nvmlDeviceGetFBCStats')

        global __nvmlDeviceGetFBCSessions
        __nvmlDeviceGetFBCSessions = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetFBCSessions')
        if __nvmlDeviceGetFBCSessions == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetFBCSessions = dlsym(handle, 'nvmlDeviceGetFBCSessions')

        global __nvmlDeviceGetDriverModel_v2
        __nvmlDeviceGetDriverModel_v2 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetDriverModel_v2')
        if __nvmlDeviceGetDriverModel_v2 == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetDriverModel_v2 = dlsym(handle, 'nvmlDeviceGetDriverModel_v2')

        global __nvmlDeviceGetVbiosVersion
        __nvmlDeviceGetVbiosVersion = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetVbiosVersion')
        if __nvmlDeviceGetVbiosVersion == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetVbiosVersion = dlsym(handle, 'nvmlDeviceGetVbiosVersion')

        global __nvmlDeviceGetBridgeChipInfo
        __nvmlDeviceGetBridgeChipInfo = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetBridgeChipInfo')
        if __nvmlDeviceGetBridgeChipInfo == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetBridgeChipInfo = dlsym(handle, 'nvmlDeviceGetBridgeChipInfo')

        global __nvmlDeviceGetComputeRunningProcesses_v3
        __nvmlDeviceGetComputeRunningProcesses_v3 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetComputeRunningProcesses_v3')
        if __nvmlDeviceGetComputeRunningProcesses_v3 == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetComputeRunningProcesses_v3 = dlsym(handle, 'nvmlDeviceGetComputeRunningProcesses_v3')

        global __nvmlDeviceGetMPSComputeRunningProcesses_v3
        __nvmlDeviceGetMPSComputeRunningProcesses_v3 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetMPSComputeRunningProcesses_v3')
        if __nvmlDeviceGetMPSComputeRunningProcesses_v3 == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetMPSComputeRunningProcesses_v3 = dlsym(handle, 'nvmlDeviceGetMPSComputeRunningProcesses_v3')

        global __nvmlDeviceGetRunningProcessDetailList
        __nvmlDeviceGetRunningProcessDetailList = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetRunningProcessDetailList')
        if __nvmlDeviceGetRunningProcessDetailList == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetRunningProcessDetailList = dlsym(handle, 'nvmlDeviceGetRunningProcessDetailList')

        global __nvmlDeviceOnSameBoard
        __nvmlDeviceOnSameBoard = dlsym(RTLD_DEFAULT, 'nvmlDeviceOnSameBoard')
        if __nvmlDeviceOnSameBoard == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceOnSameBoard = dlsym(handle, 'nvmlDeviceOnSameBoard')

        global __nvmlDeviceGetAPIRestriction
        __nvmlDeviceGetAPIRestriction = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetAPIRestriction')
        if __nvmlDeviceGetAPIRestriction == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetAPIRestriction = dlsym(handle, 'nvmlDeviceGetAPIRestriction')

        global __nvmlDeviceGetSamples
        __nvmlDeviceGetSamples = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetSamples')
        if __nvmlDeviceGetSamples == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetSamples = dlsym(handle, 'nvmlDeviceGetSamples')

        global __nvmlDeviceGetBAR1MemoryInfo
        __nvmlDeviceGetBAR1MemoryInfo = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetBAR1MemoryInfo')
        if __nvmlDeviceGetBAR1MemoryInfo == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetBAR1MemoryInfo = dlsym(handle, 'nvmlDeviceGetBAR1MemoryInfo')

        global __nvmlDeviceGetIrqNum
        __nvmlDeviceGetIrqNum = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetIrqNum')
        if __nvmlDeviceGetIrqNum == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetIrqNum = dlsym(handle, 'nvmlDeviceGetIrqNum')

        global __nvmlDeviceGetNumGpuCores
        __nvmlDeviceGetNumGpuCores = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetNumGpuCores')
        if __nvmlDeviceGetNumGpuCores == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetNumGpuCores = dlsym(handle, 'nvmlDeviceGetNumGpuCores')

        global __nvmlDeviceGetPowerSource
        __nvmlDeviceGetPowerSource = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetPowerSource')
        if __nvmlDeviceGetPowerSource == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetPowerSource = dlsym(handle, 'nvmlDeviceGetPowerSource')

        global __nvmlDeviceGetMemoryBusWidth
        __nvmlDeviceGetMemoryBusWidth = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetMemoryBusWidth')
        if __nvmlDeviceGetMemoryBusWidth == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetMemoryBusWidth = dlsym(handle, 'nvmlDeviceGetMemoryBusWidth')

        global __nvmlDeviceGetPcieLinkMaxSpeed
        __nvmlDeviceGetPcieLinkMaxSpeed = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetPcieLinkMaxSpeed')
        if __nvmlDeviceGetPcieLinkMaxSpeed == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetPcieLinkMaxSpeed = dlsym(handle, 'nvmlDeviceGetPcieLinkMaxSpeed')

        global __nvmlDeviceGetPcieSpeed
        __nvmlDeviceGetPcieSpeed = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetPcieSpeed')
        if __nvmlDeviceGetPcieSpeed == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetPcieSpeed = dlsym(handle, 'nvmlDeviceGetPcieSpeed')

        global __nvmlDeviceGetAdaptiveClockInfoStatus
        __nvmlDeviceGetAdaptiveClockInfoStatus = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetAdaptiveClockInfoStatus')
        if __nvmlDeviceGetAdaptiveClockInfoStatus == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetAdaptiveClockInfoStatus = dlsym(handle, 'nvmlDeviceGetAdaptiveClockInfoStatus')

        global __nvmlDeviceGetBusType
        __nvmlDeviceGetBusType = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetBusType')
        if __nvmlDeviceGetBusType == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetBusType = dlsym(handle, 'nvmlDeviceGetBusType')

        global __nvmlDeviceGetGpuFabricInfoV
        __nvmlDeviceGetGpuFabricInfoV = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetGpuFabricInfoV')
        if __nvmlDeviceGetGpuFabricInfoV == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetGpuFabricInfoV = dlsym(handle, 'nvmlDeviceGetGpuFabricInfoV')

        global __nvmlSystemGetConfComputeCapabilities
        __nvmlSystemGetConfComputeCapabilities = dlsym(RTLD_DEFAULT, 'nvmlSystemGetConfComputeCapabilities')
        if __nvmlSystemGetConfComputeCapabilities == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlSystemGetConfComputeCapabilities = dlsym(handle, 'nvmlSystemGetConfComputeCapabilities')

        global __nvmlSystemGetConfComputeState
        __nvmlSystemGetConfComputeState = dlsym(RTLD_DEFAULT, 'nvmlSystemGetConfComputeState')
        if __nvmlSystemGetConfComputeState == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlSystemGetConfComputeState = dlsym(handle, 'nvmlSystemGetConfComputeState')

        global __nvmlDeviceGetConfComputeMemSizeInfo
        __nvmlDeviceGetConfComputeMemSizeInfo = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetConfComputeMemSizeInfo')
        if __nvmlDeviceGetConfComputeMemSizeInfo == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetConfComputeMemSizeInfo = dlsym(handle, 'nvmlDeviceGetConfComputeMemSizeInfo')

        global __nvmlSystemGetConfComputeGpusReadyState
        __nvmlSystemGetConfComputeGpusReadyState = dlsym(RTLD_DEFAULT, 'nvmlSystemGetConfComputeGpusReadyState')
        if __nvmlSystemGetConfComputeGpusReadyState == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlSystemGetConfComputeGpusReadyState = dlsym(handle, 'nvmlSystemGetConfComputeGpusReadyState')

        global __nvmlDeviceGetConfComputeProtectedMemoryUsage
        __nvmlDeviceGetConfComputeProtectedMemoryUsage = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetConfComputeProtectedMemoryUsage')
        if __nvmlDeviceGetConfComputeProtectedMemoryUsage == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetConfComputeProtectedMemoryUsage = dlsym(handle, 'nvmlDeviceGetConfComputeProtectedMemoryUsage')

        global __nvmlDeviceGetConfComputeGpuCertificate
        __nvmlDeviceGetConfComputeGpuCertificate = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetConfComputeGpuCertificate')
        if __nvmlDeviceGetConfComputeGpuCertificate == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetConfComputeGpuCertificate = dlsym(handle, 'nvmlDeviceGetConfComputeGpuCertificate')

        global __nvmlDeviceGetConfComputeGpuAttestationReport
        __nvmlDeviceGetConfComputeGpuAttestationReport = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetConfComputeGpuAttestationReport')
        if __nvmlDeviceGetConfComputeGpuAttestationReport == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetConfComputeGpuAttestationReport = dlsym(handle, 'nvmlDeviceGetConfComputeGpuAttestationReport')

        global __nvmlSystemGetConfComputeKeyRotationThresholdInfo
        __nvmlSystemGetConfComputeKeyRotationThresholdInfo = dlsym(RTLD_DEFAULT, 'nvmlSystemGetConfComputeKeyRotationThresholdInfo')
        if __nvmlSystemGetConfComputeKeyRotationThresholdInfo == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlSystemGetConfComputeKeyRotationThresholdInfo = dlsym(handle, 'nvmlSystemGetConfComputeKeyRotationThresholdInfo')

        global __nvmlDeviceSetConfComputeUnprotectedMemSize
        __nvmlDeviceSetConfComputeUnprotectedMemSize = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetConfComputeUnprotectedMemSize')
        if __nvmlDeviceSetConfComputeUnprotectedMemSize == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetConfComputeUnprotectedMemSize = dlsym(handle, 'nvmlDeviceSetConfComputeUnprotectedMemSize')

        global __nvmlSystemSetConfComputeGpusReadyState
        __nvmlSystemSetConfComputeGpusReadyState = dlsym(RTLD_DEFAULT, 'nvmlSystemSetConfComputeGpusReadyState')
        if __nvmlSystemSetConfComputeGpusReadyState == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlSystemSetConfComputeGpusReadyState = dlsym(handle, 'nvmlSystemSetConfComputeGpusReadyState')

        global __nvmlSystemSetConfComputeKeyRotationThresholdInfo
        __nvmlSystemSetConfComputeKeyRotationThresholdInfo = dlsym(RTLD_DEFAULT, 'nvmlSystemSetConfComputeKeyRotationThresholdInfo')
        if __nvmlSystemSetConfComputeKeyRotationThresholdInfo == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlSystemSetConfComputeKeyRotationThresholdInfo = dlsym(handle, 'nvmlSystemSetConfComputeKeyRotationThresholdInfo')

        global __nvmlSystemGetConfComputeSettings
        __nvmlSystemGetConfComputeSettings = dlsym(RTLD_DEFAULT, 'nvmlSystemGetConfComputeSettings')
        if __nvmlSystemGetConfComputeSettings == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlSystemGetConfComputeSettings = dlsym(handle, 'nvmlSystemGetConfComputeSettings')

        global __nvmlDeviceGetGspFirmwareVersion
        __nvmlDeviceGetGspFirmwareVersion = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetGspFirmwareVersion')
        if __nvmlDeviceGetGspFirmwareVersion == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetGspFirmwareVersion = dlsym(handle, 'nvmlDeviceGetGspFirmwareVersion')

        global __nvmlDeviceGetGspFirmwareMode
        __nvmlDeviceGetGspFirmwareMode = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetGspFirmwareMode')
        if __nvmlDeviceGetGspFirmwareMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetGspFirmwareMode = dlsym(handle, 'nvmlDeviceGetGspFirmwareMode')

        global __nvmlDeviceGetSramEccErrorStatus
        __nvmlDeviceGetSramEccErrorStatus = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetSramEccErrorStatus')
        if __nvmlDeviceGetSramEccErrorStatus == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetSramEccErrorStatus = dlsym(handle, 'nvmlDeviceGetSramEccErrorStatus')

        global __nvmlDeviceGetAccountingMode
        __nvmlDeviceGetAccountingMode = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetAccountingMode')
        if __nvmlDeviceGetAccountingMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetAccountingMode = dlsym(handle, 'nvmlDeviceGetAccountingMode')

        global __nvmlDeviceGetAccountingStats
        __nvmlDeviceGetAccountingStats = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetAccountingStats')
        if __nvmlDeviceGetAccountingStats == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetAccountingStats = dlsym(handle, 'nvmlDeviceGetAccountingStats')

        global __nvmlDeviceGetAccountingPids
        __nvmlDeviceGetAccountingPids = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetAccountingPids')
        if __nvmlDeviceGetAccountingPids == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetAccountingPids = dlsym(handle, 'nvmlDeviceGetAccountingPids')

        global __nvmlDeviceGetAccountingBufferSize
        __nvmlDeviceGetAccountingBufferSize = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetAccountingBufferSize')
        if __nvmlDeviceGetAccountingBufferSize == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetAccountingBufferSize = dlsym(handle, 'nvmlDeviceGetAccountingBufferSize')

        global __nvmlDeviceGetRetiredPages
        __nvmlDeviceGetRetiredPages = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetRetiredPages')
        if __nvmlDeviceGetRetiredPages == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetRetiredPages = dlsym(handle, 'nvmlDeviceGetRetiredPages')

        global __nvmlDeviceGetRetiredPages_v2
        __nvmlDeviceGetRetiredPages_v2 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetRetiredPages_v2')
        if __nvmlDeviceGetRetiredPages_v2 == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetRetiredPages_v2 = dlsym(handle, 'nvmlDeviceGetRetiredPages_v2')

        global __nvmlDeviceGetRetiredPagesPendingStatus
        __nvmlDeviceGetRetiredPagesPendingStatus = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetRetiredPagesPendingStatus')
        if __nvmlDeviceGetRetiredPagesPendingStatus == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetRetiredPagesPendingStatus = dlsym(handle, 'nvmlDeviceGetRetiredPagesPendingStatus')

        global __nvmlDeviceGetRemappedRows
        __nvmlDeviceGetRemappedRows = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetRemappedRows')
        if __nvmlDeviceGetRemappedRows == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetRemappedRows = dlsym(handle, 'nvmlDeviceGetRemappedRows')

        global __nvmlDeviceGetRowRemapperHistogram
        __nvmlDeviceGetRowRemapperHistogram = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetRowRemapperHistogram')
        if __nvmlDeviceGetRowRemapperHistogram == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetRowRemapperHistogram = dlsym(handle, 'nvmlDeviceGetRowRemapperHistogram')

        global __nvmlDeviceGetArchitecture
        __nvmlDeviceGetArchitecture = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetArchitecture')
        if __nvmlDeviceGetArchitecture == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetArchitecture = dlsym(handle, 'nvmlDeviceGetArchitecture')

        global __nvmlDeviceGetClkMonStatus
        __nvmlDeviceGetClkMonStatus = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetClkMonStatus')
        if __nvmlDeviceGetClkMonStatus == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetClkMonStatus = dlsym(handle, 'nvmlDeviceGetClkMonStatus')

        global __nvmlDeviceGetProcessUtilization
        __nvmlDeviceGetProcessUtilization = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetProcessUtilization')
        if __nvmlDeviceGetProcessUtilization == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetProcessUtilization = dlsym(handle, 'nvmlDeviceGetProcessUtilization')

        global __nvmlDeviceGetProcessesUtilizationInfo
        __nvmlDeviceGetProcessesUtilizationInfo = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetProcessesUtilizationInfo')
        if __nvmlDeviceGetProcessesUtilizationInfo == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetProcessesUtilizationInfo = dlsym(handle, 'nvmlDeviceGetProcessesUtilizationInfo')

        global __nvmlDeviceGetPlatformInfo
        __nvmlDeviceGetPlatformInfo = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetPlatformInfo')
        if __nvmlDeviceGetPlatformInfo == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetPlatformInfo = dlsym(handle, 'nvmlDeviceGetPlatformInfo')

        global __nvmlUnitSetLedState
        __nvmlUnitSetLedState = dlsym(RTLD_DEFAULT, 'nvmlUnitSetLedState')
        if __nvmlUnitSetLedState == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlUnitSetLedState = dlsym(handle, 'nvmlUnitSetLedState')

        global __nvmlDeviceSetPersistenceMode
        __nvmlDeviceSetPersistenceMode = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetPersistenceMode')
        if __nvmlDeviceSetPersistenceMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetPersistenceMode = dlsym(handle, 'nvmlDeviceSetPersistenceMode')

        global __nvmlDeviceSetComputeMode
        __nvmlDeviceSetComputeMode = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetComputeMode')
        if __nvmlDeviceSetComputeMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetComputeMode = dlsym(handle, 'nvmlDeviceSetComputeMode')

        global __nvmlDeviceSetEccMode
        __nvmlDeviceSetEccMode = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetEccMode')
        if __nvmlDeviceSetEccMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetEccMode = dlsym(handle, 'nvmlDeviceSetEccMode')

        global __nvmlDeviceClearEccErrorCounts
        __nvmlDeviceClearEccErrorCounts = dlsym(RTLD_DEFAULT, 'nvmlDeviceClearEccErrorCounts')
        if __nvmlDeviceClearEccErrorCounts == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceClearEccErrorCounts = dlsym(handle, 'nvmlDeviceClearEccErrorCounts')

        global __nvmlDeviceSetDriverModel
        __nvmlDeviceSetDriverModel = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetDriverModel')
        if __nvmlDeviceSetDriverModel == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetDriverModel = dlsym(handle, 'nvmlDeviceSetDriverModel')

        global __nvmlDeviceSetGpuLockedClocks
        __nvmlDeviceSetGpuLockedClocks = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetGpuLockedClocks')
        if __nvmlDeviceSetGpuLockedClocks == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetGpuLockedClocks = dlsym(handle, 'nvmlDeviceSetGpuLockedClocks')

        global __nvmlDeviceResetGpuLockedClocks
        __nvmlDeviceResetGpuLockedClocks = dlsym(RTLD_DEFAULT, 'nvmlDeviceResetGpuLockedClocks')
        if __nvmlDeviceResetGpuLockedClocks == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceResetGpuLockedClocks = dlsym(handle, 'nvmlDeviceResetGpuLockedClocks')

        global __nvmlDeviceSetMemoryLockedClocks
        __nvmlDeviceSetMemoryLockedClocks = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetMemoryLockedClocks')
        if __nvmlDeviceSetMemoryLockedClocks == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetMemoryLockedClocks = dlsym(handle, 'nvmlDeviceSetMemoryLockedClocks')

        global __nvmlDeviceResetMemoryLockedClocks
        __nvmlDeviceResetMemoryLockedClocks = dlsym(RTLD_DEFAULT, 'nvmlDeviceResetMemoryLockedClocks')
        if __nvmlDeviceResetMemoryLockedClocks == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceResetMemoryLockedClocks = dlsym(handle, 'nvmlDeviceResetMemoryLockedClocks')

        global __nvmlDeviceSetAutoBoostedClocksEnabled
        __nvmlDeviceSetAutoBoostedClocksEnabled = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetAutoBoostedClocksEnabled')
        if __nvmlDeviceSetAutoBoostedClocksEnabled == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetAutoBoostedClocksEnabled = dlsym(handle, 'nvmlDeviceSetAutoBoostedClocksEnabled')

        global __nvmlDeviceSetDefaultAutoBoostedClocksEnabled
        __nvmlDeviceSetDefaultAutoBoostedClocksEnabled = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetDefaultAutoBoostedClocksEnabled')
        if __nvmlDeviceSetDefaultAutoBoostedClocksEnabled == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetDefaultAutoBoostedClocksEnabled = dlsym(handle, 'nvmlDeviceSetDefaultAutoBoostedClocksEnabled')

        global __nvmlDeviceSetDefaultFanSpeed_v2
        __nvmlDeviceSetDefaultFanSpeed_v2 = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetDefaultFanSpeed_v2')
        if __nvmlDeviceSetDefaultFanSpeed_v2 == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetDefaultFanSpeed_v2 = dlsym(handle, 'nvmlDeviceSetDefaultFanSpeed_v2')

        global __nvmlDeviceSetFanControlPolicy
        __nvmlDeviceSetFanControlPolicy = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetFanControlPolicy')
        if __nvmlDeviceSetFanControlPolicy == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetFanControlPolicy = dlsym(handle, 'nvmlDeviceSetFanControlPolicy')

        global __nvmlDeviceSetTemperatureThreshold
        __nvmlDeviceSetTemperatureThreshold = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetTemperatureThreshold')
        if __nvmlDeviceSetTemperatureThreshold == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetTemperatureThreshold = dlsym(handle, 'nvmlDeviceSetTemperatureThreshold')

        global __nvmlDeviceSetPowerManagementLimit
        __nvmlDeviceSetPowerManagementLimit = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetPowerManagementLimit')
        if __nvmlDeviceSetPowerManagementLimit == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetPowerManagementLimit = dlsym(handle, 'nvmlDeviceSetPowerManagementLimit')

        global __nvmlDeviceSetGpuOperationMode
        __nvmlDeviceSetGpuOperationMode = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetGpuOperationMode')
        if __nvmlDeviceSetGpuOperationMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetGpuOperationMode = dlsym(handle, 'nvmlDeviceSetGpuOperationMode')

        global __nvmlDeviceSetAPIRestriction
        __nvmlDeviceSetAPIRestriction = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetAPIRestriction')
        if __nvmlDeviceSetAPIRestriction == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetAPIRestriction = dlsym(handle, 'nvmlDeviceSetAPIRestriction')

        global __nvmlDeviceSetFanSpeed_v2
        __nvmlDeviceSetFanSpeed_v2 = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetFanSpeed_v2')
        if __nvmlDeviceSetFanSpeed_v2 == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetFanSpeed_v2 = dlsym(handle, 'nvmlDeviceSetFanSpeed_v2')

        global __nvmlDeviceSetAccountingMode
        __nvmlDeviceSetAccountingMode = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetAccountingMode')
        if __nvmlDeviceSetAccountingMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetAccountingMode = dlsym(handle, 'nvmlDeviceSetAccountingMode')

        global __nvmlDeviceClearAccountingPids
        __nvmlDeviceClearAccountingPids = dlsym(RTLD_DEFAULT, 'nvmlDeviceClearAccountingPids')
        if __nvmlDeviceClearAccountingPids == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceClearAccountingPids = dlsym(handle, 'nvmlDeviceClearAccountingPids')

        global __nvmlDeviceSetPowerManagementLimit_v2
        __nvmlDeviceSetPowerManagementLimit_v2 = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetPowerManagementLimit_v2')
        if __nvmlDeviceSetPowerManagementLimit_v2 == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetPowerManagementLimit_v2 = dlsym(handle, 'nvmlDeviceSetPowerManagementLimit_v2')

        global __nvmlDeviceGetNvLinkState
        __nvmlDeviceGetNvLinkState = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetNvLinkState')
        if __nvmlDeviceGetNvLinkState == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetNvLinkState = dlsym(handle, 'nvmlDeviceGetNvLinkState')

        global __nvmlDeviceGetNvLinkVersion
        __nvmlDeviceGetNvLinkVersion = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetNvLinkVersion')
        if __nvmlDeviceGetNvLinkVersion == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetNvLinkVersion = dlsym(handle, 'nvmlDeviceGetNvLinkVersion')

        global __nvmlDeviceGetNvLinkCapability
        __nvmlDeviceGetNvLinkCapability = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetNvLinkCapability')
        if __nvmlDeviceGetNvLinkCapability == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetNvLinkCapability = dlsym(handle, 'nvmlDeviceGetNvLinkCapability')

        global __nvmlDeviceGetNvLinkRemotePciInfo_v2
        __nvmlDeviceGetNvLinkRemotePciInfo_v2 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetNvLinkRemotePciInfo_v2')
        if __nvmlDeviceGetNvLinkRemotePciInfo_v2 == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetNvLinkRemotePciInfo_v2 = dlsym(handle, 'nvmlDeviceGetNvLinkRemotePciInfo_v2')

        global __nvmlDeviceGetNvLinkErrorCounter
        __nvmlDeviceGetNvLinkErrorCounter = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetNvLinkErrorCounter')
        if __nvmlDeviceGetNvLinkErrorCounter == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetNvLinkErrorCounter = dlsym(handle, 'nvmlDeviceGetNvLinkErrorCounter')

        global __nvmlDeviceResetNvLinkErrorCounters
        __nvmlDeviceResetNvLinkErrorCounters = dlsym(RTLD_DEFAULT, 'nvmlDeviceResetNvLinkErrorCounters')
        if __nvmlDeviceResetNvLinkErrorCounters == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceResetNvLinkErrorCounters = dlsym(handle, 'nvmlDeviceResetNvLinkErrorCounters')

        global __nvmlDeviceGetNvLinkRemoteDeviceType
        __nvmlDeviceGetNvLinkRemoteDeviceType = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetNvLinkRemoteDeviceType')
        if __nvmlDeviceGetNvLinkRemoteDeviceType == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetNvLinkRemoteDeviceType = dlsym(handle, 'nvmlDeviceGetNvLinkRemoteDeviceType')

        global __nvmlDeviceSetNvLinkDeviceLowPowerThreshold
        __nvmlDeviceSetNvLinkDeviceLowPowerThreshold = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetNvLinkDeviceLowPowerThreshold')
        if __nvmlDeviceSetNvLinkDeviceLowPowerThreshold == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetNvLinkDeviceLowPowerThreshold = dlsym(handle, 'nvmlDeviceSetNvLinkDeviceLowPowerThreshold')

        global __nvmlSystemSetNvlinkBwMode
        __nvmlSystemSetNvlinkBwMode = dlsym(RTLD_DEFAULT, 'nvmlSystemSetNvlinkBwMode')
        if __nvmlSystemSetNvlinkBwMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlSystemSetNvlinkBwMode = dlsym(handle, 'nvmlSystemSetNvlinkBwMode')

        global __nvmlSystemGetNvlinkBwMode
        __nvmlSystemGetNvlinkBwMode = dlsym(RTLD_DEFAULT, 'nvmlSystemGetNvlinkBwMode')
        if __nvmlSystemGetNvlinkBwMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlSystemGetNvlinkBwMode = dlsym(handle, 'nvmlSystemGetNvlinkBwMode')

        global __nvmlDeviceGetNvlinkSupportedBwModes
        __nvmlDeviceGetNvlinkSupportedBwModes = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetNvlinkSupportedBwModes')
        if __nvmlDeviceGetNvlinkSupportedBwModes == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetNvlinkSupportedBwModes = dlsym(handle, 'nvmlDeviceGetNvlinkSupportedBwModes')

        global __nvmlDeviceGetNvlinkBwMode
        __nvmlDeviceGetNvlinkBwMode = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetNvlinkBwMode')
        if __nvmlDeviceGetNvlinkBwMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetNvlinkBwMode = dlsym(handle, 'nvmlDeviceGetNvlinkBwMode')

        global __nvmlDeviceSetNvlinkBwMode
        __nvmlDeviceSetNvlinkBwMode = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetNvlinkBwMode')
        if __nvmlDeviceSetNvlinkBwMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetNvlinkBwMode = dlsym(handle, 'nvmlDeviceSetNvlinkBwMode')

        global __nvmlEventSetCreate
        __nvmlEventSetCreate = dlsym(RTLD_DEFAULT, 'nvmlEventSetCreate')
        if __nvmlEventSetCreate == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlEventSetCreate = dlsym(handle, 'nvmlEventSetCreate')

        global __nvmlDeviceRegisterEvents
        __nvmlDeviceRegisterEvents = dlsym(RTLD_DEFAULT, 'nvmlDeviceRegisterEvents')
        if __nvmlDeviceRegisterEvents == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceRegisterEvents = dlsym(handle, 'nvmlDeviceRegisterEvents')

        global __nvmlDeviceGetSupportedEventTypes
        __nvmlDeviceGetSupportedEventTypes = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetSupportedEventTypes')
        if __nvmlDeviceGetSupportedEventTypes == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetSupportedEventTypes = dlsym(handle, 'nvmlDeviceGetSupportedEventTypes')

        global __nvmlEventSetWait_v2
        __nvmlEventSetWait_v2 = dlsym(RTLD_DEFAULT, 'nvmlEventSetWait_v2')
        if __nvmlEventSetWait_v2 == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlEventSetWait_v2 = dlsym(handle, 'nvmlEventSetWait_v2')

        global __nvmlEventSetFree
        __nvmlEventSetFree = dlsym(RTLD_DEFAULT, 'nvmlEventSetFree')
        if __nvmlEventSetFree == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlEventSetFree = dlsym(handle, 'nvmlEventSetFree')

        global __nvmlSystemEventSetCreate
        __nvmlSystemEventSetCreate = dlsym(RTLD_DEFAULT, 'nvmlSystemEventSetCreate')
        if __nvmlSystemEventSetCreate == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlSystemEventSetCreate = dlsym(handle, 'nvmlSystemEventSetCreate')

        global __nvmlSystemEventSetFree
        __nvmlSystemEventSetFree = dlsym(RTLD_DEFAULT, 'nvmlSystemEventSetFree')
        if __nvmlSystemEventSetFree == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlSystemEventSetFree = dlsym(handle, 'nvmlSystemEventSetFree')

        global __nvmlSystemRegisterEvents
        __nvmlSystemRegisterEvents = dlsym(RTLD_DEFAULT, 'nvmlSystemRegisterEvents')
        if __nvmlSystemRegisterEvents == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlSystemRegisterEvents = dlsym(handle, 'nvmlSystemRegisterEvents')

        global __nvmlSystemEventSetWait
        __nvmlSystemEventSetWait = dlsym(RTLD_DEFAULT, 'nvmlSystemEventSetWait')
        if __nvmlSystemEventSetWait == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlSystemEventSetWait = dlsym(handle, 'nvmlSystemEventSetWait')

        global __nvmlDeviceModifyDrainState
        __nvmlDeviceModifyDrainState = dlsym(RTLD_DEFAULT, 'nvmlDeviceModifyDrainState')
        if __nvmlDeviceModifyDrainState == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceModifyDrainState = dlsym(handle, 'nvmlDeviceModifyDrainState')

        global __nvmlDeviceQueryDrainState
        __nvmlDeviceQueryDrainState = dlsym(RTLD_DEFAULT, 'nvmlDeviceQueryDrainState')
        if __nvmlDeviceQueryDrainState == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceQueryDrainState = dlsym(handle, 'nvmlDeviceQueryDrainState')

        global __nvmlDeviceRemoveGpu_v2
        __nvmlDeviceRemoveGpu_v2 = dlsym(RTLD_DEFAULT, 'nvmlDeviceRemoveGpu_v2')
        if __nvmlDeviceRemoveGpu_v2 == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceRemoveGpu_v2 = dlsym(handle, 'nvmlDeviceRemoveGpu_v2')

        global __nvmlDeviceDiscoverGpus
        __nvmlDeviceDiscoverGpus = dlsym(RTLD_DEFAULT, 'nvmlDeviceDiscoverGpus')
        if __nvmlDeviceDiscoverGpus == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceDiscoverGpus = dlsym(handle, 'nvmlDeviceDiscoverGpus')

        global __nvmlDeviceGetFieldValues
        __nvmlDeviceGetFieldValues = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetFieldValues')
        if __nvmlDeviceGetFieldValues == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetFieldValues = dlsym(handle, 'nvmlDeviceGetFieldValues')

        global __nvmlDeviceClearFieldValues
        __nvmlDeviceClearFieldValues = dlsym(RTLD_DEFAULT, 'nvmlDeviceClearFieldValues')
        if __nvmlDeviceClearFieldValues == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceClearFieldValues = dlsym(handle, 'nvmlDeviceClearFieldValues')

        global __nvmlDeviceGetVirtualizationMode
        __nvmlDeviceGetVirtualizationMode = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetVirtualizationMode')
        if __nvmlDeviceGetVirtualizationMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetVirtualizationMode = dlsym(handle, 'nvmlDeviceGetVirtualizationMode')

        global __nvmlDeviceGetHostVgpuMode
        __nvmlDeviceGetHostVgpuMode = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetHostVgpuMode')
        if __nvmlDeviceGetHostVgpuMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetHostVgpuMode = dlsym(handle, 'nvmlDeviceGetHostVgpuMode')

        global __nvmlDeviceSetVirtualizationMode
        __nvmlDeviceSetVirtualizationMode = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetVirtualizationMode')
        if __nvmlDeviceSetVirtualizationMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetVirtualizationMode = dlsym(handle, 'nvmlDeviceSetVirtualizationMode')

        global __nvmlDeviceGetVgpuHeterogeneousMode
        __nvmlDeviceGetVgpuHeterogeneousMode = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetVgpuHeterogeneousMode')
        if __nvmlDeviceGetVgpuHeterogeneousMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetVgpuHeterogeneousMode = dlsym(handle, 'nvmlDeviceGetVgpuHeterogeneousMode')

        global __nvmlDeviceSetVgpuHeterogeneousMode
        __nvmlDeviceSetVgpuHeterogeneousMode = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetVgpuHeterogeneousMode')
        if __nvmlDeviceSetVgpuHeterogeneousMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetVgpuHeterogeneousMode = dlsym(handle, 'nvmlDeviceSetVgpuHeterogeneousMode')

        global __nvmlVgpuInstanceGetPlacementId
        __nvmlVgpuInstanceGetPlacementId = dlsym(RTLD_DEFAULT, 'nvmlVgpuInstanceGetPlacementId')
        if __nvmlVgpuInstanceGetPlacementId == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuInstanceGetPlacementId = dlsym(handle, 'nvmlVgpuInstanceGetPlacementId')

        global __nvmlDeviceGetVgpuTypeSupportedPlacements
        __nvmlDeviceGetVgpuTypeSupportedPlacements = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetVgpuTypeSupportedPlacements')
        if __nvmlDeviceGetVgpuTypeSupportedPlacements == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetVgpuTypeSupportedPlacements = dlsym(handle, 'nvmlDeviceGetVgpuTypeSupportedPlacements')

        global __nvmlDeviceGetVgpuTypeCreatablePlacements
        __nvmlDeviceGetVgpuTypeCreatablePlacements = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetVgpuTypeCreatablePlacements')
        if __nvmlDeviceGetVgpuTypeCreatablePlacements == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetVgpuTypeCreatablePlacements = dlsym(handle, 'nvmlDeviceGetVgpuTypeCreatablePlacements')

        global __nvmlVgpuTypeGetGspHeapSize
        __nvmlVgpuTypeGetGspHeapSize = dlsym(RTLD_DEFAULT, 'nvmlVgpuTypeGetGspHeapSize')
        if __nvmlVgpuTypeGetGspHeapSize == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuTypeGetGspHeapSize = dlsym(handle, 'nvmlVgpuTypeGetGspHeapSize')

        global __nvmlVgpuTypeGetFbReservation
        __nvmlVgpuTypeGetFbReservation = dlsym(RTLD_DEFAULT, 'nvmlVgpuTypeGetFbReservation')
        if __nvmlVgpuTypeGetFbReservation == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuTypeGetFbReservation = dlsym(handle, 'nvmlVgpuTypeGetFbReservation')

        global __nvmlVgpuInstanceGetRuntimeStateSize
        __nvmlVgpuInstanceGetRuntimeStateSize = dlsym(RTLD_DEFAULT, 'nvmlVgpuInstanceGetRuntimeStateSize')
        if __nvmlVgpuInstanceGetRuntimeStateSize == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuInstanceGetRuntimeStateSize = dlsym(handle, 'nvmlVgpuInstanceGetRuntimeStateSize')

        global __nvmlDeviceSetVgpuCapabilities
        __nvmlDeviceSetVgpuCapabilities = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetVgpuCapabilities')
        if __nvmlDeviceSetVgpuCapabilities == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetVgpuCapabilities = dlsym(handle, 'nvmlDeviceSetVgpuCapabilities')

        global __nvmlDeviceGetGridLicensableFeatures_v4
        __nvmlDeviceGetGridLicensableFeatures_v4 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetGridLicensableFeatures_v4')
        if __nvmlDeviceGetGridLicensableFeatures_v4 == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetGridLicensableFeatures_v4 = dlsym(handle, 'nvmlDeviceGetGridLicensableFeatures_v4')

        global __nvmlGetVgpuDriverCapabilities
        __nvmlGetVgpuDriverCapabilities = dlsym(RTLD_DEFAULT, 'nvmlGetVgpuDriverCapabilities')
        if __nvmlGetVgpuDriverCapabilities == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlGetVgpuDriverCapabilities = dlsym(handle, 'nvmlGetVgpuDriverCapabilities')

        global __nvmlDeviceGetVgpuCapabilities
        __nvmlDeviceGetVgpuCapabilities = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetVgpuCapabilities')
        if __nvmlDeviceGetVgpuCapabilities == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetVgpuCapabilities = dlsym(handle, 'nvmlDeviceGetVgpuCapabilities')

        global __nvmlDeviceGetSupportedVgpus
        __nvmlDeviceGetSupportedVgpus = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetSupportedVgpus')
        if __nvmlDeviceGetSupportedVgpus == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetSupportedVgpus = dlsym(handle, 'nvmlDeviceGetSupportedVgpus')

        global __nvmlDeviceGetCreatableVgpus
        __nvmlDeviceGetCreatableVgpus = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetCreatableVgpus')
        if __nvmlDeviceGetCreatableVgpus == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetCreatableVgpus = dlsym(handle, 'nvmlDeviceGetCreatableVgpus')

        global __nvmlVgpuTypeGetClass
        __nvmlVgpuTypeGetClass = dlsym(RTLD_DEFAULT, 'nvmlVgpuTypeGetClass')
        if __nvmlVgpuTypeGetClass == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuTypeGetClass = dlsym(handle, 'nvmlVgpuTypeGetClass')

        global __nvmlVgpuTypeGetName
        __nvmlVgpuTypeGetName = dlsym(RTLD_DEFAULT, 'nvmlVgpuTypeGetName')
        if __nvmlVgpuTypeGetName == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuTypeGetName = dlsym(handle, 'nvmlVgpuTypeGetName')

        global __nvmlVgpuTypeGetGpuInstanceProfileId
        __nvmlVgpuTypeGetGpuInstanceProfileId = dlsym(RTLD_DEFAULT, 'nvmlVgpuTypeGetGpuInstanceProfileId')
        if __nvmlVgpuTypeGetGpuInstanceProfileId == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuTypeGetGpuInstanceProfileId = dlsym(handle, 'nvmlVgpuTypeGetGpuInstanceProfileId')

        global __nvmlVgpuTypeGetDeviceID
        __nvmlVgpuTypeGetDeviceID = dlsym(RTLD_DEFAULT, 'nvmlVgpuTypeGetDeviceID')
        if __nvmlVgpuTypeGetDeviceID == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuTypeGetDeviceID = dlsym(handle, 'nvmlVgpuTypeGetDeviceID')

        global __nvmlVgpuTypeGetFramebufferSize
        __nvmlVgpuTypeGetFramebufferSize = dlsym(RTLD_DEFAULT, 'nvmlVgpuTypeGetFramebufferSize')
        if __nvmlVgpuTypeGetFramebufferSize == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuTypeGetFramebufferSize = dlsym(handle, 'nvmlVgpuTypeGetFramebufferSize')

        global __nvmlVgpuTypeGetNumDisplayHeads
        __nvmlVgpuTypeGetNumDisplayHeads = dlsym(RTLD_DEFAULT, 'nvmlVgpuTypeGetNumDisplayHeads')
        if __nvmlVgpuTypeGetNumDisplayHeads == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuTypeGetNumDisplayHeads = dlsym(handle, 'nvmlVgpuTypeGetNumDisplayHeads')

        global __nvmlVgpuTypeGetResolution
        __nvmlVgpuTypeGetResolution = dlsym(RTLD_DEFAULT, 'nvmlVgpuTypeGetResolution')
        if __nvmlVgpuTypeGetResolution == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuTypeGetResolution = dlsym(handle, 'nvmlVgpuTypeGetResolution')

        global __nvmlVgpuTypeGetLicense
        __nvmlVgpuTypeGetLicense = dlsym(RTLD_DEFAULT, 'nvmlVgpuTypeGetLicense')
        if __nvmlVgpuTypeGetLicense == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuTypeGetLicense = dlsym(handle, 'nvmlVgpuTypeGetLicense')

        global __nvmlVgpuTypeGetFrameRateLimit
        __nvmlVgpuTypeGetFrameRateLimit = dlsym(RTLD_DEFAULT, 'nvmlVgpuTypeGetFrameRateLimit')
        if __nvmlVgpuTypeGetFrameRateLimit == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuTypeGetFrameRateLimit = dlsym(handle, 'nvmlVgpuTypeGetFrameRateLimit')

        global __nvmlVgpuTypeGetMaxInstances
        __nvmlVgpuTypeGetMaxInstances = dlsym(RTLD_DEFAULT, 'nvmlVgpuTypeGetMaxInstances')
        if __nvmlVgpuTypeGetMaxInstances == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuTypeGetMaxInstances = dlsym(handle, 'nvmlVgpuTypeGetMaxInstances')

        global __nvmlVgpuTypeGetMaxInstancesPerVm
        __nvmlVgpuTypeGetMaxInstancesPerVm = dlsym(RTLD_DEFAULT, 'nvmlVgpuTypeGetMaxInstancesPerVm')
        if __nvmlVgpuTypeGetMaxInstancesPerVm == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuTypeGetMaxInstancesPerVm = dlsym(handle, 'nvmlVgpuTypeGetMaxInstancesPerVm')

        global __nvmlVgpuTypeGetBAR1Info
        __nvmlVgpuTypeGetBAR1Info = dlsym(RTLD_DEFAULT, 'nvmlVgpuTypeGetBAR1Info')
        if __nvmlVgpuTypeGetBAR1Info == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuTypeGetBAR1Info = dlsym(handle, 'nvmlVgpuTypeGetBAR1Info')

        global __nvmlDeviceGetActiveVgpus
        __nvmlDeviceGetActiveVgpus = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetActiveVgpus')
        if __nvmlDeviceGetActiveVgpus == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetActiveVgpus = dlsym(handle, 'nvmlDeviceGetActiveVgpus')

        global __nvmlVgpuInstanceGetVmID
        __nvmlVgpuInstanceGetVmID = dlsym(RTLD_DEFAULT, 'nvmlVgpuInstanceGetVmID')
        if __nvmlVgpuInstanceGetVmID == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuInstanceGetVmID = dlsym(handle, 'nvmlVgpuInstanceGetVmID')

        global __nvmlVgpuInstanceGetUUID
        __nvmlVgpuInstanceGetUUID = dlsym(RTLD_DEFAULT, 'nvmlVgpuInstanceGetUUID')
        if __nvmlVgpuInstanceGetUUID == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuInstanceGetUUID = dlsym(handle, 'nvmlVgpuInstanceGetUUID')

        global __nvmlVgpuInstanceGetVmDriverVersion
        __nvmlVgpuInstanceGetVmDriverVersion = dlsym(RTLD_DEFAULT, 'nvmlVgpuInstanceGetVmDriverVersion')
        if __nvmlVgpuInstanceGetVmDriverVersion == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuInstanceGetVmDriverVersion = dlsym(handle, 'nvmlVgpuInstanceGetVmDriverVersion')

        global __nvmlVgpuInstanceGetFbUsage
        __nvmlVgpuInstanceGetFbUsage = dlsym(RTLD_DEFAULT, 'nvmlVgpuInstanceGetFbUsage')
        if __nvmlVgpuInstanceGetFbUsage == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuInstanceGetFbUsage = dlsym(handle, 'nvmlVgpuInstanceGetFbUsage')

        global __nvmlVgpuInstanceGetLicenseStatus
        __nvmlVgpuInstanceGetLicenseStatus = dlsym(RTLD_DEFAULT, 'nvmlVgpuInstanceGetLicenseStatus')
        if __nvmlVgpuInstanceGetLicenseStatus == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuInstanceGetLicenseStatus = dlsym(handle, 'nvmlVgpuInstanceGetLicenseStatus')

        global __nvmlVgpuInstanceGetType
        __nvmlVgpuInstanceGetType = dlsym(RTLD_DEFAULT, 'nvmlVgpuInstanceGetType')
        if __nvmlVgpuInstanceGetType == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuInstanceGetType = dlsym(handle, 'nvmlVgpuInstanceGetType')

        global __nvmlVgpuInstanceGetFrameRateLimit
        __nvmlVgpuInstanceGetFrameRateLimit = dlsym(RTLD_DEFAULT, 'nvmlVgpuInstanceGetFrameRateLimit')
        if __nvmlVgpuInstanceGetFrameRateLimit == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuInstanceGetFrameRateLimit = dlsym(handle, 'nvmlVgpuInstanceGetFrameRateLimit')

        global __nvmlVgpuInstanceGetEccMode
        __nvmlVgpuInstanceGetEccMode = dlsym(RTLD_DEFAULT, 'nvmlVgpuInstanceGetEccMode')
        if __nvmlVgpuInstanceGetEccMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuInstanceGetEccMode = dlsym(handle, 'nvmlVgpuInstanceGetEccMode')

        global __nvmlVgpuInstanceGetEncoderCapacity
        __nvmlVgpuInstanceGetEncoderCapacity = dlsym(RTLD_DEFAULT, 'nvmlVgpuInstanceGetEncoderCapacity')
        if __nvmlVgpuInstanceGetEncoderCapacity == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuInstanceGetEncoderCapacity = dlsym(handle, 'nvmlVgpuInstanceGetEncoderCapacity')

        global __nvmlVgpuInstanceSetEncoderCapacity
        __nvmlVgpuInstanceSetEncoderCapacity = dlsym(RTLD_DEFAULT, 'nvmlVgpuInstanceSetEncoderCapacity')
        if __nvmlVgpuInstanceSetEncoderCapacity == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuInstanceSetEncoderCapacity = dlsym(handle, 'nvmlVgpuInstanceSetEncoderCapacity')

        global __nvmlVgpuInstanceGetEncoderStats
        __nvmlVgpuInstanceGetEncoderStats = dlsym(RTLD_DEFAULT, 'nvmlVgpuInstanceGetEncoderStats')
        if __nvmlVgpuInstanceGetEncoderStats == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuInstanceGetEncoderStats = dlsym(handle, 'nvmlVgpuInstanceGetEncoderStats')

        global __nvmlVgpuInstanceGetEncoderSessions
        __nvmlVgpuInstanceGetEncoderSessions = dlsym(RTLD_DEFAULT, 'nvmlVgpuInstanceGetEncoderSessions')
        if __nvmlVgpuInstanceGetEncoderSessions == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuInstanceGetEncoderSessions = dlsym(handle, 'nvmlVgpuInstanceGetEncoderSessions')

        global __nvmlVgpuInstanceGetFBCStats
        __nvmlVgpuInstanceGetFBCStats = dlsym(RTLD_DEFAULT, 'nvmlVgpuInstanceGetFBCStats')
        if __nvmlVgpuInstanceGetFBCStats == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuInstanceGetFBCStats = dlsym(handle, 'nvmlVgpuInstanceGetFBCStats')

        global __nvmlVgpuInstanceGetFBCSessions
        __nvmlVgpuInstanceGetFBCSessions = dlsym(RTLD_DEFAULT, 'nvmlVgpuInstanceGetFBCSessions')
        if __nvmlVgpuInstanceGetFBCSessions == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuInstanceGetFBCSessions = dlsym(handle, 'nvmlVgpuInstanceGetFBCSessions')

        global __nvmlVgpuInstanceGetGpuInstanceId
        __nvmlVgpuInstanceGetGpuInstanceId = dlsym(RTLD_DEFAULT, 'nvmlVgpuInstanceGetGpuInstanceId')
        if __nvmlVgpuInstanceGetGpuInstanceId == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuInstanceGetGpuInstanceId = dlsym(handle, 'nvmlVgpuInstanceGetGpuInstanceId')

        global __nvmlVgpuInstanceGetGpuPciId
        __nvmlVgpuInstanceGetGpuPciId = dlsym(RTLD_DEFAULT, 'nvmlVgpuInstanceGetGpuPciId')
        if __nvmlVgpuInstanceGetGpuPciId == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuInstanceGetGpuPciId = dlsym(handle, 'nvmlVgpuInstanceGetGpuPciId')

        global __nvmlVgpuTypeGetCapabilities
        __nvmlVgpuTypeGetCapabilities = dlsym(RTLD_DEFAULT, 'nvmlVgpuTypeGetCapabilities')
        if __nvmlVgpuTypeGetCapabilities == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuTypeGetCapabilities = dlsym(handle, 'nvmlVgpuTypeGetCapabilities')

        global __nvmlVgpuInstanceGetMdevUUID
        __nvmlVgpuInstanceGetMdevUUID = dlsym(RTLD_DEFAULT, 'nvmlVgpuInstanceGetMdevUUID')
        if __nvmlVgpuInstanceGetMdevUUID == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuInstanceGetMdevUUID = dlsym(handle, 'nvmlVgpuInstanceGetMdevUUID')

        global __nvmlGpuInstanceGetCreatableVgpus
        __nvmlGpuInstanceGetCreatableVgpus = dlsym(RTLD_DEFAULT, 'nvmlGpuInstanceGetCreatableVgpus')
        if __nvmlGpuInstanceGetCreatableVgpus == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlGpuInstanceGetCreatableVgpus = dlsym(handle, 'nvmlGpuInstanceGetCreatableVgpus')

        global __nvmlVgpuTypeGetMaxInstancesPerGpuInstance
        __nvmlVgpuTypeGetMaxInstancesPerGpuInstance = dlsym(RTLD_DEFAULT, 'nvmlVgpuTypeGetMaxInstancesPerGpuInstance')
        if __nvmlVgpuTypeGetMaxInstancesPerGpuInstance == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuTypeGetMaxInstancesPerGpuInstance = dlsym(handle, 'nvmlVgpuTypeGetMaxInstancesPerGpuInstance')

        global __nvmlGpuInstanceGetActiveVgpus
        __nvmlGpuInstanceGetActiveVgpus = dlsym(RTLD_DEFAULT, 'nvmlGpuInstanceGetActiveVgpus')
        if __nvmlGpuInstanceGetActiveVgpus == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlGpuInstanceGetActiveVgpus = dlsym(handle, 'nvmlGpuInstanceGetActiveVgpus')

        global __nvmlGpuInstanceSetVgpuSchedulerState
        __nvmlGpuInstanceSetVgpuSchedulerState = dlsym(RTLD_DEFAULT, 'nvmlGpuInstanceSetVgpuSchedulerState')
        if __nvmlGpuInstanceSetVgpuSchedulerState == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlGpuInstanceSetVgpuSchedulerState = dlsym(handle, 'nvmlGpuInstanceSetVgpuSchedulerState')

        global __nvmlGpuInstanceGetVgpuSchedulerState
        __nvmlGpuInstanceGetVgpuSchedulerState = dlsym(RTLD_DEFAULT, 'nvmlGpuInstanceGetVgpuSchedulerState')
        if __nvmlGpuInstanceGetVgpuSchedulerState == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlGpuInstanceGetVgpuSchedulerState = dlsym(handle, 'nvmlGpuInstanceGetVgpuSchedulerState')

        global __nvmlGpuInstanceGetVgpuSchedulerLog
        __nvmlGpuInstanceGetVgpuSchedulerLog = dlsym(RTLD_DEFAULT, 'nvmlGpuInstanceGetVgpuSchedulerLog')
        if __nvmlGpuInstanceGetVgpuSchedulerLog == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlGpuInstanceGetVgpuSchedulerLog = dlsym(handle, 'nvmlGpuInstanceGetVgpuSchedulerLog')

        global __nvmlGpuInstanceGetVgpuTypeCreatablePlacements
        __nvmlGpuInstanceGetVgpuTypeCreatablePlacements = dlsym(RTLD_DEFAULT, 'nvmlGpuInstanceGetVgpuTypeCreatablePlacements')
        if __nvmlGpuInstanceGetVgpuTypeCreatablePlacements == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlGpuInstanceGetVgpuTypeCreatablePlacements = dlsym(handle, 'nvmlGpuInstanceGetVgpuTypeCreatablePlacements')

        global __nvmlGpuInstanceGetVgpuHeterogeneousMode
        __nvmlGpuInstanceGetVgpuHeterogeneousMode = dlsym(RTLD_DEFAULT, 'nvmlGpuInstanceGetVgpuHeterogeneousMode')
        if __nvmlGpuInstanceGetVgpuHeterogeneousMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlGpuInstanceGetVgpuHeterogeneousMode = dlsym(handle, 'nvmlGpuInstanceGetVgpuHeterogeneousMode')

        global __nvmlGpuInstanceSetVgpuHeterogeneousMode
        __nvmlGpuInstanceSetVgpuHeterogeneousMode = dlsym(RTLD_DEFAULT, 'nvmlGpuInstanceSetVgpuHeterogeneousMode')
        if __nvmlGpuInstanceSetVgpuHeterogeneousMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlGpuInstanceSetVgpuHeterogeneousMode = dlsym(handle, 'nvmlGpuInstanceSetVgpuHeterogeneousMode')

        global __nvmlVgpuInstanceGetMetadata
        __nvmlVgpuInstanceGetMetadata = dlsym(RTLD_DEFAULT, 'nvmlVgpuInstanceGetMetadata')
        if __nvmlVgpuInstanceGetMetadata == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuInstanceGetMetadata = dlsym(handle, 'nvmlVgpuInstanceGetMetadata')

        global __nvmlDeviceGetVgpuMetadata
        __nvmlDeviceGetVgpuMetadata = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetVgpuMetadata')
        if __nvmlDeviceGetVgpuMetadata == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetVgpuMetadata = dlsym(handle, 'nvmlDeviceGetVgpuMetadata')

        global __nvmlGetVgpuCompatibility
        __nvmlGetVgpuCompatibility = dlsym(RTLD_DEFAULT, 'nvmlGetVgpuCompatibility')
        if __nvmlGetVgpuCompatibility == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlGetVgpuCompatibility = dlsym(handle, 'nvmlGetVgpuCompatibility')

        global __nvmlDeviceGetPgpuMetadataString
        __nvmlDeviceGetPgpuMetadataString = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetPgpuMetadataString')
        if __nvmlDeviceGetPgpuMetadataString == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetPgpuMetadataString = dlsym(handle, 'nvmlDeviceGetPgpuMetadataString')

        global __nvmlDeviceGetVgpuSchedulerLog
        __nvmlDeviceGetVgpuSchedulerLog = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetVgpuSchedulerLog')
        if __nvmlDeviceGetVgpuSchedulerLog == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetVgpuSchedulerLog = dlsym(handle, 'nvmlDeviceGetVgpuSchedulerLog')

        global __nvmlDeviceGetVgpuSchedulerState
        __nvmlDeviceGetVgpuSchedulerState = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetVgpuSchedulerState')
        if __nvmlDeviceGetVgpuSchedulerState == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetVgpuSchedulerState = dlsym(handle, 'nvmlDeviceGetVgpuSchedulerState')

        global __nvmlDeviceGetVgpuSchedulerCapabilities
        __nvmlDeviceGetVgpuSchedulerCapabilities = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetVgpuSchedulerCapabilities')
        if __nvmlDeviceGetVgpuSchedulerCapabilities == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetVgpuSchedulerCapabilities = dlsym(handle, 'nvmlDeviceGetVgpuSchedulerCapabilities')

        global __nvmlDeviceSetVgpuSchedulerState
        __nvmlDeviceSetVgpuSchedulerState = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetVgpuSchedulerState')
        if __nvmlDeviceSetVgpuSchedulerState == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetVgpuSchedulerState = dlsym(handle, 'nvmlDeviceSetVgpuSchedulerState')

        global __nvmlGetVgpuVersion
        __nvmlGetVgpuVersion = dlsym(RTLD_DEFAULT, 'nvmlGetVgpuVersion')
        if __nvmlGetVgpuVersion == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlGetVgpuVersion = dlsym(handle, 'nvmlGetVgpuVersion')

        global __nvmlSetVgpuVersion
        __nvmlSetVgpuVersion = dlsym(RTLD_DEFAULT, 'nvmlSetVgpuVersion')
        if __nvmlSetVgpuVersion == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlSetVgpuVersion = dlsym(handle, 'nvmlSetVgpuVersion')

        global __nvmlDeviceGetVgpuUtilization
        __nvmlDeviceGetVgpuUtilization = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetVgpuUtilization')
        if __nvmlDeviceGetVgpuUtilization == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetVgpuUtilization = dlsym(handle, 'nvmlDeviceGetVgpuUtilization')

        global __nvmlDeviceGetVgpuInstancesUtilizationInfo
        __nvmlDeviceGetVgpuInstancesUtilizationInfo = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetVgpuInstancesUtilizationInfo')
        if __nvmlDeviceGetVgpuInstancesUtilizationInfo == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetVgpuInstancesUtilizationInfo = dlsym(handle, 'nvmlDeviceGetVgpuInstancesUtilizationInfo')

        global __nvmlDeviceGetVgpuProcessUtilization
        __nvmlDeviceGetVgpuProcessUtilization = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetVgpuProcessUtilization')
        if __nvmlDeviceGetVgpuProcessUtilization == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetVgpuProcessUtilization = dlsym(handle, 'nvmlDeviceGetVgpuProcessUtilization')

        global __nvmlDeviceGetVgpuProcessesUtilizationInfo
        __nvmlDeviceGetVgpuProcessesUtilizationInfo = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetVgpuProcessesUtilizationInfo')
        if __nvmlDeviceGetVgpuProcessesUtilizationInfo == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetVgpuProcessesUtilizationInfo = dlsym(handle, 'nvmlDeviceGetVgpuProcessesUtilizationInfo')

        global __nvmlVgpuInstanceGetAccountingMode
        __nvmlVgpuInstanceGetAccountingMode = dlsym(RTLD_DEFAULT, 'nvmlVgpuInstanceGetAccountingMode')
        if __nvmlVgpuInstanceGetAccountingMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuInstanceGetAccountingMode = dlsym(handle, 'nvmlVgpuInstanceGetAccountingMode')

        global __nvmlVgpuInstanceGetAccountingPids
        __nvmlVgpuInstanceGetAccountingPids = dlsym(RTLD_DEFAULT, 'nvmlVgpuInstanceGetAccountingPids')
        if __nvmlVgpuInstanceGetAccountingPids == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuInstanceGetAccountingPids = dlsym(handle, 'nvmlVgpuInstanceGetAccountingPids')

        global __nvmlVgpuInstanceGetAccountingStats
        __nvmlVgpuInstanceGetAccountingStats = dlsym(RTLD_DEFAULT, 'nvmlVgpuInstanceGetAccountingStats')
        if __nvmlVgpuInstanceGetAccountingStats == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuInstanceGetAccountingStats = dlsym(handle, 'nvmlVgpuInstanceGetAccountingStats')

        global __nvmlVgpuInstanceClearAccountingPids
        __nvmlVgpuInstanceClearAccountingPids = dlsym(RTLD_DEFAULT, 'nvmlVgpuInstanceClearAccountingPids')
        if __nvmlVgpuInstanceClearAccountingPids == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuInstanceClearAccountingPids = dlsym(handle, 'nvmlVgpuInstanceClearAccountingPids')

        global __nvmlVgpuInstanceGetLicenseInfo_v2
        __nvmlVgpuInstanceGetLicenseInfo_v2 = dlsym(RTLD_DEFAULT, 'nvmlVgpuInstanceGetLicenseInfo_v2')
        if __nvmlVgpuInstanceGetLicenseInfo_v2 == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlVgpuInstanceGetLicenseInfo_v2 = dlsym(handle, 'nvmlVgpuInstanceGetLicenseInfo_v2')

        global __nvmlGetExcludedDeviceCount
        __nvmlGetExcludedDeviceCount = dlsym(RTLD_DEFAULT, 'nvmlGetExcludedDeviceCount')
        if __nvmlGetExcludedDeviceCount == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlGetExcludedDeviceCount = dlsym(handle, 'nvmlGetExcludedDeviceCount')

        global __nvmlGetExcludedDeviceInfoByIndex
        __nvmlGetExcludedDeviceInfoByIndex = dlsym(RTLD_DEFAULT, 'nvmlGetExcludedDeviceInfoByIndex')
        if __nvmlGetExcludedDeviceInfoByIndex == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlGetExcludedDeviceInfoByIndex = dlsym(handle, 'nvmlGetExcludedDeviceInfoByIndex')

        global __nvmlDeviceSetMigMode
        __nvmlDeviceSetMigMode = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetMigMode')
        if __nvmlDeviceSetMigMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetMigMode = dlsym(handle, 'nvmlDeviceSetMigMode')

        global __nvmlDeviceGetMigMode
        __nvmlDeviceGetMigMode = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetMigMode')
        if __nvmlDeviceGetMigMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetMigMode = dlsym(handle, 'nvmlDeviceGetMigMode')

        global __nvmlDeviceGetGpuInstanceProfileInfoV
        __nvmlDeviceGetGpuInstanceProfileInfoV = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetGpuInstanceProfileInfoV')
        if __nvmlDeviceGetGpuInstanceProfileInfoV == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetGpuInstanceProfileInfoV = dlsym(handle, 'nvmlDeviceGetGpuInstanceProfileInfoV')

        global __nvmlDeviceGetGpuInstancePossiblePlacements_v2
        __nvmlDeviceGetGpuInstancePossiblePlacements_v2 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetGpuInstancePossiblePlacements_v2')
        if __nvmlDeviceGetGpuInstancePossiblePlacements_v2 == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetGpuInstancePossiblePlacements_v2 = dlsym(handle, 'nvmlDeviceGetGpuInstancePossiblePlacements_v2')

        global __nvmlDeviceGetGpuInstanceRemainingCapacity
        __nvmlDeviceGetGpuInstanceRemainingCapacity = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetGpuInstanceRemainingCapacity')
        if __nvmlDeviceGetGpuInstanceRemainingCapacity == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetGpuInstanceRemainingCapacity = dlsym(handle, 'nvmlDeviceGetGpuInstanceRemainingCapacity')

        global __nvmlDeviceCreateGpuInstance
        __nvmlDeviceCreateGpuInstance = dlsym(RTLD_DEFAULT, 'nvmlDeviceCreateGpuInstance')
        if __nvmlDeviceCreateGpuInstance == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceCreateGpuInstance = dlsym(handle, 'nvmlDeviceCreateGpuInstance')

        global __nvmlDeviceCreateGpuInstanceWithPlacement
        __nvmlDeviceCreateGpuInstanceWithPlacement = dlsym(RTLD_DEFAULT, 'nvmlDeviceCreateGpuInstanceWithPlacement')
        if __nvmlDeviceCreateGpuInstanceWithPlacement == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceCreateGpuInstanceWithPlacement = dlsym(handle, 'nvmlDeviceCreateGpuInstanceWithPlacement')

        global __nvmlGpuInstanceDestroy
        __nvmlGpuInstanceDestroy = dlsym(RTLD_DEFAULT, 'nvmlGpuInstanceDestroy')
        if __nvmlGpuInstanceDestroy == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlGpuInstanceDestroy = dlsym(handle, 'nvmlGpuInstanceDestroy')

        global __nvmlDeviceGetGpuInstances
        __nvmlDeviceGetGpuInstances = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetGpuInstances')
        if __nvmlDeviceGetGpuInstances == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetGpuInstances = dlsym(handle, 'nvmlDeviceGetGpuInstances')

        global __nvmlDeviceGetGpuInstanceById
        __nvmlDeviceGetGpuInstanceById = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetGpuInstanceById')
        if __nvmlDeviceGetGpuInstanceById == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetGpuInstanceById = dlsym(handle, 'nvmlDeviceGetGpuInstanceById')

        global __nvmlGpuInstanceGetInfo
        __nvmlGpuInstanceGetInfo = dlsym(RTLD_DEFAULT, 'nvmlGpuInstanceGetInfo')
        if __nvmlGpuInstanceGetInfo == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlGpuInstanceGetInfo = dlsym(handle, 'nvmlGpuInstanceGetInfo')

        global __nvmlGpuInstanceGetComputeInstanceProfileInfoV
        __nvmlGpuInstanceGetComputeInstanceProfileInfoV = dlsym(RTLD_DEFAULT, 'nvmlGpuInstanceGetComputeInstanceProfileInfoV')
        if __nvmlGpuInstanceGetComputeInstanceProfileInfoV == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlGpuInstanceGetComputeInstanceProfileInfoV = dlsym(handle, 'nvmlGpuInstanceGetComputeInstanceProfileInfoV')

        global __nvmlGpuInstanceGetComputeInstanceRemainingCapacity
        __nvmlGpuInstanceGetComputeInstanceRemainingCapacity = dlsym(RTLD_DEFAULT, 'nvmlGpuInstanceGetComputeInstanceRemainingCapacity')
        if __nvmlGpuInstanceGetComputeInstanceRemainingCapacity == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlGpuInstanceGetComputeInstanceRemainingCapacity = dlsym(handle, 'nvmlGpuInstanceGetComputeInstanceRemainingCapacity')

        global __nvmlGpuInstanceGetComputeInstancePossiblePlacements
        __nvmlGpuInstanceGetComputeInstancePossiblePlacements = dlsym(RTLD_DEFAULT, 'nvmlGpuInstanceGetComputeInstancePossiblePlacements')
        if __nvmlGpuInstanceGetComputeInstancePossiblePlacements == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlGpuInstanceGetComputeInstancePossiblePlacements = dlsym(handle, 'nvmlGpuInstanceGetComputeInstancePossiblePlacements')

        global __nvmlGpuInstanceCreateComputeInstance
        __nvmlGpuInstanceCreateComputeInstance = dlsym(RTLD_DEFAULT, 'nvmlGpuInstanceCreateComputeInstance')
        if __nvmlGpuInstanceCreateComputeInstance == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlGpuInstanceCreateComputeInstance = dlsym(handle, 'nvmlGpuInstanceCreateComputeInstance')

        global __nvmlGpuInstanceCreateComputeInstanceWithPlacement
        __nvmlGpuInstanceCreateComputeInstanceWithPlacement = dlsym(RTLD_DEFAULT, 'nvmlGpuInstanceCreateComputeInstanceWithPlacement')
        if __nvmlGpuInstanceCreateComputeInstanceWithPlacement == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlGpuInstanceCreateComputeInstanceWithPlacement = dlsym(handle, 'nvmlGpuInstanceCreateComputeInstanceWithPlacement')

        global __nvmlComputeInstanceDestroy
        __nvmlComputeInstanceDestroy = dlsym(RTLD_DEFAULT, 'nvmlComputeInstanceDestroy')
        if __nvmlComputeInstanceDestroy == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlComputeInstanceDestroy = dlsym(handle, 'nvmlComputeInstanceDestroy')

        global __nvmlGpuInstanceGetComputeInstances
        __nvmlGpuInstanceGetComputeInstances = dlsym(RTLD_DEFAULT, 'nvmlGpuInstanceGetComputeInstances')
        if __nvmlGpuInstanceGetComputeInstances == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlGpuInstanceGetComputeInstances = dlsym(handle, 'nvmlGpuInstanceGetComputeInstances')

        global __nvmlGpuInstanceGetComputeInstanceById
        __nvmlGpuInstanceGetComputeInstanceById = dlsym(RTLD_DEFAULT, 'nvmlGpuInstanceGetComputeInstanceById')
        if __nvmlGpuInstanceGetComputeInstanceById == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlGpuInstanceGetComputeInstanceById = dlsym(handle, 'nvmlGpuInstanceGetComputeInstanceById')

        global __nvmlComputeInstanceGetInfo_v2
        __nvmlComputeInstanceGetInfo_v2 = dlsym(RTLD_DEFAULT, 'nvmlComputeInstanceGetInfo_v2')
        if __nvmlComputeInstanceGetInfo_v2 == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlComputeInstanceGetInfo_v2 = dlsym(handle, 'nvmlComputeInstanceGetInfo_v2')

        global __nvmlDeviceIsMigDeviceHandle
        __nvmlDeviceIsMigDeviceHandle = dlsym(RTLD_DEFAULT, 'nvmlDeviceIsMigDeviceHandle')
        if __nvmlDeviceIsMigDeviceHandle == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceIsMigDeviceHandle = dlsym(handle, 'nvmlDeviceIsMigDeviceHandle')

        global __nvmlDeviceGetGpuInstanceId
        __nvmlDeviceGetGpuInstanceId = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetGpuInstanceId')
        if __nvmlDeviceGetGpuInstanceId == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetGpuInstanceId = dlsym(handle, 'nvmlDeviceGetGpuInstanceId')

        global __nvmlDeviceGetComputeInstanceId
        __nvmlDeviceGetComputeInstanceId = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetComputeInstanceId')
        if __nvmlDeviceGetComputeInstanceId == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetComputeInstanceId = dlsym(handle, 'nvmlDeviceGetComputeInstanceId')

        global __nvmlDeviceGetMaxMigDeviceCount
        __nvmlDeviceGetMaxMigDeviceCount = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetMaxMigDeviceCount')
        if __nvmlDeviceGetMaxMigDeviceCount == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetMaxMigDeviceCount = dlsym(handle, 'nvmlDeviceGetMaxMigDeviceCount')

        global __nvmlDeviceGetMigDeviceHandleByIndex
        __nvmlDeviceGetMigDeviceHandleByIndex = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetMigDeviceHandleByIndex')
        if __nvmlDeviceGetMigDeviceHandleByIndex == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetMigDeviceHandleByIndex = dlsym(handle, 'nvmlDeviceGetMigDeviceHandleByIndex')

        global __nvmlDeviceGetDeviceHandleFromMigDeviceHandle
        __nvmlDeviceGetDeviceHandleFromMigDeviceHandle = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetDeviceHandleFromMigDeviceHandle')
        if __nvmlDeviceGetDeviceHandleFromMigDeviceHandle == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetDeviceHandleFromMigDeviceHandle = dlsym(handle, 'nvmlDeviceGetDeviceHandleFromMigDeviceHandle')

        global __nvmlGpmSampleGet
        __nvmlGpmSampleGet = dlsym(RTLD_DEFAULT, 'nvmlGpmSampleGet')
        if __nvmlGpmSampleGet == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlGpmSampleGet = dlsym(handle, 'nvmlGpmSampleGet')

        global __nvmlGpmMigSampleGet
        __nvmlGpmMigSampleGet = dlsym(RTLD_DEFAULT, 'nvmlGpmMigSampleGet')
        if __nvmlGpmMigSampleGet == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlGpmMigSampleGet = dlsym(handle, 'nvmlGpmMigSampleGet')

        global __nvmlGpmQueryDeviceSupport
        __nvmlGpmQueryDeviceSupport = dlsym(RTLD_DEFAULT, 'nvmlGpmQueryDeviceSupport')
        if __nvmlGpmQueryDeviceSupport == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlGpmQueryDeviceSupport = dlsym(handle, 'nvmlGpmQueryDeviceSupport')

        global __nvmlGpmQueryIfStreamingEnabled
        __nvmlGpmQueryIfStreamingEnabled = dlsym(RTLD_DEFAULT, 'nvmlGpmQueryIfStreamingEnabled')
        if __nvmlGpmQueryIfStreamingEnabled == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlGpmQueryIfStreamingEnabled = dlsym(handle, 'nvmlGpmQueryIfStreamingEnabled')

        global __nvmlGpmSetStreamingEnabled
        __nvmlGpmSetStreamingEnabled = dlsym(RTLD_DEFAULT, 'nvmlGpmSetStreamingEnabled')
        if __nvmlGpmSetStreamingEnabled == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlGpmSetStreamingEnabled = dlsym(handle, 'nvmlGpmSetStreamingEnabled')

        global __nvmlDeviceGetCapabilities
        __nvmlDeviceGetCapabilities = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetCapabilities')
        if __nvmlDeviceGetCapabilities == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetCapabilities = dlsym(handle, 'nvmlDeviceGetCapabilities')

        global __nvmlDeviceWorkloadPowerProfileClearRequestedProfiles
        __nvmlDeviceWorkloadPowerProfileClearRequestedProfiles = dlsym(RTLD_DEFAULT, 'nvmlDeviceWorkloadPowerProfileClearRequestedProfiles')
        if __nvmlDeviceWorkloadPowerProfileClearRequestedProfiles == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceWorkloadPowerProfileClearRequestedProfiles = dlsym(handle, 'nvmlDeviceWorkloadPowerProfileClearRequestedProfiles')

        global __nvmlDevicePowerSmoothingActivatePresetProfile
        __nvmlDevicePowerSmoothingActivatePresetProfile = dlsym(RTLD_DEFAULT, 'nvmlDevicePowerSmoothingActivatePresetProfile')
        if __nvmlDevicePowerSmoothingActivatePresetProfile == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDevicePowerSmoothingActivatePresetProfile = dlsym(handle, 'nvmlDevicePowerSmoothingActivatePresetProfile')

        global __nvmlDevicePowerSmoothingUpdatePresetProfileParam
        __nvmlDevicePowerSmoothingUpdatePresetProfileParam = dlsym(RTLD_DEFAULT, 'nvmlDevicePowerSmoothingUpdatePresetProfileParam')
        if __nvmlDevicePowerSmoothingUpdatePresetProfileParam == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDevicePowerSmoothingUpdatePresetProfileParam = dlsym(handle, 'nvmlDevicePowerSmoothingUpdatePresetProfileParam')

        global __nvmlDevicePowerSmoothingSetState
        __nvmlDevicePowerSmoothingSetState = dlsym(RTLD_DEFAULT, 'nvmlDevicePowerSmoothingSetState')
        if __nvmlDevicePowerSmoothingSetState == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDevicePowerSmoothingSetState = dlsym(handle, 'nvmlDevicePowerSmoothingSetState')

        global __nvmlDeviceGetAddressingMode
        __nvmlDeviceGetAddressingMode = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetAddressingMode')
        if __nvmlDeviceGetAddressingMode == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetAddressingMode = dlsym(handle, 'nvmlDeviceGetAddressingMode')

        global __nvmlDeviceGetRepairStatus
        __nvmlDeviceGetRepairStatus = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetRepairStatus')
        if __nvmlDeviceGetRepairStatus == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetRepairStatus = dlsym(handle, 'nvmlDeviceGetRepairStatus')

        global __nvmlDeviceGetPowerMizerMode_v1
        __nvmlDeviceGetPowerMizerMode_v1 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetPowerMizerMode_v1')
        if __nvmlDeviceGetPowerMizerMode_v1 == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetPowerMizerMode_v1 = dlsym(handle, 'nvmlDeviceGetPowerMizerMode_v1')

        global __nvmlDeviceSetPowerMizerMode_v1
        __nvmlDeviceSetPowerMizerMode_v1 = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetPowerMizerMode_v1')
        if __nvmlDeviceSetPowerMizerMode_v1 == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetPowerMizerMode_v1 = dlsym(handle, 'nvmlDeviceSetPowerMizerMode_v1')

        global __nvmlDeviceGetPdi
        __nvmlDeviceGetPdi = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetPdi')
        if __nvmlDeviceGetPdi == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetPdi = dlsym(handle, 'nvmlDeviceGetPdi')

        global __nvmlDeviceSetHostname_v1
        __nvmlDeviceSetHostname_v1 = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetHostname_v1')
        if __nvmlDeviceSetHostname_v1 == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceSetHostname_v1 = dlsym(handle, 'nvmlDeviceSetHostname_v1')

        global __nvmlDeviceGetHostname_v1
        __nvmlDeviceGetHostname_v1 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetHostname_v1')
        if __nvmlDeviceGetHostname_v1 == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetHostname_v1 = dlsym(handle, 'nvmlDeviceGetHostname_v1')

        global __nvmlDeviceGetNvLinkInfo
        __nvmlDeviceGetNvLinkInfo = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetNvLinkInfo')
        if __nvmlDeviceGetNvLinkInfo == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetNvLinkInfo = dlsym(handle, 'nvmlDeviceGetNvLinkInfo')

        global __nvmlDeviceReadWritePRM_v1
        __nvmlDeviceReadWritePRM_v1 = dlsym(RTLD_DEFAULT, 'nvmlDeviceReadWritePRM_v1')
        if __nvmlDeviceReadWritePRM_v1 == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceReadWritePRM_v1 = dlsym(handle, 'nvmlDeviceReadWritePRM_v1')

        global __nvmlDeviceGetGpuInstanceProfileInfoByIdV
        __nvmlDeviceGetGpuInstanceProfileInfoByIdV = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetGpuInstanceProfileInfoByIdV')
        if __nvmlDeviceGetGpuInstanceProfileInfoByIdV == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetGpuInstanceProfileInfoByIdV = dlsym(handle, 'nvmlDeviceGetGpuInstanceProfileInfoByIdV')

        global __nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts
        __nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts')
        if __nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts == NULL:
            if handle == NULL:
                handle = load_library()
            __nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts = dlsym(handle, 'nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts')

        __py_nvml_init = True
        return 0


cdef inline int _check_or_init_nvml() except -1 nogil:
    if __py_nvml_init:
        return 0

    return _init_nvml()


cdef dict func_ptrs = None


cpdef dict _inspect_function_pointers():
    global func_ptrs
    if func_ptrs is not None:
        return func_ptrs

    _check_or_init_nvml()
    cdef dict data = {}

    global __nvmlInit_v2
    data["__nvmlInit_v2"] = <intptr_t>__nvmlInit_v2

    global __nvmlInitWithFlags
    data["__nvmlInitWithFlags"] = <intptr_t>__nvmlInitWithFlags

    global __nvmlShutdown
    data["__nvmlShutdown"] = <intptr_t>__nvmlShutdown

    global __nvmlErrorString
    data["__nvmlErrorString"] = <intptr_t>__nvmlErrorString

    global __nvmlSystemGetDriverVersion
    data["__nvmlSystemGetDriverVersion"] = <intptr_t>__nvmlSystemGetDriverVersion

    global __nvmlSystemGetNVMLVersion
    data["__nvmlSystemGetNVMLVersion"] = <intptr_t>__nvmlSystemGetNVMLVersion

    global __nvmlSystemGetCudaDriverVersion
    data["__nvmlSystemGetCudaDriverVersion"] = <intptr_t>__nvmlSystemGetCudaDriverVersion

    global __nvmlSystemGetCudaDriverVersion_v2
    data["__nvmlSystemGetCudaDriverVersion_v2"] = <intptr_t>__nvmlSystemGetCudaDriverVersion_v2

    global __nvmlSystemGetProcessName
    data["__nvmlSystemGetProcessName"] = <intptr_t>__nvmlSystemGetProcessName

    global __nvmlSystemGetHicVersion
    data["__nvmlSystemGetHicVersion"] = <intptr_t>__nvmlSystemGetHicVersion

    global __nvmlSystemGetTopologyGpuSet
    data["__nvmlSystemGetTopologyGpuSet"] = <intptr_t>__nvmlSystemGetTopologyGpuSet

    global __nvmlSystemGetDriverBranch
    data["__nvmlSystemGetDriverBranch"] = <intptr_t>__nvmlSystemGetDriverBranch

    global __nvmlUnitGetCount
    data["__nvmlUnitGetCount"] = <intptr_t>__nvmlUnitGetCount

    global __nvmlUnitGetHandleByIndex
    data["__nvmlUnitGetHandleByIndex"] = <intptr_t>__nvmlUnitGetHandleByIndex

    global __nvmlUnitGetUnitInfo
    data["__nvmlUnitGetUnitInfo"] = <intptr_t>__nvmlUnitGetUnitInfo

    global __nvmlUnitGetLedState
    data["__nvmlUnitGetLedState"] = <intptr_t>__nvmlUnitGetLedState

    global __nvmlUnitGetPsuInfo
    data["__nvmlUnitGetPsuInfo"] = <intptr_t>__nvmlUnitGetPsuInfo

    global __nvmlUnitGetTemperature
    data["__nvmlUnitGetTemperature"] = <intptr_t>__nvmlUnitGetTemperature

    global __nvmlUnitGetFanSpeedInfo
    data["__nvmlUnitGetFanSpeedInfo"] = <intptr_t>__nvmlUnitGetFanSpeedInfo

    global __nvmlUnitGetDevices
    data["__nvmlUnitGetDevices"] = <intptr_t>__nvmlUnitGetDevices

    global __nvmlDeviceGetCount_v2
    data["__nvmlDeviceGetCount_v2"] = <intptr_t>__nvmlDeviceGetCount_v2

    global __nvmlDeviceGetAttributes_v2
    data["__nvmlDeviceGetAttributes_v2"] = <intptr_t>__nvmlDeviceGetAttributes_v2

    global __nvmlDeviceGetHandleByIndex_v2
    data["__nvmlDeviceGetHandleByIndex_v2"] = <intptr_t>__nvmlDeviceGetHandleByIndex_v2

    global __nvmlDeviceGetHandleBySerial
    data["__nvmlDeviceGetHandleBySerial"] = <intptr_t>__nvmlDeviceGetHandleBySerial

    global __nvmlDeviceGetHandleByUUID
    data["__nvmlDeviceGetHandleByUUID"] = <intptr_t>__nvmlDeviceGetHandleByUUID

    global __nvmlDeviceGetHandleByUUIDV
    data["__nvmlDeviceGetHandleByUUIDV"] = <intptr_t>__nvmlDeviceGetHandleByUUIDV

    global __nvmlDeviceGetHandleByPciBusId_v2
    data["__nvmlDeviceGetHandleByPciBusId_v2"] = <intptr_t>__nvmlDeviceGetHandleByPciBusId_v2

    global __nvmlDeviceGetName
    data["__nvmlDeviceGetName"] = <intptr_t>__nvmlDeviceGetName

    global __nvmlDeviceGetBrand
    data["__nvmlDeviceGetBrand"] = <intptr_t>__nvmlDeviceGetBrand

    global __nvmlDeviceGetIndex
    data["__nvmlDeviceGetIndex"] = <intptr_t>__nvmlDeviceGetIndex

    global __nvmlDeviceGetSerial
    data["__nvmlDeviceGetSerial"] = <intptr_t>__nvmlDeviceGetSerial

    global __nvmlDeviceGetModuleId
    data["__nvmlDeviceGetModuleId"] = <intptr_t>__nvmlDeviceGetModuleId

    global __nvmlDeviceGetC2cModeInfoV
    data["__nvmlDeviceGetC2cModeInfoV"] = <intptr_t>__nvmlDeviceGetC2cModeInfoV

    global __nvmlDeviceGetMemoryAffinity
    data["__nvmlDeviceGetMemoryAffinity"] = <intptr_t>__nvmlDeviceGetMemoryAffinity

    global __nvmlDeviceGetCpuAffinityWithinScope
    data["__nvmlDeviceGetCpuAffinityWithinScope"] = <intptr_t>__nvmlDeviceGetCpuAffinityWithinScope

    global __nvmlDeviceGetCpuAffinity
    data["__nvmlDeviceGetCpuAffinity"] = <intptr_t>__nvmlDeviceGetCpuAffinity

    global __nvmlDeviceSetCpuAffinity
    data["__nvmlDeviceSetCpuAffinity"] = <intptr_t>__nvmlDeviceSetCpuAffinity

    global __nvmlDeviceClearCpuAffinity
    data["__nvmlDeviceClearCpuAffinity"] = <intptr_t>__nvmlDeviceClearCpuAffinity

    global __nvmlDeviceGetNumaNodeId
    data["__nvmlDeviceGetNumaNodeId"] = <intptr_t>__nvmlDeviceGetNumaNodeId

    global __nvmlDeviceGetTopologyCommonAncestor
    data["__nvmlDeviceGetTopologyCommonAncestor"] = <intptr_t>__nvmlDeviceGetTopologyCommonAncestor

    global __nvmlDeviceGetTopologyNearestGpus
    data["__nvmlDeviceGetTopologyNearestGpus"] = <intptr_t>__nvmlDeviceGetTopologyNearestGpus

    global __nvmlDeviceGetP2PStatus
    data["__nvmlDeviceGetP2PStatus"] = <intptr_t>__nvmlDeviceGetP2PStatus

    global __nvmlDeviceGetUUID
    data["__nvmlDeviceGetUUID"] = <intptr_t>__nvmlDeviceGetUUID

    global __nvmlDeviceGetMinorNumber
    data["__nvmlDeviceGetMinorNumber"] = <intptr_t>__nvmlDeviceGetMinorNumber

    global __nvmlDeviceGetBoardPartNumber
    data["__nvmlDeviceGetBoardPartNumber"] = <intptr_t>__nvmlDeviceGetBoardPartNumber

    global __nvmlDeviceGetInforomVersion
    data["__nvmlDeviceGetInforomVersion"] = <intptr_t>__nvmlDeviceGetInforomVersion

    global __nvmlDeviceGetInforomImageVersion
    data["__nvmlDeviceGetInforomImageVersion"] = <intptr_t>__nvmlDeviceGetInforomImageVersion

    global __nvmlDeviceGetInforomConfigurationChecksum
    data["__nvmlDeviceGetInforomConfigurationChecksum"] = <intptr_t>__nvmlDeviceGetInforomConfigurationChecksum

    global __nvmlDeviceValidateInforom
    data["__nvmlDeviceValidateInforom"] = <intptr_t>__nvmlDeviceValidateInforom

    global __nvmlDeviceGetLastBBXFlushTime
    data["__nvmlDeviceGetLastBBXFlushTime"] = <intptr_t>__nvmlDeviceGetLastBBXFlushTime

    global __nvmlDeviceGetDisplayMode
    data["__nvmlDeviceGetDisplayMode"] = <intptr_t>__nvmlDeviceGetDisplayMode

    global __nvmlDeviceGetDisplayActive
    data["__nvmlDeviceGetDisplayActive"] = <intptr_t>__nvmlDeviceGetDisplayActive

    global __nvmlDeviceGetPersistenceMode
    data["__nvmlDeviceGetPersistenceMode"] = <intptr_t>__nvmlDeviceGetPersistenceMode

    global __nvmlDeviceGetPciInfoExt
    data["__nvmlDeviceGetPciInfoExt"] = <intptr_t>__nvmlDeviceGetPciInfoExt

    global __nvmlDeviceGetPciInfo_v3
    data["__nvmlDeviceGetPciInfo_v3"] = <intptr_t>__nvmlDeviceGetPciInfo_v3

    global __nvmlDeviceGetMaxPcieLinkGeneration
    data["__nvmlDeviceGetMaxPcieLinkGeneration"] = <intptr_t>__nvmlDeviceGetMaxPcieLinkGeneration

    global __nvmlDeviceGetGpuMaxPcieLinkGeneration
    data["__nvmlDeviceGetGpuMaxPcieLinkGeneration"] = <intptr_t>__nvmlDeviceGetGpuMaxPcieLinkGeneration

    global __nvmlDeviceGetMaxPcieLinkWidth
    data["__nvmlDeviceGetMaxPcieLinkWidth"] = <intptr_t>__nvmlDeviceGetMaxPcieLinkWidth

    global __nvmlDeviceGetCurrPcieLinkGeneration
    data["__nvmlDeviceGetCurrPcieLinkGeneration"] = <intptr_t>__nvmlDeviceGetCurrPcieLinkGeneration

    global __nvmlDeviceGetCurrPcieLinkWidth
    data["__nvmlDeviceGetCurrPcieLinkWidth"] = <intptr_t>__nvmlDeviceGetCurrPcieLinkWidth

    global __nvmlDeviceGetPcieThroughput
    data["__nvmlDeviceGetPcieThroughput"] = <intptr_t>__nvmlDeviceGetPcieThroughput

    global __nvmlDeviceGetPcieReplayCounter
    data["__nvmlDeviceGetPcieReplayCounter"] = <intptr_t>__nvmlDeviceGetPcieReplayCounter

    global __nvmlDeviceGetClockInfo
    data["__nvmlDeviceGetClockInfo"] = <intptr_t>__nvmlDeviceGetClockInfo

    global __nvmlDeviceGetMaxClockInfo
    data["__nvmlDeviceGetMaxClockInfo"] = <intptr_t>__nvmlDeviceGetMaxClockInfo

    global __nvmlDeviceGetGpcClkVfOffset
    data["__nvmlDeviceGetGpcClkVfOffset"] = <intptr_t>__nvmlDeviceGetGpcClkVfOffset

    global __nvmlDeviceGetClock
    data["__nvmlDeviceGetClock"] = <intptr_t>__nvmlDeviceGetClock

    global __nvmlDeviceGetMaxCustomerBoostClock
    data["__nvmlDeviceGetMaxCustomerBoostClock"] = <intptr_t>__nvmlDeviceGetMaxCustomerBoostClock

    global __nvmlDeviceGetSupportedMemoryClocks
    data["__nvmlDeviceGetSupportedMemoryClocks"] = <intptr_t>__nvmlDeviceGetSupportedMemoryClocks

    global __nvmlDeviceGetSupportedGraphicsClocks
    data["__nvmlDeviceGetSupportedGraphicsClocks"] = <intptr_t>__nvmlDeviceGetSupportedGraphicsClocks

    global __nvmlDeviceGetAutoBoostedClocksEnabled
    data["__nvmlDeviceGetAutoBoostedClocksEnabled"] = <intptr_t>__nvmlDeviceGetAutoBoostedClocksEnabled

    global __nvmlDeviceGetFanSpeed
    data["__nvmlDeviceGetFanSpeed"] = <intptr_t>__nvmlDeviceGetFanSpeed

    global __nvmlDeviceGetFanSpeed_v2
    data["__nvmlDeviceGetFanSpeed_v2"] = <intptr_t>__nvmlDeviceGetFanSpeed_v2

    global __nvmlDeviceGetFanSpeedRPM
    data["__nvmlDeviceGetFanSpeedRPM"] = <intptr_t>__nvmlDeviceGetFanSpeedRPM

    global __nvmlDeviceGetTargetFanSpeed
    data["__nvmlDeviceGetTargetFanSpeed"] = <intptr_t>__nvmlDeviceGetTargetFanSpeed

    global __nvmlDeviceGetMinMaxFanSpeed
    data["__nvmlDeviceGetMinMaxFanSpeed"] = <intptr_t>__nvmlDeviceGetMinMaxFanSpeed

    global __nvmlDeviceGetFanControlPolicy_v2
    data["__nvmlDeviceGetFanControlPolicy_v2"] = <intptr_t>__nvmlDeviceGetFanControlPolicy_v2

    global __nvmlDeviceGetNumFans
    data["__nvmlDeviceGetNumFans"] = <intptr_t>__nvmlDeviceGetNumFans

    global __nvmlDeviceGetCoolerInfo
    data["__nvmlDeviceGetCoolerInfo"] = <intptr_t>__nvmlDeviceGetCoolerInfo

    global __nvmlDeviceGetTemperatureV
    data["__nvmlDeviceGetTemperatureV"] = <intptr_t>__nvmlDeviceGetTemperatureV

    global __nvmlDeviceGetTemperatureThreshold
    data["__nvmlDeviceGetTemperatureThreshold"] = <intptr_t>__nvmlDeviceGetTemperatureThreshold

    global __nvmlDeviceGetMarginTemperature
    data["__nvmlDeviceGetMarginTemperature"] = <intptr_t>__nvmlDeviceGetMarginTemperature

    global __nvmlDeviceGetThermalSettings
    data["__nvmlDeviceGetThermalSettings"] = <intptr_t>__nvmlDeviceGetThermalSettings

    global __nvmlDeviceGetPerformanceState
    data["__nvmlDeviceGetPerformanceState"] = <intptr_t>__nvmlDeviceGetPerformanceState

    global __nvmlDeviceGetCurrentClocksEventReasons
    data["__nvmlDeviceGetCurrentClocksEventReasons"] = <intptr_t>__nvmlDeviceGetCurrentClocksEventReasons

    global __nvmlDeviceGetSupportedClocksEventReasons
    data["__nvmlDeviceGetSupportedClocksEventReasons"] = <intptr_t>__nvmlDeviceGetSupportedClocksEventReasons

    global __nvmlDeviceGetPowerState
    data["__nvmlDeviceGetPowerState"] = <intptr_t>__nvmlDeviceGetPowerState

    global __nvmlDeviceGetDynamicPstatesInfo
    data["__nvmlDeviceGetDynamicPstatesInfo"] = <intptr_t>__nvmlDeviceGetDynamicPstatesInfo

    global __nvmlDeviceGetMemClkVfOffset
    data["__nvmlDeviceGetMemClkVfOffset"] = <intptr_t>__nvmlDeviceGetMemClkVfOffset

    global __nvmlDeviceGetMinMaxClockOfPState
    data["__nvmlDeviceGetMinMaxClockOfPState"] = <intptr_t>__nvmlDeviceGetMinMaxClockOfPState

    global __nvmlDeviceGetSupportedPerformanceStates
    data["__nvmlDeviceGetSupportedPerformanceStates"] = <intptr_t>__nvmlDeviceGetSupportedPerformanceStates

    global __nvmlDeviceGetGpcClkMinMaxVfOffset
    data["__nvmlDeviceGetGpcClkMinMaxVfOffset"] = <intptr_t>__nvmlDeviceGetGpcClkMinMaxVfOffset

    global __nvmlDeviceGetMemClkMinMaxVfOffset
    data["__nvmlDeviceGetMemClkMinMaxVfOffset"] = <intptr_t>__nvmlDeviceGetMemClkMinMaxVfOffset

    global __nvmlDeviceGetClockOffsets
    data["__nvmlDeviceGetClockOffsets"] = <intptr_t>__nvmlDeviceGetClockOffsets

    global __nvmlDeviceSetClockOffsets
    data["__nvmlDeviceSetClockOffsets"] = <intptr_t>__nvmlDeviceSetClockOffsets

    global __nvmlDeviceGetPerformanceModes
    data["__nvmlDeviceGetPerformanceModes"] = <intptr_t>__nvmlDeviceGetPerformanceModes

    global __nvmlDeviceGetCurrentClockFreqs
    data["__nvmlDeviceGetCurrentClockFreqs"] = <intptr_t>__nvmlDeviceGetCurrentClockFreqs

    global __nvmlDeviceGetPowerManagementLimit
    data["__nvmlDeviceGetPowerManagementLimit"] = <intptr_t>__nvmlDeviceGetPowerManagementLimit

    global __nvmlDeviceGetPowerManagementLimitConstraints
    data["__nvmlDeviceGetPowerManagementLimitConstraints"] = <intptr_t>__nvmlDeviceGetPowerManagementLimitConstraints

    global __nvmlDeviceGetPowerManagementDefaultLimit
    data["__nvmlDeviceGetPowerManagementDefaultLimit"] = <intptr_t>__nvmlDeviceGetPowerManagementDefaultLimit

    global __nvmlDeviceGetPowerUsage
    data["__nvmlDeviceGetPowerUsage"] = <intptr_t>__nvmlDeviceGetPowerUsage

    global __nvmlDeviceGetTotalEnergyConsumption
    data["__nvmlDeviceGetTotalEnergyConsumption"] = <intptr_t>__nvmlDeviceGetTotalEnergyConsumption

    global __nvmlDeviceGetEnforcedPowerLimit
    data["__nvmlDeviceGetEnforcedPowerLimit"] = <intptr_t>__nvmlDeviceGetEnforcedPowerLimit

    global __nvmlDeviceGetGpuOperationMode
    data["__nvmlDeviceGetGpuOperationMode"] = <intptr_t>__nvmlDeviceGetGpuOperationMode

    global __nvmlDeviceGetMemoryInfo_v2
    data["__nvmlDeviceGetMemoryInfo_v2"] = <intptr_t>__nvmlDeviceGetMemoryInfo_v2

    global __nvmlDeviceGetComputeMode
    data["__nvmlDeviceGetComputeMode"] = <intptr_t>__nvmlDeviceGetComputeMode

    global __nvmlDeviceGetCudaComputeCapability
    data["__nvmlDeviceGetCudaComputeCapability"] = <intptr_t>__nvmlDeviceGetCudaComputeCapability

    global __nvmlDeviceGetDramEncryptionMode
    data["__nvmlDeviceGetDramEncryptionMode"] = <intptr_t>__nvmlDeviceGetDramEncryptionMode

    global __nvmlDeviceSetDramEncryptionMode
    data["__nvmlDeviceSetDramEncryptionMode"] = <intptr_t>__nvmlDeviceSetDramEncryptionMode

    global __nvmlDeviceGetEccMode
    data["__nvmlDeviceGetEccMode"] = <intptr_t>__nvmlDeviceGetEccMode

    global __nvmlDeviceGetDefaultEccMode
    data["__nvmlDeviceGetDefaultEccMode"] = <intptr_t>__nvmlDeviceGetDefaultEccMode

    global __nvmlDeviceGetBoardId
    data["__nvmlDeviceGetBoardId"] = <intptr_t>__nvmlDeviceGetBoardId

    global __nvmlDeviceGetMultiGpuBoard
    data["__nvmlDeviceGetMultiGpuBoard"] = <intptr_t>__nvmlDeviceGetMultiGpuBoard

    global __nvmlDeviceGetTotalEccErrors
    data["__nvmlDeviceGetTotalEccErrors"] = <intptr_t>__nvmlDeviceGetTotalEccErrors

    global __nvmlDeviceGetMemoryErrorCounter
    data["__nvmlDeviceGetMemoryErrorCounter"] = <intptr_t>__nvmlDeviceGetMemoryErrorCounter

    global __nvmlDeviceGetUtilizationRates
    data["__nvmlDeviceGetUtilizationRates"] = <intptr_t>__nvmlDeviceGetUtilizationRates

    global __nvmlDeviceGetEncoderUtilization
    data["__nvmlDeviceGetEncoderUtilization"] = <intptr_t>__nvmlDeviceGetEncoderUtilization

    global __nvmlDeviceGetEncoderCapacity
    data["__nvmlDeviceGetEncoderCapacity"] = <intptr_t>__nvmlDeviceGetEncoderCapacity

    global __nvmlDeviceGetEncoderStats
    data["__nvmlDeviceGetEncoderStats"] = <intptr_t>__nvmlDeviceGetEncoderStats

    global __nvmlDeviceGetEncoderSessions
    data["__nvmlDeviceGetEncoderSessions"] = <intptr_t>__nvmlDeviceGetEncoderSessions

    global __nvmlDeviceGetDecoderUtilization
    data["__nvmlDeviceGetDecoderUtilization"] = <intptr_t>__nvmlDeviceGetDecoderUtilization

    global __nvmlDeviceGetJpgUtilization
    data["__nvmlDeviceGetJpgUtilization"] = <intptr_t>__nvmlDeviceGetJpgUtilization

    global __nvmlDeviceGetOfaUtilization
    data["__nvmlDeviceGetOfaUtilization"] = <intptr_t>__nvmlDeviceGetOfaUtilization

    global __nvmlDeviceGetFBCStats
    data["__nvmlDeviceGetFBCStats"] = <intptr_t>__nvmlDeviceGetFBCStats

    global __nvmlDeviceGetFBCSessions
    data["__nvmlDeviceGetFBCSessions"] = <intptr_t>__nvmlDeviceGetFBCSessions

    global __nvmlDeviceGetDriverModel_v2
    data["__nvmlDeviceGetDriverModel_v2"] = <intptr_t>__nvmlDeviceGetDriverModel_v2

    global __nvmlDeviceGetVbiosVersion
    data["__nvmlDeviceGetVbiosVersion"] = <intptr_t>__nvmlDeviceGetVbiosVersion

    global __nvmlDeviceGetBridgeChipInfo
    data["__nvmlDeviceGetBridgeChipInfo"] = <intptr_t>__nvmlDeviceGetBridgeChipInfo

    global __nvmlDeviceGetComputeRunningProcesses_v3
    data["__nvmlDeviceGetComputeRunningProcesses_v3"] = <intptr_t>__nvmlDeviceGetComputeRunningProcesses_v3

    global __nvmlDeviceGetMPSComputeRunningProcesses_v3
    data["__nvmlDeviceGetMPSComputeRunningProcesses_v3"] = <intptr_t>__nvmlDeviceGetMPSComputeRunningProcesses_v3

    global __nvmlDeviceGetRunningProcessDetailList
    data["__nvmlDeviceGetRunningProcessDetailList"] = <intptr_t>__nvmlDeviceGetRunningProcessDetailList

    global __nvmlDeviceOnSameBoard
    data["__nvmlDeviceOnSameBoard"] = <intptr_t>__nvmlDeviceOnSameBoard

    global __nvmlDeviceGetAPIRestriction
    data["__nvmlDeviceGetAPIRestriction"] = <intptr_t>__nvmlDeviceGetAPIRestriction

    global __nvmlDeviceGetSamples
    data["__nvmlDeviceGetSamples"] = <intptr_t>__nvmlDeviceGetSamples

    global __nvmlDeviceGetBAR1MemoryInfo
    data["__nvmlDeviceGetBAR1MemoryInfo"] = <intptr_t>__nvmlDeviceGetBAR1MemoryInfo

    global __nvmlDeviceGetIrqNum
    data["__nvmlDeviceGetIrqNum"] = <intptr_t>__nvmlDeviceGetIrqNum

    global __nvmlDeviceGetNumGpuCores
    data["__nvmlDeviceGetNumGpuCores"] = <intptr_t>__nvmlDeviceGetNumGpuCores

    global __nvmlDeviceGetPowerSource
    data["__nvmlDeviceGetPowerSource"] = <intptr_t>__nvmlDeviceGetPowerSource

    global __nvmlDeviceGetMemoryBusWidth
    data["__nvmlDeviceGetMemoryBusWidth"] = <intptr_t>__nvmlDeviceGetMemoryBusWidth

    global __nvmlDeviceGetPcieLinkMaxSpeed
    data["__nvmlDeviceGetPcieLinkMaxSpeed"] = <intptr_t>__nvmlDeviceGetPcieLinkMaxSpeed

    global __nvmlDeviceGetPcieSpeed
    data["__nvmlDeviceGetPcieSpeed"] = <intptr_t>__nvmlDeviceGetPcieSpeed

    global __nvmlDeviceGetAdaptiveClockInfoStatus
    data["__nvmlDeviceGetAdaptiveClockInfoStatus"] = <intptr_t>__nvmlDeviceGetAdaptiveClockInfoStatus

    global __nvmlDeviceGetBusType
    data["__nvmlDeviceGetBusType"] = <intptr_t>__nvmlDeviceGetBusType

    global __nvmlDeviceGetGpuFabricInfoV
    data["__nvmlDeviceGetGpuFabricInfoV"] = <intptr_t>__nvmlDeviceGetGpuFabricInfoV

    global __nvmlSystemGetConfComputeCapabilities
    data["__nvmlSystemGetConfComputeCapabilities"] = <intptr_t>__nvmlSystemGetConfComputeCapabilities

    global __nvmlSystemGetConfComputeState
    data["__nvmlSystemGetConfComputeState"] = <intptr_t>__nvmlSystemGetConfComputeState

    global __nvmlDeviceGetConfComputeMemSizeInfo
    data["__nvmlDeviceGetConfComputeMemSizeInfo"] = <intptr_t>__nvmlDeviceGetConfComputeMemSizeInfo

    global __nvmlSystemGetConfComputeGpusReadyState
    data["__nvmlSystemGetConfComputeGpusReadyState"] = <intptr_t>__nvmlSystemGetConfComputeGpusReadyState

    global __nvmlDeviceGetConfComputeProtectedMemoryUsage
    data["__nvmlDeviceGetConfComputeProtectedMemoryUsage"] = <intptr_t>__nvmlDeviceGetConfComputeProtectedMemoryUsage

    global __nvmlDeviceGetConfComputeGpuCertificate
    data["__nvmlDeviceGetConfComputeGpuCertificate"] = <intptr_t>__nvmlDeviceGetConfComputeGpuCertificate

    global __nvmlDeviceGetConfComputeGpuAttestationReport
    data["__nvmlDeviceGetConfComputeGpuAttestationReport"] = <intptr_t>__nvmlDeviceGetConfComputeGpuAttestationReport

    global __nvmlSystemGetConfComputeKeyRotationThresholdInfo
    data["__nvmlSystemGetConfComputeKeyRotationThresholdInfo"] = <intptr_t>__nvmlSystemGetConfComputeKeyRotationThresholdInfo

    global __nvmlDeviceSetConfComputeUnprotectedMemSize
    data["__nvmlDeviceSetConfComputeUnprotectedMemSize"] = <intptr_t>__nvmlDeviceSetConfComputeUnprotectedMemSize

    global __nvmlSystemSetConfComputeGpusReadyState
    data["__nvmlSystemSetConfComputeGpusReadyState"] = <intptr_t>__nvmlSystemSetConfComputeGpusReadyState

    global __nvmlSystemSetConfComputeKeyRotationThresholdInfo
    data["__nvmlSystemSetConfComputeKeyRotationThresholdInfo"] = <intptr_t>__nvmlSystemSetConfComputeKeyRotationThresholdInfo

    global __nvmlSystemGetConfComputeSettings
    data["__nvmlSystemGetConfComputeSettings"] = <intptr_t>__nvmlSystemGetConfComputeSettings

    global __nvmlDeviceGetGspFirmwareVersion
    data["__nvmlDeviceGetGspFirmwareVersion"] = <intptr_t>__nvmlDeviceGetGspFirmwareVersion

    global __nvmlDeviceGetGspFirmwareMode
    data["__nvmlDeviceGetGspFirmwareMode"] = <intptr_t>__nvmlDeviceGetGspFirmwareMode

    global __nvmlDeviceGetSramEccErrorStatus
    data["__nvmlDeviceGetSramEccErrorStatus"] = <intptr_t>__nvmlDeviceGetSramEccErrorStatus

    global __nvmlDeviceGetAccountingMode
    data["__nvmlDeviceGetAccountingMode"] = <intptr_t>__nvmlDeviceGetAccountingMode

    global __nvmlDeviceGetAccountingStats
    data["__nvmlDeviceGetAccountingStats"] = <intptr_t>__nvmlDeviceGetAccountingStats

    global __nvmlDeviceGetAccountingPids
    data["__nvmlDeviceGetAccountingPids"] = <intptr_t>__nvmlDeviceGetAccountingPids

    global __nvmlDeviceGetAccountingBufferSize
    data["__nvmlDeviceGetAccountingBufferSize"] = <intptr_t>__nvmlDeviceGetAccountingBufferSize

    global __nvmlDeviceGetRetiredPages
    data["__nvmlDeviceGetRetiredPages"] = <intptr_t>__nvmlDeviceGetRetiredPages

    global __nvmlDeviceGetRetiredPages_v2
    data["__nvmlDeviceGetRetiredPages_v2"] = <intptr_t>__nvmlDeviceGetRetiredPages_v2

    global __nvmlDeviceGetRetiredPagesPendingStatus
    data["__nvmlDeviceGetRetiredPagesPendingStatus"] = <intptr_t>__nvmlDeviceGetRetiredPagesPendingStatus

    global __nvmlDeviceGetRemappedRows
    data["__nvmlDeviceGetRemappedRows"] = <intptr_t>__nvmlDeviceGetRemappedRows

    global __nvmlDeviceGetRowRemapperHistogram
    data["__nvmlDeviceGetRowRemapperHistogram"] = <intptr_t>__nvmlDeviceGetRowRemapperHistogram

    global __nvmlDeviceGetArchitecture
    data["__nvmlDeviceGetArchitecture"] = <intptr_t>__nvmlDeviceGetArchitecture

    global __nvmlDeviceGetClkMonStatus
    data["__nvmlDeviceGetClkMonStatus"] = <intptr_t>__nvmlDeviceGetClkMonStatus

    global __nvmlDeviceGetProcessUtilization
    data["__nvmlDeviceGetProcessUtilization"] = <intptr_t>__nvmlDeviceGetProcessUtilization

    global __nvmlDeviceGetProcessesUtilizationInfo
    data["__nvmlDeviceGetProcessesUtilizationInfo"] = <intptr_t>__nvmlDeviceGetProcessesUtilizationInfo

    global __nvmlDeviceGetPlatformInfo
    data["__nvmlDeviceGetPlatformInfo"] = <intptr_t>__nvmlDeviceGetPlatformInfo

    global __nvmlUnitSetLedState
    data["__nvmlUnitSetLedState"] = <intptr_t>__nvmlUnitSetLedState

    global __nvmlDeviceSetPersistenceMode
    data["__nvmlDeviceSetPersistenceMode"] = <intptr_t>__nvmlDeviceSetPersistenceMode

    global __nvmlDeviceSetComputeMode
    data["__nvmlDeviceSetComputeMode"] = <intptr_t>__nvmlDeviceSetComputeMode

    global __nvmlDeviceSetEccMode
    data["__nvmlDeviceSetEccMode"] = <intptr_t>__nvmlDeviceSetEccMode

    global __nvmlDeviceClearEccErrorCounts
    data["__nvmlDeviceClearEccErrorCounts"] = <intptr_t>__nvmlDeviceClearEccErrorCounts

    global __nvmlDeviceSetDriverModel
    data["__nvmlDeviceSetDriverModel"] = <intptr_t>__nvmlDeviceSetDriverModel

    global __nvmlDeviceSetGpuLockedClocks
    data["__nvmlDeviceSetGpuLockedClocks"] = <intptr_t>__nvmlDeviceSetGpuLockedClocks

    global __nvmlDeviceResetGpuLockedClocks
    data["__nvmlDeviceResetGpuLockedClocks"] = <intptr_t>__nvmlDeviceResetGpuLockedClocks

    global __nvmlDeviceSetMemoryLockedClocks
    data["__nvmlDeviceSetMemoryLockedClocks"] = <intptr_t>__nvmlDeviceSetMemoryLockedClocks

    global __nvmlDeviceResetMemoryLockedClocks
    data["__nvmlDeviceResetMemoryLockedClocks"] = <intptr_t>__nvmlDeviceResetMemoryLockedClocks

    global __nvmlDeviceSetAutoBoostedClocksEnabled
    data["__nvmlDeviceSetAutoBoostedClocksEnabled"] = <intptr_t>__nvmlDeviceSetAutoBoostedClocksEnabled

    global __nvmlDeviceSetDefaultAutoBoostedClocksEnabled
    data["__nvmlDeviceSetDefaultAutoBoostedClocksEnabled"] = <intptr_t>__nvmlDeviceSetDefaultAutoBoostedClocksEnabled

    global __nvmlDeviceSetDefaultFanSpeed_v2
    data["__nvmlDeviceSetDefaultFanSpeed_v2"] = <intptr_t>__nvmlDeviceSetDefaultFanSpeed_v2

    global __nvmlDeviceSetFanControlPolicy
    data["__nvmlDeviceSetFanControlPolicy"] = <intptr_t>__nvmlDeviceSetFanControlPolicy

    global __nvmlDeviceSetTemperatureThreshold
    data["__nvmlDeviceSetTemperatureThreshold"] = <intptr_t>__nvmlDeviceSetTemperatureThreshold

    global __nvmlDeviceSetPowerManagementLimit
    data["__nvmlDeviceSetPowerManagementLimit"] = <intptr_t>__nvmlDeviceSetPowerManagementLimit

    global __nvmlDeviceSetGpuOperationMode
    data["__nvmlDeviceSetGpuOperationMode"] = <intptr_t>__nvmlDeviceSetGpuOperationMode

    global __nvmlDeviceSetAPIRestriction
    data["__nvmlDeviceSetAPIRestriction"] = <intptr_t>__nvmlDeviceSetAPIRestriction

    global __nvmlDeviceSetFanSpeed_v2
    data["__nvmlDeviceSetFanSpeed_v2"] = <intptr_t>__nvmlDeviceSetFanSpeed_v2

    global __nvmlDeviceSetAccountingMode
    data["__nvmlDeviceSetAccountingMode"] = <intptr_t>__nvmlDeviceSetAccountingMode

    global __nvmlDeviceClearAccountingPids
    data["__nvmlDeviceClearAccountingPids"] = <intptr_t>__nvmlDeviceClearAccountingPids

    global __nvmlDeviceSetPowerManagementLimit_v2
    data["__nvmlDeviceSetPowerManagementLimit_v2"] = <intptr_t>__nvmlDeviceSetPowerManagementLimit_v2

    global __nvmlDeviceGetNvLinkState
    data["__nvmlDeviceGetNvLinkState"] = <intptr_t>__nvmlDeviceGetNvLinkState

    global __nvmlDeviceGetNvLinkVersion
    data["__nvmlDeviceGetNvLinkVersion"] = <intptr_t>__nvmlDeviceGetNvLinkVersion

    global __nvmlDeviceGetNvLinkCapability
    data["__nvmlDeviceGetNvLinkCapability"] = <intptr_t>__nvmlDeviceGetNvLinkCapability

    global __nvmlDeviceGetNvLinkRemotePciInfo_v2
    data["__nvmlDeviceGetNvLinkRemotePciInfo_v2"] = <intptr_t>__nvmlDeviceGetNvLinkRemotePciInfo_v2

    global __nvmlDeviceGetNvLinkErrorCounter
    data["__nvmlDeviceGetNvLinkErrorCounter"] = <intptr_t>__nvmlDeviceGetNvLinkErrorCounter

    global __nvmlDeviceResetNvLinkErrorCounters
    data["__nvmlDeviceResetNvLinkErrorCounters"] = <intptr_t>__nvmlDeviceResetNvLinkErrorCounters

    global __nvmlDeviceGetNvLinkRemoteDeviceType
    data["__nvmlDeviceGetNvLinkRemoteDeviceType"] = <intptr_t>__nvmlDeviceGetNvLinkRemoteDeviceType

    global __nvmlDeviceSetNvLinkDeviceLowPowerThreshold
    data["__nvmlDeviceSetNvLinkDeviceLowPowerThreshold"] = <intptr_t>__nvmlDeviceSetNvLinkDeviceLowPowerThreshold

    global __nvmlSystemSetNvlinkBwMode
    data["__nvmlSystemSetNvlinkBwMode"] = <intptr_t>__nvmlSystemSetNvlinkBwMode

    global __nvmlSystemGetNvlinkBwMode
    data["__nvmlSystemGetNvlinkBwMode"] = <intptr_t>__nvmlSystemGetNvlinkBwMode

    global __nvmlDeviceGetNvlinkSupportedBwModes
    data["__nvmlDeviceGetNvlinkSupportedBwModes"] = <intptr_t>__nvmlDeviceGetNvlinkSupportedBwModes

    global __nvmlDeviceGetNvlinkBwMode
    data["__nvmlDeviceGetNvlinkBwMode"] = <intptr_t>__nvmlDeviceGetNvlinkBwMode

    global __nvmlDeviceSetNvlinkBwMode
    data["__nvmlDeviceSetNvlinkBwMode"] = <intptr_t>__nvmlDeviceSetNvlinkBwMode

    global __nvmlEventSetCreate
    data["__nvmlEventSetCreate"] = <intptr_t>__nvmlEventSetCreate

    global __nvmlDeviceRegisterEvents
    data["__nvmlDeviceRegisterEvents"] = <intptr_t>__nvmlDeviceRegisterEvents

    global __nvmlDeviceGetSupportedEventTypes
    data["__nvmlDeviceGetSupportedEventTypes"] = <intptr_t>__nvmlDeviceGetSupportedEventTypes

    global __nvmlEventSetWait_v2
    data["__nvmlEventSetWait_v2"] = <intptr_t>__nvmlEventSetWait_v2

    global __nvmlEventSetFree
    data["__nvmlEventSetFree"] = <intptr_t>__nvmlEventSetFree

    global __nvmlSystemEventSetCreate
    data["__nvmlSystemEventSetCreate"] = <intptr_t>__nvmlSystemEventSetCreate

    global __nvmlSystemEventSetFree
    data["__nvmlSystemEventSetFree"] = <intptr_t>__nvmlSystemEventSetFree

    global __nvmlSystemRegisterEvents
    data["__nvmlSystemRegisterEvents"] = <intptr_t>__nvmlSystemRegisterEvents

    global __nvmlSystemEventSetWait
    data["__nvmlSystemEventSetWait"] = <intptr_t>__nvmlSystemEventSetWait

    global __nvmlDeviceModifyDrainState
    data["__nvmlDeviceModifyDrainState"] = <intptr_t>__nvmlDeviceModifyDrainState

    global __nvmlDeviceQueryDrainState
    data["__nvmlDeviceQueryDrainState"] = <intptr_t>__nvmlDeviceQueryDrainState

    global __nvmlDeviceRemoveGpu_v2
    data["__nvmlDeviceRemoveGpu_v2"] = <intptr_t>__nvmlDeviceRemoveGpu_v2

    global __nvmlDeviceDiscoverGpus
    data["__nvmlDeviceDiscoverGpus"] = <intptr_t>__nvmlDeviceDiscoverGpus

    global __nvmlDeviceGetFieldValues
    data["__nvmlDeviceGetFieldValues"] = <intptr_t>__nvmlDeviceGetFieldValues

    global __nvmlDeviceClearFieldValues
    data["__nvmlDeviceClearFieldValues"] = <intptr_t>__nvmlDeviceClearFieldValues

    global __nvmlDeviceGetVirtualizationMode
    data["__nvmlDeviceGetVirtualizationMode"] = <intptr_t>__nvmlDeviceGetVirtualizationMode

    global __nvmlDeviceGetHostVgpuMode
    data["__nvmlDeviceGetHostVgpuMode"] = <intptr_t>__nvmlDeviceGetHostVgpuMode

    global __nvmlDeviceSetVirtualizationMode
    data["__nvmlDeviceSetVirtualizationMode"] = <intptr_t>__nvmlDeviceSetVirtualizationMode

    global __nvmlDeviceGetVgpuHeterogeneousMode
    data["__nvmlDeviceGetVgpuHeterogeneousMode"] = <intptr_t>__nvmlDeviceGetVgpuHeterogeneousMode

    global __nvmlDeviceSetVgpuHeterogeneousMode
    data["__nvmlDeviceSetVgpuHeterogeneousMode"] = <intptr_t>__nvmlDeviceSetVgpuHeterogeneousMode

    global __nvmlVgpuInstanceGetPlacementId
    data["__nvmlVgpuInstanceGetPlacementId"] = <intptr_t>__nvmlVgpuInstanceGetPlacementId

    global __nvmlDeviceGetVgpuTypeSupportedPlacements
    data["__nvmlDeviceGetVgpuTypeSupportedPlacements"] = <intptr_t>__nvmlDeviceGetVgpuTypeSupportedPlacements

    global __nvmlDeviceGetVgpuTypeCreatablePlacements
    data["__nvmlDeviceGetVgpuTypeCreatablePlacements"] = <intptr_t>__nvmlDeviceGetVgpuTypeCreatablePlacements

    global __nvmlVgpuTypeGetGspHeapSize
    data["__nvmlVgpuTypeGetGspHeapSize"] = <intptr_t>__nvmlVgpuTypeGetGspHeapSize

    global __nvmlVgpuTypeGetFbReservation
    data["__nvmlVgpuTypeGetFbReservation"] = <intptr_t>__nvmlVgpuTypeGetFbReservation

    global __nvmlVgpuInstanceGetRuntimeStateSize
    data["__nvmlVgpuInstanceGetRuntimeStateSize"] = <intptr_t>__nvmlVgpuInstanceGetRuntimeStateSize

    global __nvmlDeviceSetVgpuCapabilities
    data["__nvmlDeviceSetVgpuCapabilities"] = <intptr_t>__nvmlDeviceSetVgpuCapabilities

    global __nvmlDeviceGetGridLicensableFeatures_v4
    data["__nvmlDeviceGetGridLicensableFeatures_v4"] = <intptr_t>__nvmlDeviceGetGridLicensableFeatures_v4

    global __nvmlGetVgpuDriverCapabilities
    data["__nvmlGetVgpuDriverCapabilities"] = <intptr_t>__nvmlGetVgpuDriverCapabilities

    global __nvmlDeviceGetVgpuCapabilities
    data["__nvmlDeviceGetVgpuCapabilities"] = <intptr_t>__nvmlDeviceGetVgpuCapabilities

    global __nvmlDeviceGetSupportedVgpus
    data["__nvmlDeviceGetSupportedVgpus"] = <intptr_t>__nvmlDeviceGetSupportedVgpus

    global __nvmlDeviceGetCreatableVgpus
    data["__nvmlDeviceGetCreatableVgpus"] = <intptr_t>__nvmlDeviceGetCreatableVgpus

    global __nvmlVgpuTypeGetClass
    data["__nvmlVgpuTypeGetClass"] = <intptr_t>__nvmlVgpuTypeGetClass

    global __nvmlVgpuTypeGetName
    data["__nvmlVgpuTypeGetName"] = <intptr_t>__nvmlVgpuTypeGetName

    global __nvmlVgpuTypeGetGpuInstanceProfileId
    data["__nvmlVgpuTypeGetGpuInstanceProfileId"] = <intptr_t>__nvmlVgpuTypeGetGpuInstanceProfileId

    global __nvmlVgpuTypeGetDeviceID
    data["__nvmlVgpuTypeGetDeviceID"] = <intptr_t>__nvmlVgpuTypeGetDeviceID

    global __nvmlVgpuTypeGetFramebufferSize
    data["__nvmlVgpuTypeGetFramebufferSize"] = <intptr_t>__nvmlVgpuTypeGetFramebufferSize

    global __nvmlVgpuTypeGetNumDisplayHeads
    data["__nvmlVgpuTypeGetNumDisplayHeads"] = <intptr_t>__nvmlVgpuTypeGetNumDisplayHeads

    global __nvmlVgpuTypeGetResolution
    data["__nvmlVgpuTypeGetResolution"] = <intptr_t>__nvmlVgpuTypeGetResolution

    global __nvmlVgpuTypeGetLicense
    data["__nvmlVgpuTypeGetLicense"] = <intptr_t>__nvmlVgpuTypeGetLicense

    global __nvmlVgpuTypeGetFrameRateLimit
    data["__nvmlVgpuTypeGetFrameRateLimit"] = <intptr_t>__nvmlVgpuTypeGetFrameRateLimit

    global __nvmlVgpuTypeGetMaxInstances
    data["__nvmlVgpuTypeGetMaxInstances"] = <intptr_t>__nvmlVgpuTypeGetMaxInstances

    global __nvmlVgpuTypeGetMaxInstancesPerVm
    data["__nvmlVgpuTypeGetMaxInstancesPerVm"] = <intptr_t>__nvmlVgpuTypeGetMaxInstancesPerVm

    global __nvmlVgpuTypeGetBAR1Info
    data["__nvmlVgpuTypeGetBAR1Info"] = <intptr_t>__nvmlVgpuTypeGetBAR1Info

    global __nvmlDeviceGetActiveVgpus
    data["__nvmlDeviceGetActiveVgpus"] = <intptr_t>__nvmlDeviceGetActiveVgpus

    global __nvmlVgpuInstanceGetVmID
    data["__nvmlVgpuInstanceGetVmID"] = <intptr_t>__nvmlVgpuInstanceGetVmID

    global __nvmlVgpuInstanceGetUUID
    data["__nvmlVgpuInstanceGetUUID"] = <intptr_t>__nvmlVgpuInstanceGetUUID

    global __nvmlVgpuInstanceGetVmDriverVersion
    data["__nvmlVgpuInstanceGetVmDriverVersion"] = <intptr_t>__nvmlVgpuInstanceGetVmDriverVersion

    global __nvmlVgpuInstanceGetFbUsage
    data["__nvmlVgpuInstanceGetFbUsage"] = <intptr_t>__nvmlVgpuInstanceGetFbUsage

    global __nvmlVgpuInstanceGetLicenseStatus
    data["__nvmlVgpuInstanceGetLicenseStatus"] = <intptr_t>__nvmlVgpuInstanceGetLicenseStatus

    global __nvmlVgpuInstanceGetType
    data["__nvmlVgpuInstanceGetType"] = <intptr_t>__nvmlVgpuInstanceGetType

    global __nvmlVgpuInstanceGetFrameRateLimit
    data["__nvmlVgpuInstanceGetFrameRateLimit"] = <intptr_t>__nvmlVgpuInstanceGetFrameRateLimit

    global __nvmlVgpuInstanceGetEccMode
    data["__nvmlVgpuInstanceGetEccMode"] = <intptr_t>__nvmlVgpuInstanceGetEccMode

    global __nvmlVgpuInstanceGetEncoderCapacity
    data["__nvmlVgpuInstanceGetEncoderCapacity"] = <intptr_t>__nvmlVgpuInstanceGetEncoderCapacity

    global __nvmlVgpuInstanceSetEncoderCapacity
    data["__nvmlVgpuInstanceSetEncoderCapacity"] = <intptr_t>__nvmlVgpuInstanceSetEncoderCapacity

    global __nvmlVgpuInstanceGetEncoderStats
    data["__nvmlVgpuInstanceGetEncoderStats"] = <intptr_t>__nvmlVgpuInstanceGetEncoderStats

    global __nvmlVgpuInstanceGetEncoderSessions
    data["__nvmlVgpuInstanceGetEncoderSessions"] = <intptr_t>__nvmlVgpuInstanceGetEncoderSessions

    global __nvmlVgpuInstanceGetFBCStats
    data["__nvmlVgpuInstanceGetFBCStats"] = <intptr_t>__nvmlVgpuInstanceGetFBCStats

    global __nvmlVgpuInstanceGetFBCSessions
    data["__nvmlVgpuInstanceGetFBCSessions"] = <intptr_t>__nvmlVgpuInstanceGetFBCSessions

    global __nvmlVgpuInstanceGetGpuInstanceId
    data["__nvmlVgpuInstanceGetGpuInstanceId"] = <intptr_t>__nvmlVgpuInstanceGetGpuInstanceId

    global __nvmlVgpuInstanceGetGpuPciId
    data["__nvmlVgpuInstanceGetGpuPciId"] = <intptr_t>__nvmlVgpuInstanceGetGpuPciId

    global __nvmlVgpuTypeGetCapabilities
    data["__nvmlVgpuTypeGetCapabilities"] = <intptr_t>__nvmlVgpuTypeGetCapabilities

    global __nvmlVgpuInstanceGetMdevUUID
    data["__nvmlVgpuInstanceGetMdevUUID"] = <intptr_t>__nvmlVgpuInstanceGetMdevUUID

    global __nvmlGpuInstanceGetCreatableVgpus
    data["__nvmlGpuInstanceGetCreatableVgpus"] = <intptr_t>__nvmlGpuInstanceGetCreatableVgpus

    global __nvmlVgpuTypeGetMaxInstancesPerGpuInstance
    data["__nvmlVgpuTypeGetMaxInstancesPerGpuInstance"] = <intptr_t>__nvmlVgpuTypeGetMaxInstancesPerGpuInstance

    global __nvmlGpuInstanceGetActiveVgpus
    data["__nvmlGpuInstanceGetActiveVgpus"] = <intptr_t>__nvmlGpuInstanceGetActiveVgpus

    global __nvmlGpuInstanceSetVgpuSchedulerState
    data["__nvmlGpuInstanceSetVgpuSchedulerState"] = <intptr_t>__nvmlGpuInstanceSetVgpuSchedulerState

    global __nvmlGpuInstanceGetVgpuSchedulerState
    data["__nvmlGpuInstanceGetVgpuSchedulerState"] = <intptr_t>__nvmlGpuInstanceGetVgpuSchedulerState

    global __nvmlGpuInstanceGetVgpuSchedulerLog
    data["__nvmlGpuInstanceGetVgpuSchedulerLog"] = <intptr_t>__nvmlGpuInstanceGetVgpuSchedulerLog

    global __nvmlGpuInstanceGetVgpuTypeCreatablePlacements
    data["__nvmlGpuInstanceGetVgpuTypeCreatablePlacements"] = <intptr_t>__nvmlGpuInstanceGetVgpuTypeCreatablePlacements

    global __nvmlGpuInstanceGetVgpuHeterogeneousMode
    data["__nvmlGpuInstanceGetVgpuHeterogeneousMode"] = <intptr_t>__nvmlGpuInstanceGetVgpuHeterogeneousMode

    global __nvmlGpuInstanceSetVgpuHeterogeneousMode
    data["__nvmlGpuInstanceSetVgpuHeterogeneousMode"] = <intptr_t>__nvmlGpuInstanceSetVgpuHeterogeneousMode

    global __nvmlVgpuInstanceGetMetadata
    data["__nvmlVgpuInstanceGetMetadata"] = <intptr_t>__nvmlVgpuInstanceGetMetadata

    global __nvmlDeviceGetVgpuMetadata
    data["__nvmlDeviceGetVgpuMetadata"] = <intptr_t>__nvmlDeviceGetVgpuMetadata

    global __nvmlGetVgpuCompatibility
    data["__nvmlGetVgpuCompatibility"] = <intptr_t>__nvmlGetVgpuCompatibility

    global __nvmlDeviceGetPgpuMetadataString
    data["__nvmlDeviceGetPgpuMetadataString"] = <intptr_t>__nvmlDeviceGetPgpuMetadataString

    global __nvmlDeviceGetVgpuSchedulerLog
    data["__nvmlDeviceGetVgpuSchedulerLog"] = <intptr_t>__nvmlDeviceGetVgpuSchedulerLog

    global __nvmlDeviceGetVgpuSchedulerState
    data["__nvmlDeviceGetVgpuSchedulerState"] = <intptr_t>__nvmlDeviceGetVgpuSchedulerState

    global __nvmlDeviceGetVgpuSchedulerCapabilities
    data["__nvmlDeviceGetVgpuSchedulerCapabilities"] = <intptr_t>__nvmlDeviceGetVgpuSchedulerCapabilities

    global __nvmlDeviceSetVgpuSchedulerState
    data["__nvmlDeviceSetVgpuSchedulerState"] = <intptr_t>__nvmlDeviceSetVgpuSchedulerState

    global __nvmlGetVgpuVersion
    data["__nvmlGetVgpuVersion"] = <intptr_t>__nvmlGetVgpuVersion

    global __nvmlSetVgpuVersion
    data["__nvmlSetVgpuVersion"] = <intptr_t>__nvmlSetVgpuVersion

    global __nvmlDeviceGetVgpuUtilization
    data["__nvmlDeviceGetVgpuUtilization"] = <intptr_t>__nvmlDeviceGetVgpuUtilization

    global __nvmlDeviceGetVgpuInstancesUtilizationInfo
    data["__nvmlDeviceGetVgpuInstancesUtilizationInfo"] = <intptr_t>__nvmlDeviceGetVgpuInstancesUtilizationInfo

    global __nvmlDeviceGetVgpuProcessUtilization
    data["__nvmlDeviceGetVgpuProcessUtilization"] = <intptr_t>__nvmlDeviceGetVgpuProcessUtilization

    global __nvmlDeviceGetVgpuProcessesUtilizationInfo
    data["__nvmlDeviceGetVgpuProcessesUtilizationInfo"] = <intptr_t>__nvmlDeviceGetVgpuProcessesUtilizationInfo

    global __nvmlVgpuInstanceGetAccountingMode
    data["__nvmlVgpuInstanceGetAccountingMode"] = <intptr_t>__nvmlVgpuInstanceGetAccountingMode

    global __nvmlVgpuInstanceGetAccountingPids
    data["__nvmlVgpuInstanceGetAccountingPids"] = <intptr_t>__nvmlVgpuInstanceGetAccountingPids

    global __nvmlVgpuInstanceGetAccountingStats
    data["__nvmlVgpuInstanceGetAccountingStats"] = <intptr_t>__nvmlVgpuInstanceGetAccountingStats

    global __nvmlVgpuInstanceClearAccountingPids
    data["__nvmlVgpuInstanceClearAccountingPids"] = <intptr_t>__nvmlVgpuInstanceClearAccountingPids

    global __nvmlVgpuInstanceGetLicenseInfo_v2
    data["__nvmlVgpuInstanceGetLicenseInfo_v2"] = <intptr_t>__nvmlVgpuInstanceGetLicenseInfo_v2

    global __nvmlGetExcludedDeviceCount
    data["__nvmlGetExcludedDeviceCount"] = <intptr_t>__nvmlGetExcludedDeviceCount

    global __nvmlGetExcludedDeviceInfoByIndex
    data["__nvmlGetExcludedDeviceInfoByIndex"] = <intptr_t>__nvmlGetExcludedDeviceInfoByIndex

    global __nvmlDeviceSetMigMode
    data["__nvmlDeviceSetMigMode"] = <intptr_t>__nvmlDeviceSetMigMode

    global __nvmlDeviceGetMigMode
    data["__nvmlDeviceGetMigMode"] = <intptr_t>__nvmlDeviceGetMigMode

    global __nvmlDeviceGetGpuInstanceProfileInfoV
    data["__nvmlDeviceGetGpuInstanceProfileInfoV"] = <intptr_t>__nvmlDeviceGetGpuInstanceProfileInfoV

    global __nvmlDeviceGetGpuInstancePossiblePlacements_v2
    data["__nvmlDeviceGetGpuInstancePossiblePlacements_v2"] = <intptr_t>__nvmlDeviceGetGpuInstancePossiblePlacements_v2

    global __nvmlDeviceGetGpuInstanceRemainingCapacity
    data["__nvmlDeviceGetGpuInstanceRemainingCapacity"] = <intptr_t>__nvmlDeviceGetGpuInstanceRemainingCapacity

    global __nvmlDeviceCreateGpuInstance
    data["__nvmlDeviceCreateGpuInstance"] = <intptr_t>__nvmlDeviceCreateGpuInstance

    global __nvmlDeviceCreateGpuInstanceWithPlacement
    data["__nvmlDeviceCreateGpuInstanceWithPlacement"] = <intptr_t>__nvmlDeviceCreateGpuInstanceWithPlacement

    global __nvmlGpuInstanceDestroy
    data["__nvmlGpuInstanceDestroy"] = <intptr_t>__nvmlGpuInstanceDestroy

    global __nvmlDeviceGetGpuInstances
    data["__nvmlDeviceGetGpuInstances"] = <intptr_t>__nvmlDeviceGetGpuInstances

    global __nvmlDeviceGetGpuInstanceById
    data["__nvmlDeviceGetGpuInstanceById"] = <intptr_t>__nvmlDeviceGetGpuInstanceById

    global __nvmlGpuInstanceGetInfo
    data["__nvmlGpuInstanceGetInfo"] = <intptr_t>__nvmlGpuInstanceGetInfo

    global __nvmlGpuInstanceGetComputeInstanceProfileInfoV
    data["__nvmlGpuInstanceGetComputeInstanceProfileInfoV"] = <intptr_t>__nvmlGpuInstanceGetComputeInstanceProfileInfoV

    global __nvmlGpuInstanceGetComputeInstanceRemainingCapacity
    data["__nvmlGpuInstanceGetComputeInstanceRemainingCapacity"] = <intptr_t>__nvmlGpuInstanceGetComputeInstanceRemainingCapacity

    global __nvmlGpuInstanceGetComputeInstancePossiblePlacements
    data["__nvmlGpuInstanceGetComputeInstancePossiblePlacements"] = <intptr_t>__nvmlGpuInstanceGetComputeInstancePossiblePlacements

    global __nvmlGpuInstanceCreateComputeInstance
    data["__nvmlGpuInstanceCreateComputeInstance"] = <intptr_t>__nvmlGpuInstanceCreateComputeInstance

    global __nvmlGpuInstanceCreateComputeInstanceWithPlacement
    data["__nvmlGpuInstanceCreateComputeInstanceWithPlacement"] = <intptr_t>__nvmlGpuInstanceCreateComputeInstanceWithPlacement

    global __nvmlComputeInstanceDestroy
    data["__nvmlComputeInstanceDestroy"] = <intptr_t>__nvmlComputeInstanceDestroy

    global __nvmlGpuInstanceGetComputeInstances
    data["__nvmlGpuInstanceGetComputeInstances"] = <intptr_t>__nvmlGpuInstanceGetComputeInstances

    global __nvmlGpuInstanceGetComputeInstanceById
    data["__nvmlGpuInstanceGetComputeInstanceById"] = <intptr_t>__nvmlGpuInstanceGetComputeInstanceById

    global __nvmlComputeInstanceGetInfo_v2
    data["__nvmlComputeInstanceGetInfo_v2"] = <intptr_t>__nvmlComputeInstanceGetInfo_v2

    global __nvmlDeviceIsMigDeviceHandle
    data["__nvmlDeviceIsMigDeviceHandle"] = <intptr_t>__nvmlDeviceIsMigDeviceHandle

    global __nvmlDeviceGetGpuInstanceId
    data["__nvmlDeviceGetGpuInstanceId"] = <intptr_t>__nvmlDeviceGetGpuInstanceId

    global __nvmlDeviceGetComputeInstanceId
    data["__nvmlDeviceGetComputeInstanceId"] = <intptr_t>__nvmlDeviceGetComputeInstanceId

    global __nvmlDeviceGetMaxMigDeviceCount
    data["__nvmlDeviceGetMaxMigDeviceCount"] = <intptr_t>__nvmlDeviceGetMaxMigDeviceCount

    global __nvmlDeviceGetMigDeviceHandleByIndex
    data["__nvmlDeviceGetMigDeviceHandleByIndex"] = <intptr_t>__nvmlDeviceGetMigDeviceHandleByIndex

    global __nvmlDeviceGetDeviceHandleFromMigDeviceHandle
    data["__nvmlDeviceGetDeviceHandleFromMigDeviceHandle"] = <intptr_t>__nvmlDeviceGetDeviceHandleFromMigDeviceHandle

    global __nvmlGpmSampleGet
    data["__nvmlGpmSampleGet"] = <intptr_t>__nvmlGpmSampleGet

    global __nvmlGpmMigSampleGet
    data["__nvmlGpmMigSampleGet"] = <intptr_t>__nvmlGpmMigSampleGet

    global __nvmlGpmQueryDeviceSupport
    data["__nvmlGpmQueryDeviceSupport"] = <intptr_t>__nvmlGpmQueryDeviceSupport

    global __nvmlGpmQueryIfStreamingEnabled
    data["__nvmlGpmQueryIfStreamingEnabled"] = <intptr_t>__nvmlGpmQueryIfStreamingEnabled

    global __nvmlGpmSetStreamingEnabled
    data["__nvmlGpmSetStreamingEnabled"] = <intptr_t>__nvmlGpmSetStreamingEnabled

    global __nvmlDeviceGetCapabilities
    data["__nvmlDeviceGetCapabilities"] = <intptr_t>__nvmlDeviceGetCapabilities

    global __nvmlDeviceWorkloadPowerProfileClearRequestedProfiles
    data["__nvmlDeviceWorkloadPowerProfileClearRequestedProfiles"] = <intptr_t>__nvmlDeviceWorkloadPowerProfileClearRequestedProfiles

    global __nvmlDevicePowerSmoothingActivatePresetProfile
    data["__nvmlDevicePowerSmoothingActivatePresetProfile"] = <intptr_t>__nvmlDevicePowerSmoothingActivatePresetProfile

    global __nvmlDevicePowerSmoothingUpdatePresetProfileParam
    data["__nvmlDevicePowerSmoothingUpdatePresetProfileParam"] = <intptr_t>__nvmlDevicePowerSmoothingUpdatePresetProfileParam

    global __nvmlDevicePowerSmoothingSetState
    data["__nvmlDevicePowerSmoothingSetState"] = <intptr_t>__nvmlDevicePowerSmoothingSetState

    global __nvmlDeviceGetAddressingMode
    data["__nvmlDeviceGetAddressingMode"] = <intptr_t>__nvmlDeviceGetAddressingMode

    global __nvmlDeviceGetRepairStatus
    data["__nvmlDeviceGetRepairStatus"] = <intptr_t>__nvmlDeviceGetRepairStatus

    global __nvmlDeviceGetPowerMizerMode_v1
    data["__nvmlDeviceGetPowerMizerMode_v1"] = <intptr_t>__nvmlDeviceGetPowerMizerMode_v1

    global __nvmlDeviceSetPowerMizerMode_v1
    data["__nvmlDeviceSetPowerMizerMode_v1"] = <intptr_t>__nvmlDeviceSetPowerMizerMode_v1

    global __nvmlDeviceGetPdi
    data["__nvmlDeviceGetPdi"] = <intptr_t>__nvmlDeviceGetPdi

    global __nvmlDeviceSetHostname_v1
    data["__nvmlDeviceSetHostname_v1"] = <intptr_t>__nvmlDeviceSetHostname_v1

    global __nvmlDeviceGetHostname_v1
    data["__nvmlDeviceGetHostname_v1"] = <intptr_t>__nvmlDeviceGetHostname_v1

    global __nvmlDeviceGetNvLinkInfo
    data["__nvmlDeviceGetNvLinkInfo"] = <intptr_t>__nvmlDeviceGetNvLinkInfo

    global __nvmlDeviceReadWritePRM_v1
    data["__nvmlDeviceReadWritePRM_v1"] = <intptr_t>__nvmlDeviceReadWritePRM_v1

    global __nvmlDeviceGetGpuInstanceProfileInfoByIdV
    data["__nvmlDeviceGetGpuInstanceProfileInfoByIdV"] = <intptr_t>__nvmlDeviceGetGpuInstanceProfileInfoByIdV

    global __nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts
    data["__nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts"] = <intptr_t>__nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts

    func_ptrs = data
    return data


cpdef _inspect_function_pointer(str name):
    global func_ptrs
    if func_ptrs is None:
        func_ptrs = _inspect_function_pointers()
    return func_ptrs[name]


###############################################################################
# Wrapper functions
###############################################################################

cdef nvmlReturn_t _nvmlInit_v2() except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlInit_v2
    _check_or_init_nvml()
    if __nvmlInit_v2 == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlInit_v2 is not found")
    return (<nvmlReturn_t (*)() noexcept nogil>__nvmlInit_v2)(
        )


cdef nvmlReturn_t _nvmlInitWithFlags(unsigned int flags) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlInitWithFlags
    _check_or_init_nvml()
    if __nvmlInitWithFlags == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlInitWithFlags is not found")
    return (<nvmlReturn_t (*)(unsigned int) noexcept nogil>__nvmlInitWithFlags)(
        flags)


cdef nvmlReturn_t _nvmlShutdown() except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlShutdown
    _check_or_init_nvml()
    if __nvmlShutdown == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlShutdown is not found")
    return (<nvmlReturn_t (*)() noexcept nogil>__nvmlShutdown)(
        )


cdef const char* _nvmlErrorString(nvmlReturn_t result) except?NULL nogil:
    global __nvmlErrorString
    _check_or_init_nvml()
    if __nvmlErrorString == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlErrorString is not found")
    return (<const char* (*)(nvmlReturn_t) noexcept nogil>__nvmlErrorString)(
        result)


cdef nvmlReturn_t _nvmlSystemGetDriverVersion(char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlSystemGetDriverVersion
    _check_or_init_nvml()
    if __nvmlSystemGetDriverVersion == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlSystemGetDriverVersion is not found")
    return (<nvmlReturn_t (*)(char*, unsigned int) noexcept nogil>__nvmlSystemGetDriverVersion)(
        version, length)


cdef nvmlReturn_t _nvmlSystemGetNVMLVersion(char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlSystemGetNVMLVersion
    _check_or_init_nvml()
    if __nvmlSystemGetNVMLVersion == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlSystemGetNVMLVersion is not found")
    return (<nvmlReturn_t (*)(char*, unsigned int) noexcept nogil>__nvmlSystemGetNVMLVersion)(
        version, length)


cdef nvmlReturn_t _nvmlSystemGetCudaDriverVersion(int* cudaDriverVersion) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlSystemGetCudaDriverVersion
    _check_or_init_nvml()
    if __nvmlSystemGetCudaDriverVersion == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlSystemGetCudaDriverVersion is not found")
    return (<nvmlReturn_t (*)(int*) noexcept nogil>__nvmlSystemGetCudaDriverVersion)(
        cudaDriverVersion)


cdef nvmlReturn_t _nvmlSystemGetCudaDriverVersion_v2(int* cudaDriverVersion) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlSystemGetCudaDriverVersion_v2
    _check_or_init_nvml()
    if __nvmlSystemGetCudaDriverVersion_v2 == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlSystemGetCudaDriverVersion_v2 is not found")
    return (<nvmlReturn_t (*)(int*) noexcept nogil>__nvmlSystemGetCudaDriverVersion_v2)(
        cudaDriverVersion)


cdef nvmlReturn_t _nvmlSystemGetProcessName(unsigned int pid, char* name, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlSystemGetProcessName
    _check_or_init_nvml()
    if __nvmlSystemGetProcessName == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlSystemGetProcessName is not found")
    return (<nvmlReturn_t (*)(unsigned int, char*, unsigned int) noexcept nogil>__nvmlSystemGetProcessName)(
        pid, name, length)


cdef nvmlReturn_t _nvmlSystemGetHicVersion(unsigned int* hwbcCount, nvmlHwbcEntry_t* hwbcEntries) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlSystemGetHicVersion
    _check_or_init_nvml()
    if __nvmlSystemGetHicVersion == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlSystemGetHicVersion is not found")
    return (<nvmlReturn_t (*)(unsigned int*, nvmlHwbcEntry_t*) noexcept nogil>__nvmlSystemGetHicVersion)(
        hwbcCount, hwbcEntries)


cdef nvmlReturn_t _nvmlSystemGetTopologyGpuSet(unsigned int cpuNumber, unsigned int* count, nvmlDevice_t* deviceArray) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlSystemGetTopologyGpuSet
    _check_or_init_nvml()
    if __nvmlSystemGetTopologyGpuSet == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlSystemGetTopologyGpuSet is not found")
    return (<nvmlReturn_t (*)(unsigned int, unsigned int*, nvmlDevice_t*) noexcept nogil>__nvmlSystemGetTopologyGpuSet)(
        cpuNumber, count, deviceArray)


cdef nvmlReturn_t _nvmlSystemGetDriverBranch(nvmlSystemDriverBranchInfo_t* branchInfo, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlSystemGetDriverBranch
    _check_or_init_nvml()
    if __nvmlSystemGetDriverBranch == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlSystemGetDriverBranch is not found")
    return (<nvmlReturn_t (*)(nvmlSystemDriverBranchInfo_t*, unsigned int) noexcept nogil>__nvmlSystemGetDriverBranch)(
        branchInfo, length)


cdef nvmlReturn_t _nvmlUnitGetCount(unsigned int* unitCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlUnitGetCount
    _check_or_init_nvml()
    if __nvmlUnitGetCount == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlUnitGetCount is not found")
    return (<nvmlReturn_t (*)(unsigned int*) noexcept nogil>__nvmlUnitGetCount)(
        unitCount)


cdef nvmlReturn_t _nvmlUnitGetHandleByIndex(unsigned int index, nvmlUnit_t* unit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlUnitGetHandleByIndex
    _check_or_init_nvml()
    if __nvmlUnitGetHandleByIndex == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlUnitGetHandleByIndex is not found")
    return (<nvmlReturn_t (*)(unsigned int, nvmlUnit_t*) noexcept nogil>__nvmlUnitGetHandleByIndex)(
        index, unit)


cdef nvmlReturn_t _nvmlUnitGetUnitInfo(nvmlUnit_t unit, nvmlUnitInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlUnitGetUnitInfo
    _check_or_init_nvml()
    if __nvmlUnitGetUnitInfo == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlUnitGetUnitInfo is not found")
    return (<nvmlReturn_t (*)(nvmlUnit_t, nvmlUnitInfo_t*) noexcept nogil>__nvmlUnitGetUnitInfo)(
        unit, info)


cdef nvmlReturn_t _nvmlUnitGetLedState(nvmlUnit_t unit, nvmlLedState_t* state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlUnitGetLedState
    _check_or_init_nvml()
    if __nvmlUnitGetLedState == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlUnitGetLedState is not found")
    return (<nvmlReturn_t (*)(nvmlUnit_t, nvmlLedState_t*) noexcept nogil>__nvmlUnitGetLedState)(
        unit, state)


cdef nvmlReturn_t _nvmlUnitGetPsuInfo(nvmlUnit_t unit, nvmlPSUInfo_t* psu) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlUnitGetPsuInfo
    _check_or_init_nvml()
    if __nvmlUnitGetPsuInfo == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlUnitGetPsuInfo is not found")
    return (<nvmlReturn_t (*)(nvmlUnit_t, nvmlPSUInfo_t*) noexcept nogil>__nvmlUnitGetPsuInfo)(
        unit, psu)


cdef nvmlReturn_t _nvmlUnitGetTemperature(nvmlUnit_t unit, unsigned int type, unsigned int* temp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlUnitGetTemperature
    _check_or_init_nvml()
    if __nvmlUnitGetTemperature == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlUnitGetTemperature is not found")
    return (<nvmlReturn_t (*)(nvmlUnit_t, unsigned int, unsigned int*) noexcept nogil>__nvmlUnitGetTemperature)(
        unit, type, temp)


cdef nvmlReturn_t _nvmlUnitGetFanSpeedInfo(nvmlUnit_t unit, nvmlUnitFanSpeeds_t* fanSpeeds) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlUnitGetFanSpeedInfo
    _check_or_init_nvml()
    if __nvmlUnitGetFanSpeedInfo == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlUnitGetFanSpeedInfo is not found")
    return (<nvmlReturn_t (*)(nvmlUnit_t, nvmlUnitFanSpeeds_t*) noexcept nogil>__nvmlUnitGetFanSpeedInfo)(
        unit, fanSpeeds)


cdef nvmlReturn_t _nvmlUnitGetDevices(nvmlUnit_t unit, unsigned int* deviceCount, nvmlDevice_t* devices) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlUnitGetDevices
    _check_or_init_nvml()
    if __nvmlUnitGetDevices == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlUnitGetDevices is not found")
    return (<nvmlReturn_t (*)(nvmlUnit_t, unsigned int*, nvmlDevice_t*) noexcept nogil>__nvmlUnitGetDevices)(
        unit, deviceCount, devices)


cdef nvmlReturn_t _nvmlDeviceGetCount_v2(unsigned int* deviceCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetCount_v2
    _check_or_init_nvml()
    if __nvmlDeviceGetCount_v2 == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetCount_v2 is not found")
    return (<nvmlReturn_t (*)(unsigned int*) noexcept nogil>__nvmlDeviceGetCount_v2)(
        deviceCount)


cdef nvmlReturn_t _nvmlDeviceGetAttributes_v2(nvmlDevice_t device, nvmlDeviceAttributes_t* attributes) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetAttributes_v2
    _check_or_init_nvml()
    if __nvmlDeviceGetAttributes_v2 == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetAttributes_v2 is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlDeviceAttributes_t*) noexcept nogil>__nvmlDeviceGetAttributes_v2)(
        device, attributes)


cdef nvmlReturn_t _nvmlDeviceGetHandleByIndex_v2(unsigned int index, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetHandleByIndex_v2
    _check_or_init_nvml()
    if __nvmlDeviceGetHandleByIndex_v2 == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetHandleByIndex_v2 is not found")
    return (<nvmlReturn_t (*)(unsigned int, nvmlDevice_t*) noexcept nogil>__nvmlDeviceGetHandleByIndex_v2)(
        index, device)


cdef nvmlReturn_t _nvmlDeviceGetHandleBySerial(const char* serial, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetHandleBySerial
    _check_or_init_nvml()
    if __nvmlDeviceGetHandleBySerial == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetHandleBySerial is not found")
    return (<nvmlReturn_t (*)(const char*, nvmlDevice_t*) noexcept nogil>__nvmlDeviceGetHandleBySerial)(
        serial, device)


cdef nvmlReturn_t _nvmlDeviceGetHandleByUUID(const char* uuid, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetHandleByUUID
    _check_or_init_nvml()
    if __nvmlDeviceGetHandleByUUID == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetHandleByUUID is not found")
    return (<nvmlReturn_t (*)(const char*, nvmlDevice_t*) noexcept nogil>__nvmlDeviceGetHandleByUUID)(
        uuid, device)


cdef nvmlReturn_t _nvmlDeviceGetHandleByUUIDV(const nvmlUUID_t* uuid, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetHandleByUUIDV
    _check_or_init_nvml()
    if __nvmlDeviceGetHandleByUUIDV == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetHandleByUUIDV is not found")
    return (<nvmlReturn_t (*)(const nvmlUUID_t*, nvmlDevice_t*) noexcept nogil>__nvmlDeviceGetHandleByUUIDV)(
        uuid, device)


cdef nvmlReturn_t _nvmlDeviceGetHandleByPciBusId_v2(const char* pciBusId, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetHandleByPciBusId_v2
    _check_or_init_nvml()
    if __nvmlDeviceGetHandleByPciBusId_v2 == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetHandleByPciBusId_v2 is not found")
    return (<nvmlReturn_t (*)(const char*, nvmlDevice_t*) noexcept nogil>__nvmlDeviceGetHandleByPciBusId_v2)(
        pciBusId, device)


cdef nvmlReturn_t _nvmlDeviceGetName(nvmlDevice_t device, char* name, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetName
    _check_or_init_nvml()
    if __nvmlDeviceGetName == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetName is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, char*, unsigned int) noexcept nogil>__nvmlDeviceGetName)(
        device, name, length)


cdef nvmlReturn_t _nvmlDeviceGetBrand(nvmlDevice_t device, nvmlBrandType_t* type) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetBrand
    _check_or_init_nvml()
    if __nvmlDeviceGetBrand == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetBrand is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlBrandType_t*) noexcept nogil>__nvmlDeviceGetBrand)(
        device, type)


cdef nvmlReturn_t _nvmlDeviceGetIndex(nvmlDevice_t device, unsigned int* index) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetIndex
    _check_or_init_nvml()
    if __nvmlDeviceGetIndex == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetIndex is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceGetIndex)(
        device, index)


cdef nvmlReturn_t _nvmlDeviceGetSerial(nvmlDevice_t device, char* serial, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetSerial
    _check_or_init_nvml()
    if __nvmlDeviceGetSerial == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetSerial is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, char*, unsigned int) noexcept nogil>__nvmlDeviceGetSerial)(
        device, serial, length)


cdef nvmlReturn_t _nvmlDeviceGetModuleId(nvmlDevice_t device, unsigned int* moduleId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetModuleId
    _check_or_init_nvml()
    if __nvmlDeviceGetModuleId == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetModuleId is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceGetModuleId)(
        device, moduleId)


cdef nvmlReturn_t _nvmlDeviceGetC2cModeInfoV(nvmlDevice_t device, nvmlC2cModeInfo_v1_t* c2cModeInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetC2cModeInfoV
    _check_or_init_nvml()
    if __nvmlDeviceGetC2cModeInfoV == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetC2cModeInfoV is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlC2cModeInfo_v1_t*) noexcept nogil>__nvmlDeviceGetC2cModeInfoV)(
        device, c2cModeInfo)


cdef nvmlReturn_t _nvmlDeviceGetMemoryAffinity(nvmlDevice_t device, unsigned int nodeSetSize, unsigned long* nodeSet, nvmlAffinityScope_t scope) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetMemoryAffinity
    _check_or_init_nvml()
    if __nvmlDeviceGetMemoryAffinity == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetMemoryAffinity is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, unsigned long*, nvmlAffinityScope_t) noexcept nogil>__nvmlDeviceGetMemoryAffinity)(
        device, nodeSetSize, nodeSet, scope)


cdef nvmlReturn_t _nvmlDeviceGetCpuAffinityWithinScope(nvmlDevice_t device, unsigned int cpuSetSize, unsigned long* cpuSet, nvmlAffinityScope_t scope) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetCpuAffinityWithinScope
    _check_or_init_nvml()
    if __nvmlDeviceGetCpuAffinityWithinScope == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetCpuAffinityWithinScope is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, unsigned long*, nvmlAffinityScope_t) noexcept nogil>__nvmlDeviceGetCpuAffinityWithinScope)(
        device, cpuSetSize, cpuSet, scope)


cdef nvmlReturn_t _nvmlDeviceGetCpuAffinity(nvmlDevice_t device, unsigned int cpuSetSize, unsigned long* cpuSet) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetCpuAffinity
    _check_or_init_nvml()
    if __nvmlDeviceGetCpuAffinity == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetCpuAffinity is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, unsigned long*) noexcept nogil>__nvmlDeviceGetCpuAffinity)(
        device, cpuSetSize, cpuSet)


cdef nvmlReturn_t _nvmlDeviceSetCpuAffinity(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetCpuAffinity
    _check_or_init_nvml()
    if __nvmlDeviceSetCpuAffinity == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetCpuAffinity is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t) noexcept nogil>__nvmlDeviceSetCpuAffinity)(
        device)


cdef nvmlReturn_t _nvmlDeviceClearCpuAffinity(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceClearCpuAffinity
    _check_or_init_nvml()
    if __nvmlDeviceClearCpuAffinity == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceClearCpuAffinity is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t) noexcept nogil>__nvmlDeviceClearCpuAffinity)(
        device)


cdef nvmlReturn_t _nvmlDeviceGetNumaNodeId(nvmlDevice_t device, unsigned int* node) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetNumaNodeId
    _check_or_init_nvml()
    if __nvmlDeviceGetNumaNodeId == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetNumaNodeId is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceGetNumaNodeId)(
        device, node)


cdef nvmlReturn_t _nvmlDeviceGetTopologyCommonAncestor(nvmlDevice_t device1, nvmlDevice_t device2, nvmlGpuTopologyLevel_t* pathInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetTopologyCommonAncestor
    _check_or_init_nvml()
    if __nvmlDeviceGetTopologyCommonAncestor == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetTopologyCommonAncestor is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlDevice_t, nvmlGpuTopologyLevel_t*) noexcept nogil>__nvmlDeviceGetTopologyCommonAncestor)(
        device1, device2, pathInfo)


cdef nvmlReturn_t _nvmlDeviceGetTopologyNearestGpus(nvmlDevice_t device, nvmlGpuTopologyLevel_t level, unsigned int* count, nvmlDevice_t* deviceArray) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetTopologyNearestGpus
    _check_or_init_nvml()
    if __nvmlDeviceGetTopologyNearestGpus == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetTopologyNearestGpus is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlGpuTopologyLevel_t, unsigned int*, nvmlDevice_t*) noexcept nogil>__nvmlDeviceGetTopologyNearestGpus)(
        device, level, count, deviceArray)


cdef nvmlReturn_t _nvmlDeviceGetP2PStatus(nvmlDevice_t device1, nvmlDevice_t device2, nvmlGpuP2PCapsIndex_t p2pIndex, nvmlGpuP2PStatus_t* p2pStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetP2PStatus
    _check_or_init_nvml()
    if __nvmlDeviceGetP2PStatus == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetP2PStatus is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlDevice_t, nvmlGpuP2PCapsIndex_t, nvmlGpuP2PStatus_t*) noexcept nogil>__nvmlDeviceGetP2PStatus)(
        device1, device2, p2pIndex, p2pStatus)


cdef nvmlReturn_t _nvmlDeviceGetUUID(nvmlDevice_t device, char* uuid, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetUUID
    _check_or_init_nvml()
    if __nvmlDeviceGetUUID == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetUUID is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, char*, unsigned int) noexcept nogil>__nvmlDeviceGetUUID)(
        device, uuid, length)


cdef nvmlReturn_t _nvmlDeviceGetMinorNumber(nvmlDevice_t device, unsigned int* minorNumber) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetMinorNumber
    _check_or_init_nvml()
    if __nvmlDeviceGetMinorNumber == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetMinorNumber is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceGetMinorNumber)(
        device, minorNumber)


cdef nvmlReturn_t _nvmlDeviceGetBoardPartNumber(nvmlDevice_t device, char* partNumber, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetBoardPartNumber
    _check_or_init_nvml()
    if __nvmlDeviceGetBoardPartNumber == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetBoardPartNumber is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, char*, unsigned int) noexcept nogil>__nvmlDeviceGetBoardPartNumber)(
        device, partNumber, length)


cdef nvmlReturn_t _nvmlDeviceGetInforomVersion(nvmlDevice_t device, nvmlInforomObject_t object, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetInforomVersion
    _check_or_init_nvml()
    if __nvmlDeviceGetInforomVersion == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetInforomVersion is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlInforomObject_t, char*, unsigned int) noexcept nogil>__nvmlDeviceGetInforomVersion)(
        device, object, version, length)


cdef nvmlReturn_t _nvmlDeviceGetInforomImageVersion(nvmlDevice_t device, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetInforomImageVersion
    _check_or_init_nvml()
    if __nvmlDeviceGetInforomImageVersion == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetInforomImageVersion is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, char*, unsigned int) noexcept nogil>__nvmlDeviceGetInforomImageVersion)(
        device, version, length)


cdef nvmlReturn_t _nvmlDeviceGetInforomConfigurationChecksum(nvmlDevice_t device, unsigned int* checksum) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetInforomConfigurationChecksum
    _check_or_init_nvml()
    if __nvmlDeviceGetInforomConfigurationChecksum == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetInforomConfigurationChecksum is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceGetInforomConfigurationChecksum)(
        device, checksum)


cdef nvmlReturn_t _nvmlDeviceValidateInforom(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceValidateInforom
    _check_or_init_nvml()
    if __nvmlDeviceValidateInforom == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceValidateInforom is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t) noexcept nogil>__nvmlDeviceValidateInforom)(
        device)


cdef nvmlReturn_t _nvmlDeviceGetLastBBXFlushTime(nvmlDevice_t device, unsigned long long* timestamp, unsigned long* durationUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetLastBBXFlushTime
    _check_or_init_nvml()
    if __nvmlDeviceGetLastBBXFlushTime == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetLastBBXFlushTime is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned long long*, unsigned long*) noexcept nogil>__nvmlDeviceGetLastBBXFlushTime)(
        device, timestamp, durationUs)


cdef nvmlReturn_t _nvmlDeviceGetDisplayMode(nvmlDevice_t device, nvmlEnableState_t* display) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetDisplayMode
    _check_or_init_nvml()
    if __nvmlDeviceGetDisplayMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetDisplayMode is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlEnableState_t*) noexcept nogil>__nvmlDeviceGetDisplayMode)(
        device, display)


cdef nvmlReturn_t _nvmlDeviceGetDisplayActive(nvmlDevice_t device, nvmlEnableState_t* isActive) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetDisplayActive
    _check_or_init_nvml()
    if __nvmlDeviceGetDisplayActive == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetDisplayActive is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlEnableState_t*) noexcept nogil>__nvmlDeviceGetDisplayActive)(
        device, isActive)


cdef nvmlReturn_t _nvmlDeviceGetPersistenceMode(nvmlDevice_t device, nvmlEnableState_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetPersistenceMode
    _check_or_init_nvml()
    if __nvmlDeviceGetPersistenceMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetPersistenceMode is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlEnableState_t*) noexcept nogil>__nvmlDeviceGetPersistenceMode)(
        device, mode)


cdef nvmlReturn_t _nvmlDeviceGetPciInfoExt(nvmlDevice_t device, nvmlPciInfoExt_t* pci) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetPciInfoExt
    _check_or_init_nvml()
    if __nvmlDeviceGetPciInfoExt == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetPciInfoExt is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlPciInfoExt_t*) noexcept nogil>__nvmlDeviceGetPciInfoExt)(
        device, pci)


cdef nvmlReturn_t _nvmlDeviceGetPciInfo_v3(nvmlDevice_t device, nvmlPciInfo_t* pci) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetPciInfo_v3
    _check_or_init_nvml()
    if __nvmlDeviceGetPciInfo_v3 == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetPciInfo_v3 is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlPciInfo_t*) noexcept nogil>__nvmlDeviceGetPciInfo_v3)(
        device, pci)


cdef nvmlReturn_t _nvmlDeviceGetMaxPcieLinkGeneration(nvmlDevice_t device, unsigned int* maxLinkGen) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetMaxPcieLinkGeneration
    _check_or_init_nvml()
    if __nvmlDeviceGetMaxPcieLinkGeneration == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetMaxPcieLinkGeneration is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceGetMaxPcieLinkGeneration)(
        device, maxLinkGen)


cdef nvmlReturn_t _nvmlDeviceGetGpuMaxPcieLinkGeneration(nvmlDevice_t device, unsigned int* maxLinkGenDevice) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetGpuMaxPcieLinkGeneration
    _check_or_init_nvml()
    if __nvmlDeviceGetGpuMaxPcieLinkGeneration == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetGpuMaxPcieLinkGeneration is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceGetGpuMaxPcieLinkGeneration)(
        device, maxLinkGenDevice)


cdef nvmlReturn_t _nvmlDeviceGetMaxPcieLinkWidth(nvmlDevice_t device, unsigned int* maxLinkWidth) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetMaxPcieLinkWidth
    _check_or_init_nvml()
    if __nvmlDeviceGetMaxPcieLinkWidth == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetMaxPcieLinkWidth is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceGetMaxPcieLinkWidth)(
        device, maxLinkWidth)


cdef nvmlReturn_t _nvmlDeviceGetCurrPcieLinkGeneration(nvmlDevice_t device, unsigned int* currLinkGen) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetCurrPcieLinkGeneration
    _check_or_init_nvml()
    if __nvmlDeviceGetCurrPcieLinkGeneration == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetCurrPcieLinkGeneration is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceGetCurrPcieLinkGeneration)(
        device, currLinkGen)


cdef nvmlReturn_t _nvmlDeviceGetCurrPcieLinkWidth(nvmlDevice_t device, unsigned int* currLinkWidth) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetCurrPcieLinkWidth
    _check_or_init_nvml()
    if __nvmlDeviceGetCurrPcieLinkWidth == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetCurrPcieLinkWidth is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceGetCurrPcieLinkWidth)(
        device, currLinkWidth)


cdef nvmlReturn_t _nvmlDeviceGetPcieThroughput(nvmlDevice_t device, nvmlPcieUtilCounter_t counter, unsigned int* value) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetPcieThroughput
    _check_or_init_nvml()
    if __nvmlDeviceGetPcieThroughput == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetPcieThroughput is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlPcieUtilCounter_t, unsigned int*) noexcept nogil>__nvmlDeviceGetPcieThroughput)(
        device, counter, value)


cdef nvmlReturn_t _nvmlDeviceGetPcieReplayCounter(nvmlDevice_t device, unsigned int* value) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetPcieReplayCounter
    _check_or_init_nvml()
    if __nvmlDeviceGetPcieReplayCounter == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetPcieReplayCounter is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceGetPcieReplayCounter)(
        device, value)


cdef nvmlReturn_t _nvmlDeviceGetClockInfo(nvmlDevice_t device, nvmlClockType_t type, unsigned int* clock) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetClockInfo
    _check_or_init_nvml()
    if __nvmlDeviceGetClockInfo == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetClockInfo is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlClockType_t, unsigned int*) noexcept nogil>__nvmlDeviceGetClockInfo)(
        device, type, clock)


cdef nvmlReturn_t _nvmlDeviceGetMaxClockInfo(nvmlDevice_t device, nvmlClockType_t type, unsigned int* clock) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetMaxClockInfo
    _check_or_init_nvml()
    if __nvmlDeviceGetMaxClockInfo == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetMaxClockInfo is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlClockType_t, unsigned int*) noexcept nogil>__nvmlDeviceGetMaxClockInfo)(
        device, type, clock)


cdef nvmlReturn_t _nvmlDeviceGetGpcClkVfOffset(nvmlDevice_t device, int* offset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetGpcClkVfOffset
    _check_or_init_nvml()
    if __nvmlDeviceGetGpcClkVfOffset == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetGpcClkVfOffset is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, int*) noexcept nogil>__nvmlDeviceGetGpcClkVfOffset)(
        device, offset)


cdef nvmlReturn_t _nvmlDeviceGetClock(nvmlDevice_t device, nvmlClockType_t clockType, nvmlClockId_t clockId, unsigned int* clockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetClock
    _check_or_init_nvml()
    if __nvmlDeviceGetClock == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetClock is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlClockType_t, nvmlClockId_t, unsigned int*) noexcept nogil>__nvmlDeviceGetClock)(
        device, clockType, clockId, clockMHz)


cdef nvmlReturn_t _nvmlDeviceGetMaxCustomerBoostClock(nvmlDevice_t device, nvmlClockType_t clockType, unsigned int* clockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetMaxCustomerBoostClock
    _check_or_init_nvml()
    if __nvmlDeviceGetMaxCustomerBoostClock == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetMaxCustomerBoostClock is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlClockType_t, unsigned int*) noexcept nogil>__nvmlDeviceGetMaxCustomerBoostClock)(
        device, clockType, clockMHz)


cdef nvmlReturn_t _nvmlDeviceGetSupportedMemoryClocks(nvmlDevice_t device, unsigned int* count, unsigned int* clocksMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetSupportedMemoryClocks
    _check_or_init_nvml()
    if __nvmlDeviceGetSupportedMemoryClocks == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetSupportedMemoryClocks is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*, unsigned int*) noexcept nogil>__nvmlDeviceGetSupportedMemoryClocks)(
        device, count, clocksMHz)


cdef nvmlReturn_t _nvmlDeviceGetSupportedGraphicsClocks(nvmlDevice_t device, unsigned int memoryClockMHz, unsigned int* count, unsigned int* clocksMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetSupportedGraphicsClocks
    _check_or_init_nvml()
    if __nvmlDeviceGetSupportedGraphicsClocks == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetSupportedGraphicsClocks is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, unsigned int*, unsigned int*) noexcept nogil>__nvmlDeviceGetSupportedGraphicsClocks)(
        device, memoryClockMHz, count, clocksMHz)


cdef nvmlReturn_t _nvmlDeviceGetAutoBoostedClocksEnabled(nvmlDevice_t device, nvmlEnableState_t* isEnabled, nvmlEnableState_t* defaultIsEnabled) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetAutoBoostedClocksEnabled
    _check_or_init_nvml()
    if __nvmlDeviceGetAutoBoostedClocksEnabled == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetAutoBoostedClocksEnabled is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlEnableState_t*, nvmlEnableState_t*) noexcept nogil>__nvmlDeviceGetAutoBoostedClocksEnabled)(
        device, isEnabled, defaultIsEnabled)


cdef nvmlReturn_t _nvmlDeviceGetFanSpeed(nvmlDevice_t device, unsigned int* speed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetFanSpeed
    _check_or_init_nvml()
    if __nvmlDeviceGetFanSpeed == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetFanSpeed is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceGetFanSpeed)(
        device, speed)


cdef nvmlReturn_t _nvmlDeviceGetFanSpeed_v2(nvmlDevice_t device, unsigned int fan, unsigned int* speed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetFanSpeed_v2
    _check_or_init_nvml()
    if __nvmlDeviceGetFanSpeed_v2 == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetFanSpeed_v2 is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, unsigned int*) noexcept nogil>__nvmlDeviceGetFanSpeed_v2)(
        device, fan, speed)


cdef nvmlReturn_t _nvmlDeviceGetFanSpeedRPM(nvmlDevice_t device, nvmlFanSpeedInfo_t* fanSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetFanSpeedRPM
    _check_or_init_nvml()
    if __nvmlDeviceGetFanSpeedRPM == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetFanSpeedRPM is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlFanSpeedInfo_t*) noexcept nogil>__nvmlDeviceGetFanSpeedRPM)(
        device, fanSpeed)


cdef nvmlReturn_t _nvmlDeviceGetTargetFanSpeed(nvmlDevice_t device, unsigned int fan, unsigned int* targetSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetTargetFanSpeed
    _check_or_init_nvml()
    if __nvmlDeviceGetTargetFanSpeed == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetTargetFanSpeed is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, unsigned int*) noexcept nogil>__nvmlDeviceGetTargetFanSpeed)(
        device, fan, targetSpeed)


cdef nvmlReturn_t _nvmlDeviceGetMinMaxFanSpeed(nvmlDevice_t device, unsigned int* minSpeed, unsigned int* maxSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetMinMaxFanSpeed
    _check_or_init_nvml()
    if __nvmlDeviceGetMinMaxFanSpeed == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetMinMaxFanSpeed is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*, unsigned int*) noexcept nogil>__nvmlDeviceGetMinMaxFanSpeed)(
        device, minSpeed, maxSpeed)


cdef nvmlReturn_t _nvmlDeviceGetFanControlPolicy_v2(nvmlDevice_t device, unsigned int fan, nvmlFanControlPolicy_t* policy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetFanControlPolicy_v2
    _check_or_init_nvml()
    if __nvmlDeviceGetFanControlPolicy_v2 == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetFanControlPolicy_v2 is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, nvmlFanControlPolicy_t*) noexcept nogil>__nvmlDeviceGetFanControlPolicy_v2)(
        device, fan, policy)


cdef nvmlReturn_t _nvmlDeviceGetNumFans(nvmlDevice_t device, unsigned int* numFans) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetNumFans
    _check_or_init_nvml()
    if __nvmlDeviceGetNumFans == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetNumFans is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceGetNumFans)(
        device, numFans)


cdef nvmlReturn_t _nvmlDeviceGetCoolerInfo(nvmlDevice_t device, nvmlCoolerInfo_t* coolerInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetCoolerInfo
    _check_or_init_nvml()
    if __nvmlDeviceGetCoolerInfo == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetCoolerInfo is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlCoolerInfo_t*) noexcept nogil>__nvmlDeviceGetCoolerInfo)(
        device, coolerInfo)


cdef nvmlReturn_t _nvmlDeviceGetTemperatureV(nvmlDevice_t device, nvmlTemperature_t* temperature) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetTemperatureV
    _check_or_init_nvml()
    if __nvmlDeviceGetTemperatureV == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetTemperatureV is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlTemperature_t*) noexcept nogil>__nvmlDeviceGetTemperatureV)(
        device, temperature)


cdef nvmlReturn_t _nvmlDeviceGetTemperatureThreshold(nvmlDevice_t device, nvmlTemperatureThresholds_t thresholdType, unsigned int* temp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetTemperatureThreshold
    _check_or_init_nvml()
    if __nvmlDeviceGetTemperatureThreshold == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetTemperatureThreshold is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlTemperatureThresholds_t, unsigned int*) noexcept nogil>__nvmlDeviceGetTemperatureThreshold)(
        device, thresholdType, temp)


cdef nvmlReturn_t _nvmlDeviceGetMarginTemperature(nvmlDevice_t device, nvmlMarginTemperature_t* marginTempInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetMarginTemperature
    _check_or_init_nvml()
    if __nvmlDeviceGetMarginTemperature == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetMarginTemperature is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlMarginTemperature_t*) noexcept nogil>__nvmlDeviceGetMarginTemperature)(
        device, marginTempInfo)


cdef nvmlReturn_t _nvmlDeviceGetThermalSettings(nvmlDevice_t device, unsigned int sensorIndex, nvmlGpuThermalSettings_t* pThermalSettings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetThermalSettings
    _check_or_init_nvml()
    if __nvmlDeviceGetThermalSettings == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetThermalSettings is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, nvmlGpuThermalSettings_t*) noexcept nogil>__nvmlDeviceGetThermalSettings)(
        device, sensorIndex, pThermalSettings)


cdef nvmlReturn_t _nvmlDeviceGetPerformanceState(nvmlDevice_t device, nvmlPstates_t* pState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetPerformanceState
    _check_or_init_nvml()
    if __nvmlDeviceGetPerformanceState == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetPerformanceState is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlPstates_t*) noexcept nogil>__nvmlDeviceGetPerformanceState)(
        device, pState)


cdef nvmlReturn_t _nvmlDeviceGetCurrentClocksEventReasons(nvmlDevice_t device, unsigned long long* clocksEventReasons) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetCurrentClocksEventReasons
    _check_or_init_nvml()
    if __nvmlDeviceGetCurrentClocksEventReasons == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetCurrentClocksEventReasons is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned long long*) noexcept nogil>__nvmlDeviceGetCurrentClocksEventReasons)(
        device, clocksEventReasons)


cdef nvmlReturn_t _nvmlDeviceGetSupportedClocksEventReasons(nvmlDevice_t device, unsigned long long* supportedClocksEventReasons) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetSupportedClocksEventReasons
    _check_or_init_nvml()
    if __nvmlDeviceGetSupportedClocksEventReasons == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetSupportedClocksEventReasons is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned long long*) noexcept nogil>__nvmlDeviceGetSupportedClocksEventReasons)(
        device, supportedClocksEventReasons)


cdef nvmlReturn_t _nvmlDeviceGetPowerState(nvmlDevice_t device, nvmlPstates_t* pState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetPowerState
    _check_or_init_nvml()
    if __nvmlDeviceGetPowerState == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetPowerState is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlPstates_t*) noexcept nogil>__nvmlDeviceGetPowerState)(
        device, pState)


cdef nvmlReturn_t _nvmlDeviceGetDynamicPstatesInfo(nvmlDevice_t device, nvmlGpuDynamicPstatesInfo_t* pDynamicPstatesInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetDynamicPstatesInfo
    _check_or_init_nvml()
    if __nvmlDeviceGetDynamicPstatesInfo == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetDynamicPstatesInfo is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlGpuDynamicPstatesInfo_t*) noexcept nogil>__nvmlDeviceGetDynamicPstatesInfo)(
        device, pDynamicPstatesInfo)


cdef nvmlReturn_t _nvmlDeviceGetMemClkVfOffset(nvmlDevice_t device, int* offset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetMemClkVfOffset
    _check_or_init_nvml()
    if __nvmlDeviceGetMemClkVfOffset == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetMemClkVfOffset is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, int*) noexcept nogil>__nvmlDeviceGetMemClkVfOffset)(
        device, offset)


cdef nvmlReturn_t _nvmlDeviceGetMinMaxClockOfPState(nvmlDevice_t device, nvmlClockType_t type, nvmlPstates_t pstate, unsigned int* minClockMHz, unsigned int* maxClockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetMinMaxClockOfPState
    _check_or_init_nvml()
    if __nvmlDeviceGetMinMaxClockOfPState == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetMinMaxClockOfPState is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlClockType_t, nvmlPstates_t, unsigned int*, unsigned int*) noexcept nogil>__nvmlDeviceGetMinMaxClockOfPState)(
        device, type, pstate, minClockMHz, maxClockMHz)


cdef nvmlReturn_t _nvmlDeviceGetSupportedPerformanceStates(nvmlDevice_t device, nvmlPstates_t* pstates, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetSupportedPerformanceStates
    _check_or_init_nvml()
    if __nvmlDeviceGetSupportedPerformanceStates == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetSupportedPerformanceStates is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlPstates_t*, unsigned int) noexcept nogil>__nvmlDeviceGetSupportedPerformanceStates)(
        device, pstates, size)


cdef nvmlReturn_t _nvmlDeviceGetGpcClkMinMaxVfOffset(nvmlDevice_t device, int* minOffset, int* maxOffset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetGpcClkMinMaxVfOffset
    _check_or_init_nvml()
    if __nvmlDeviceGetGpcClkMinMaxVfOffset == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetGpcClkMinMaxVfOffset is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, int*, int*) noexcept nogil>__nvmlDeviceGetGpcClkMinMaxVfOffset)(
        device, minOffset, maxOffset)


cdef nvmlReturn_t _nvmlDeviceGetMemClkMinMaxVfOffset(nvmlDevice_t device, int* minOffset, int* maxOffset) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetMemClkMinMaxVfOffset
    _check_or_init_nvml()
    if __nvmlDeviceGetMemClkMinMaxVfOffset == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetMemClkMinMaxVfOffset is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, int*, int*) noexcept nogil>__nvmlDeviceGetMemClkMinMaxVfOffset)(
        device, minOffset, maxOffset)


cdef nvmlReturn_t _nvmlDeviceGetClockOffsets(nvmlDevice_t device, nvmlClockOffset_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetClockOffsets
    _check_or_init_nvml()
    if __nvmlDeviceGetClockOffsets == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetClockOffsets is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlClockOffset_t*) noexcept nogil>__nvmlDeviceGetClockOffsets)(
        device, info)


cdef nvmlReturn_t _nvmlDeviceSetClockOffsets(nvmlDevice_t device, nvmlClockOffset_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetClockOffsets
    _check_or_init_nvml()
    if __nvmlDeviceSetClockOffsets == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetClockOffsets is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlClockOffset_t*) noexcept nogil>__nvmlDeviceSetClockOffsets)(
        device, info)


cdef nvmlReturn_t _nvmlDeviceGetPerformanceModes(nvmlDevice_t device, nvmlDevicePerfModes_t* perfModes) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetPerformanceModes
    _check_or_init_nvml()
    if __nvmlDeviceGetPerformanceModes == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetPerformanceModes is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlDevicePerfModes_t*) noexcept nogil>__nvmlDeviceGetPerformanceModes)(
        device, perfModes)


cdef nvmlReturn_t _nvmlDeviceGetCurrentClockFreqs(nvmlDevice_t device, nvmlDeviceCurrentClockFreqs_t* currentClockFreqs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetCurrentClockFreqs
    _check_or_init_nvml()
    if __nvmlDeviceGetCurrentClockFreqs == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetCurrentClockFreqs is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlDeviceCurrentClockFreqs_t*) noexcept nogil>__nvmlDeviceGetCurrentClockFreqs)(
        device, currentClockFreqs)


cdef nvmlReturn_t _nvmlDeviceGetPowerManagementLimit(nvmlDevice_t device, unsigned int* limit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetPowerManagementLimit
    _check_or_init_nvml()
    if __nvmlDeviceGetPowerManagementLimit == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetPowerManagementLimit is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceGetPowerManagementLimit)(
        device, limit)


cdef nvmlReturn_t _nvmlDeviceGetPowerManagementLimitConstraints(nvmlDevice_t device, unsigned int* minLimit, unsigned int* maxLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetPowerManagementLimitConstraints
    _check_or_init_nvml()
    if __nvmlDeviceGetPowerManagementLimitConstraints == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetPowerManagementLimitConstraints is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*, unsigned int*) noexcept nogil>__nvmlDeviceGetPowerManagementLimitConstraints)(
        device, minLimit, maxLimit)


cdef nvmlReturn_t _nvmlDeviceGetPowerManagementDefaultLimit(nvmlDevice_t device, unsigned int* defaultLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetPowerManagementDefaultLimit
    _check_or_init_nvml()
    if __nvmlDeviceGetPowerManagementDefaultLimit == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetPowerManagementDefaultLimit is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceGetPowerManagementDefaultLimit)(
        device, defaultLimit)


cdef nvmlReturn_t _nvmlDeviceGetPowerUsage(nvmlDevice_t device, unsigned int* power) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetPowerUsage
    _check_or_init_nvml()
    if __nvmlDeviceGetPowerUsage == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetPowerUsage is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceGetPowerUsage)(
        device, power)


cdef nvmlReturn_t _nvmlDeviceGetTotalEnergyConsumption(nvmlDevice_t device, unsigned long long* energy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetTotalEnergyConsumption
    _check_or_init_nvml()
    if __nvmlDeviceGetTotalEnergyConsumption == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetTotalEnergyConsumption is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned long long*) noexcept nogil>__nvmlDeviceGetTotalEnergyConsumption)(
        device, energy)


cdef nvmlReturn_t _nvmlDeviceGetEnforcedPowerLimit(nvmlDevice_t device, unsigned int* limit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetEnforcedPowerLimit
    _check_or_init_nvml()
    if __nvmlDeviceGetEnforcedPowerLimit == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetEnforcedPowerLimit is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceGetEnforcedPowerLimit)(
        device, limit)


cdef nvmlReturn_t _nvmlDeviceGetGpuOperationMode(nvmlDevice_t device, nvmlGpuOperationMode_t* current, nvmlGpuOperationMode_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetGpuOperationMode
    _check_or_init_nvml()
    if __nvmlDeviceGetGpuOperationMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetGpuOperationMode is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlGpuOperationMode_t*, nvmlGpuOperationMode_t*) noexcept nogil>__nvmlDeviceGetGpuOperationMode)(
        device, current, pending)


cdef nvmlReturn_t _nvmlDeviceGetMemoryInfo_v2(nvmlDevice_t device, nvmlMemory_v2_t* memory) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetMemoryInfo_v2
    _check_or_init_nvml()
    if __nvmlDeviceGetMemoryInfo_v2 == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetMemoryInfo_v2 is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlMemory_v2_t*) noexcept nogil>__nvmlDeviceGetMemoryInfo_v2)(
        device, memory)


cdef nvmlReturn_t _nvmlDeviceGetComputeMode(nvmlDevice_t device, nvmlComputeMode_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetComputeMode
    _check_or_init_nvml()
    if __nvmlDeviceGetComputeMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetComputeMode is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlComputeMode_t*) noexcept nogil>__nvmlDeviceGetComputeMode)(
        device, mode)


cdef nvmlReturn_t _nvmlDeviceGetCudaComputeCapability(nvmlDevice_t device, int* major, int* minor) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetCudaComputeCapability
    _check_or_init_nvml()
    if __nvmlDeviceGetCudaComputeCapability == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetCudaComputeCapability is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, int*, int*) noexcept nogil>__nvmlDeviceGetCudaComputeCapability)(
        device, major, minor)


cdef nvmlReturn_t _nvmlDeviceGetDramEncryptionMode(nvmlDevice_t device, nvmlDramEncryptionInfo_t* current, nvmlDramEncryptionInfo_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetDramEncryptionMode
    _check_or_init_nvml()
    if __nvmlDeviceGetDramEncryptionMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetDramEncryptionMode is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlDramEncryptionInfo_t*, nvmlDramEncryptionInfo_t*) noexcept nogil>__nvmlDeviceGetDramEncryptionMode)(
        device, current, pending)


cdef nvmlReturn_t _nvmlDeviceSetDramEncryptionMode(nvmlDevice_t device, const nvmlDramEncryptionInfo_t* dramEncryption) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetDramEncryptionMode
    _check_or_init_nvml()
    if __nvmlDeviceSetDramEncryptionMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetDramEncryptionMode is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, const nvmlDramEncryptionInfo_t*) noexcept nogil>__nvmlDeviceSetDramEncryptionMode)(
        device, dramEncryption)


cdef nvmlReturn_t _nvmlDeviceGetEccMode(nvmlDevice_t device, nvmlEnableState_t* current, nvmlEnableState_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetEccMode
    _check_or_init_nvml()
    if __nvmlDeviceGetEccMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetEccMode is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlEnableState_t*, nvmlEnableState_t*) noexcept nogil>__nvmlDeviceGetEccMode)(
        device, current, pending)


cdef nvmlReturn_t _nvmlDeviceGetDefaultEccMode(nvmlDevice_t device, nvmlEnableState_t* defaultMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetDefaultEccMode
    _check_or_init_nvml()
    if __nvmlDeviceGetDefaultEccMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetDefaultEccMode is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlEnableState_t*) noexcept nogil>__nvmlDeviceGetDefaultEccMode)(
        device, defaultMode)


cdef nvmlReturn_t _nvmlDeviceGetBoardId(nvmlDevice_t device, unsigned int* boardId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetBoardId
    _check_or_init_nvml()
    if __nvmlDeviceGetBoardId == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetBoardId is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceGetBoardId)(
        device, boardId)


cdef nvmlReturn_t _nvmlDeviceGetMultiGpuBoard(nvmlDevice_t device, unsigned int* multiGpuBool) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetMultiGpuBoard
    _check_or_init_nvml()
    if __nvmlDeviceGetMultiGpuBoard == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetMultiGpuBoard is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceGetMultiGpuBoard)(
        device, multiGpuBool)


cdef nvmlReturn_t _nvmlDeviceGetTotalEccErrors(nvmlDevice_t device, nvmlMemoryErrorType_t errorType, nvmlEccCounterType_t counterType, unsigned long long* eccCounts) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetTotalEccErrors
    _check_or_init_nvml()
    if __nvmlDeviceGetTotalEccErrors == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetTotalEccErrors is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlMemoryErrorType_t, nvmlEccCounterType_t, unsigned long long*) noexcept nogil>__nvmlDeviceGetTotalEccErrors)(
        device, errorType, counterType, eccCounts)


cdef nvmlReturn_t _nvmlDeviceGetMemoryErrorCounter(nvmlDevice_t device, nvmlMemoryErrorType_t errorType, nvmlEccCounterType_t counterType, nvmlMemoryLocation_t locationType, unsigned long long* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetMemoryErrorCounter
    _check_or_init_nvml()
    if __nvmlDeviceGetMemoryErrorCounter == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetMemoryErrorCounter is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlMemoryErrorType_t, nvmlEccCounterType_t, nvmlMemoryLocation_t, unsigned long long*) noexcept nogil>__nvmlDeviceGetMemoryErrorCounter)(
        device, errorType, counterType, locationType, count)


cdef nvmlReturn_t _nvmlDeviceGetUtilizationRates(nvmlDevice_t device, nvmlUtilization_t* utilization) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetUtilizationRates
    _check_or_init_nvml()
    if __nvmlDeviceGetUtilizationRates == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetUtilizationRates is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlUtilization_t*) noexcept nogil>__nvmlDeviceGetUtilizationRates)(
        device, utilization)


cdef nvmlReturn_t _nvmlDeviceGetEncoderUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetEncoderUtilization
    _check_or_init_nvml()
    if __nvmlDeviceGetEncoderUtilization == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetEncoderUtilization is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*, unsigned int*) noexcept nogil>__nvmlDeviceGetEncoderUtilization)(
        device, utilization, samplingPeriodUs)


cdef nvmlReturn_t _nvmlDeviceGetEncoderCapacity(nvmlDevice_t device, nvmlEncoderType_t encoderQueryType, unsigned int* encoderCapacity) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetEncoderCapacity
    _check_or_init_nvml()
    if __nvmlDeviceGetEncoderCapacity == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetEncoderCapacity is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlEncoderType_t, unsigned int*) noexcept nogil>__nvmlDeviceGetEncoderCapacity)(
        device, encoderQueryType, encoderCapacity)


cdef nvmlReturn_t _nvmlDeviceGetEncoderStats(nvmlDevice_t device, unsigned int* sessionCount, unsigned int* averageFps, unsigned int* averageLatency) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetEncoderStats
    _check_or_init_nvml()
    if __nvmlDeviceGetEncoderStats == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetEncoderStats is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*, unsigned int*, unsigned int*) noexcept nogil>__nvmlDeviceGetEncoderStats)(
        device, sessionCount, averageFps, averageLatency)


cdef nvmlReturn_t _nvmlDeviceGetEncoderSessions(nvmlDevice_t device, unsigned int* sessionCount, nvmlEncoderSessionInfo_t* sessionInfos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetEncoderSessions
    _check_or_init_nvml()
    if __nvmlDeviceGetEncoderSessions == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetEncoderSessions is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*, nvmlEncoderSessionInfo_t*) noexcept nogil>__nvmlDeviceGetEncoderSessions)(
        device, sessionCount, sessionInfos)


cdef nvmlReturn_t _nvmlDeviceGetDecoderUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetDecoderUtilization
    _check_or_init_nvml()
    if __nvmlDeviceGetDecoderUtilization == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetDecoderUtilization is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*, unsigned int*) noexcept nogil>__nvmlDeviceGetDecoderUtilization)(
        device, utilization, samplingPeriodUs)


cdef nvmlReturn_t _nvmlDeviceGetJpgUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetJpgUtilization
    _check_or_init_nvml()
    if __nvmlDeviceGetJpgUtilization == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetJpgUtilization is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*, unsigned int*) noexcept nogil>__nvmlDeviceGetJpgUtilization)(
        device, utilization, samplingPeriodUs)


cdef nvmlReturn_t _nvmlDeviceGetOfaUtilization(nvmlDevice_t device, unsigned int* utilization, unsigned int* samplingPeriodUs) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetOfaUtilization
    _check_or_init_nvml()
    if __nvmlDeviceGetOfaUtilization == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetOfaUtilization is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*, unsigned int*) noexcept nogil>__nvmlDeviceGetOfaUtilization)(
        device, utilization, samplingPeriodUs)


cdef nvmlReturn_t _nvmlDeviceGetFBCStats(nvmlDevice_t device, nvmlFBCStats_t* fbcStats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetFBCStats
    _check_or_init_nvml()
    if __nvmlDeviceGetFBCStats == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetFBCStats is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlFBCStats_t*) noexcept nogil>__nvmlDeviceGetFBCStats)(
        device, fbcStats)


cdef nvmlReturn_t _nvmlDeviceGetFBCSessions(nvmlDevice_t device, unsigned int* sessionCount, nvmlFBCSessionInfo_t* sessionInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetFBCSessions
    _check_or_init_nvml()
    if __nvmlDeviceGetFBCSessions == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetFBCSessions is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*, nvmlFBCSessionInfo_t*) noexcept nogil>__nvmlDeviceGetFBCSessions)(
        device, sessionCount, sessionInfo)


cdef nvmlReturn_t _nvmlDeviceGetDriverModel_v2(nvmlDevice_t device, nvmlDriverModel_t* current, nvmlDriverModel_t* pending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetDriverModel_v2
    _check_or_init_nvml()
    if __nvmlDeviceGetDriverModel_v2 == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetDriverModel_v2 is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlDriverModel_t*, nvmlDriverModel_t*) noexcept nogil>__nvmlDeviceGetDriverModel_v2)(
        device, current, pending)


cdef nvmlReturn_t _nvmlDeviceGetVbiosVersion(nvmlDevice_t device, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetVbiosVersion
    _check_or_init_nvml()
    if __nvmlDeviceGetVbiosVersion == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetVbiosVersion is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, char*, unsigned int) noexcept nogil>__nvmlDeviceGetVbiosVersion)(
        device, version, length)


cdef nvmlReturn_t _nvmlDeviceGetBridgeChipInfo(nvmlDevice_t device, nvmlBridgeChipHierarchy_t* bridgeHierarchy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetBridgeChipInfo
    _check_or_init_nvml()
    if __nvmlDeviceGetBridgeChipInfo == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetBridgeChipInfo is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlBridgeChipHierarchy_t*) noexcept nogil>__nvmlDeviceGetBridgeChipInfo)(
        device, bridgeHierarchy)


cdef nvmlReturn_t _nvmlDeviceGetComputeRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetComputeRunningProcesses_v3
    _check_or_init_nvml()
    if __nvmlDeviceGetComputeRunningProcesses_v3 == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetComputeRunningProcesses_v3 is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*, nvmlProcessInfo_t*) noexcept nogil>__nvmlDeviceGetComputeRunningProcesses_v3)(
        device, infoCount, infos)


cdef nvmlReturn_t _nvmlDeviceGetMPSComputeRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetMPSComputeRunningProcesses_v3
    _check_or_init_nvml()
    if __nvmlDeviceGetMPSComputeRunningProcesses_v3 == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetMPSComputeRunningProcesses_v3 is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*, nvmlProcessInfo_t*) noexcept nogil>__nvmlDeviceGetMPSComputeRunningProcesses_v3)(
        device, infoCount, infos)


cdef nvmlReturn_t _nvmlDeviceGetRunningProcessDetailList(nvmlDevice_t device, nvmlProcessDetailList_t* plist) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetRunningProcessDetailList
    _check_or_init_nvml()
    if __nvmlDeviceGetRunningProcessDetailList == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetRunningProcessDetailList is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlProcessDetailList_t*) noexcept nogil>__nvmlDeviceGetRunningProcessDetailList)(
        device, plist)


cdef nvmlReturn_t _nvmlDeviceOnSameBoard(nvmlDevice_t device1, nvmlDevice_t device2, int* onSameBoard) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceOnSameBoard
    _check_or_init_nvml()
    if __nvmlDeviceOnSameBoard == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceOnSameBoard is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlDevice_t, int*) noexcept nogil>__nvmlDeviceOnSameBoard)(
        device1, device2, onSameBoard)


cdef nvmlReturn_t _nvmlDeviceGetAPIRestriction(nvmlDevice_t device, nvmlRestrictedAPI_t apiType, nvmlEnableState_t* isRestricted) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetAPIRestriction
    _check_or_init_nvml()
    if __nvmlDeviceGetAPIRestriction == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetAPIRestriction is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlRestrictedAPI_t, nvmlEnableState_t*) noexcept nogil>__nvmlDeviceGetAPIRestriction)(
        device, apiType, isRestricted)


cdef nvmlReturn_t _nvmlDeviceGetSamples(nvmlDevice_t device, nvmlSamplingType_t type, unsigned long long lastSeenTimeStamp, nvmlValueType_t* sampleValType, unsigned int* sampleCount, nvmlSample_t* samples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetSamples
    _check_or_init_nvml()
    if __nvmlDeviceGetSamples == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetSamples is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlSamplingType_t, unsigned long long, nvmlValueType_t*, unsigned int*, nvmlSample_t*) noexcept nogil>__nvmlDeviceGetSamples)(
        device, type, lastSeenTimeStamp, sampleValType, sampleCount, samples)


cdef nvmlReturn_t _nvmlDeviceGetBAR1MemoryInfo(nvmlDevice_t device, nvmlBAR1Memory_t* bar1Memory) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetBAR1MemoryInfo
    _check_or_init_nvml()
    if __nvmlDeviceGetBAR1MemoryInfo == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetBAR1MemoryInfo is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlBAR1Memory_t*) noexcept nogil>__nvmlDeviceGetBAR1MemoryInfo)(
        device, bar1Memory)


cdef nvmlReturn_t _nvmlDeviceGetIrqNum(nvmlDevice_t device, unsigned int* irqNum) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetIrqNum
    _check_or_init_nvml()
    if __nvmlDeviceGetIrqNum == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetIrqNum is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceGetIrqNum)(
        device, irqNum)


cdef nvmlReturn_t _nvmlDeviceGetNumGpuCores(nvmlDevice_t device, unsigned int* numCores) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetNumGpuCores
    _check_or_init_nvml()
    if __nvmlDeviceGetNumGpuCores == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetNumGpuCores is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceGetNumGpuCores)(
        device, numCores)


cdef nvmlReturn_t _nvmlDeviceGetPowerSource(nvmlDevice_t device, nvmlPowerSource_t* powerSource) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetPowerSource
    _check_or_init_nvml()
    if __nvmlDeviceGetPowerSource == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetPowerSource is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlPowerSource_t*) noexcept nogil>__nvmlDeviceGetPowerSource)(
        device, powerSource)


cdef nvmlReturn_t _nvmlDeviceGetMemoryBusWidth(nvmlDevice_t device, unsigned int* busWidth) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetMemoryBusWidth
    _check_or_init_nvml()
    if __nvmlDeviceGetMemoryBusWidth == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetMemoryBusWidth is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceGetMemoryBusWidth)(
        device, busWidth)


cdef nvmlReturn_t _nvmlDeviceGetPcieLinkMaxSpeed(nvmlDevice_t device, unsigned int* maxSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetPcieLinkMaxSpeed
    _check_or_init_nvml()
    if __nvmlDeviceGetPcieLinkMaxSpeed == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetPcieLinkMaxSpeed is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceGetPcieLinkMaxSpeed)(
        device, maxSpeed)


cdef nvmlReturn_t _nvmlDeviceGetPcieSpeed(nvmlDevice_t device, unsigned int* pcieSpeed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetPcieSpeed
    _check_or_init_nvml()
    if __nvmlDeviceGetPcieSpeed == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetPcieSpeed is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceGetPcieSpeed)(
        device, pcieSpeed)


cdef nvmlReturn_t _nvmlDeviceGetAdaptiveClockInfoStatus(nvmlDevice_t device, unsigned int* adaptiveClockStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetAdaptiveClockInfoStatus
    _check_or_init_nvml()
    if __nvmlDeviceGetAdaptiveClockInfoStatus == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetAdaptiveClockInfoStatus is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceGetAdaptiveClockInfoStatus)(
        device, adaptiveClockStatus)


cdef nvmlReturn_t _nvmlDeviceGetBusType(nvmlDevice_t device, nvmlBusType_t* type) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetBusType
    _check_or_init_nvml()
    if __nvmlDeviceGetBusType == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetBusType is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlBusType_t*) noexcept nogil>__nvmlDeviceGetBusType)(
        device, type)


cdef nvmlReturn_t _nvmlDeviceGetGpuFabricInfoV(nvmlDevice_t device, nvmlGpuFabricInfoV_t* gpuFabricInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetGpuFabricInfoV
    _check_or_init_nvml()
    if __nvmlDeviceGetGpuFabricInfoV == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetGpuFabricInfoV is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlGpuFabricInfoV_t*) noexcept nogil>__nvmlDeviceGetGpuFabricInfoV)(
        device, gpuFabricInfo)


cdef nvmlReturn_t _nvmlSystemGetConfComputeCapabilities(nvmlConfComputeSystemCaps_t* capabilities) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlSystemGetConfComputeCapabilities
    _check_or_init_nvml()
    if __nvmlSystemGetConfComputeCapabilities == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlSystemGetConfComputeCapabilities is not found")
    return (<nvmlReturn_t (*)(nvmlConfComputeSystemCaps_t*) noexcept nogil>__nvmlSystemGetConfComputeCapabilities)(
        capabilities)


cdef nvmlReturn_t _nvmlSystemGetConfComputeState(nvmlConfComputeSystemState_t* state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlSystemGetConfComputeState
    _check_or_init_nvml()
    if __nvmlSystemGetConfComputeState == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlSystemGetConfComputeState is not found")
    return (<nvmlReturn_t (*)(nvmlConfComputeSystemState_t*) noexcept nogil>__nvmlSystemGetConfComputeState)(
        state)


cdef nvmlReturn_t _nvmlDeviceGetConfComputeMemSizeInfo(nvmlDevice_t device, nvmlConfComputeMemSizeInfo_t* memInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetConfComputeMemSizeInfo
    _check_or_init_nvml()
    if __nvmlDeviceGetConfComputeMemSizeInfo == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetConfComputeMemSizeInfo is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlConfComputeMemSizeInfo_t*) noexcept nogil>__nvmlDeviceGetConfComputeMemSizeInfo)(
        device, memInfo)


cdef nvmlReturn_t _nvmlSystemGetConfComputeGpusReadyState(unsigned int* isAcceptingWork) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlSystemGetConfComputeGpusReadyState
    _check_or_init_nvml()
    if __nvmlSystemGetConfComputeGpusReadyState == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlSystemGetConfComputeGpusReadyState is not found")
    return (<nvmlReturn_t (*)(unsigned int*) noexcept nogil>__nvmlSystemGetConfComputeGpusReadyState)(
        isAcceptingWork)


cdef nvmlReturn_t _nvmlDeviceGetConfComputeProtectedMemoryUsage(nvmlDevice_t device, nvmlMemory_t* memory) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetConfComputeProtectedMemoryUsage
    _check_or_init_nvml()
    if __nvmlDeviceGetConfComputeProtectedMemoryUsage == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetConfComputeProtectedMemoryUsage is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlMemory_t*) noexcept nogil>__nvmlDeviceGetConfComputeProtectedMemoryUsage)(
        device, memory)


cdef nvmlReturn_t _nvmlDeviceGetConfComputeGpuCertificate(nvmlDevice_t device, nvmlConfComputeGpuCertificate_t* gpuCert) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetConfComputeGpuCertificate
    _check_or_init_nvml()
    if __nvmlDeviceGetConfComputeGpuCertificate == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetConfComputeGpuCertificate is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlConfComputeGpuCertificate_t*) noexcept nogil>__nvmlDeviceGetConfComputeGpuCertificate)(
        device, gpuCert)


cdef nvmlReturn_t _nvmlDeviceGetConfComputeGpuAttestationReport(nvmlDevice_t device, nvmlConfComputeGpuAttestationReport_t* gpuAtstReport) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetConfComputeGpuAttestationReport
    _check_or_init_nvml()
    if __nvmlDeviceGetConfComputeGpuAttestationReport == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetConfComputeGpuAttestationReport is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlConfComputeGpuAttestationReport_t*) noexcept nogil>__nvmlDeviceGetConfComputeGpuAttestationReport)(
        device, gpuAtstReport)


cdef nvmlReturn_t _nvmlSystemGetConfComputeKeyRotationThresholdInfo(nvmlConfComputeGetKeyRotationThresholdInfo_t* pKeyRotationThrInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlSystemGetConfComputeKeyRotationThresholdInfo
    _check_or_init_nvml()
    if __nvmlSystemGetConfComputeKeyRotationThresholdInfo == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlSystemGetConfComputeKeyRotationThresholdInfo is not found")
    return (<nvmlReturn_t (*)(nvmlConfComputeGetKeyRotationThresholdInfo_t*) noexcept nogil>__nvmlSystemGetConfComputeKeyRotationThresholdInfo)(
        pKeyRotationThrInfo)


cdef nvmlReturn_t _nvmlDeviceSetConfComputeUnprotectedMemSize(nvmlDevice_t device, unsigned long long sizeKiB) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetConfComputeUnprotectedMemSize
    _check_or_init_nvml()
    if __nvmlDeviceSetConfComputeUnprotectedMemSize == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetConfComputeUnprotectedMemSize is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned long long) noexcept nogil>__nvmlDeviceSetConfComputeUnprotectedMemSize)(
        device, sizeKiB)


cdef nvmlReturn_t _nvmlSystemSetConfComputeGpusReadyState(unsigned int isAcceptingWork) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlSystemSetConfComputeGpusReadyState
    _check_or_init_nvml()
    if __nvmlSystemSetConfComputeGpusReadyState == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlSystemSetConfComputeGpusReadyState is not found")
    return (<nvmlReturn_t (*)(unsigned int) noexcept nogil>__nvmlSystemSetConfComputeGpusReadyState)(
        isAcceptingWork)


cdef nvmlReturn_t _nvmlSystemSetConfComputeKeyRotationThresholdInfo(nvmlConfComputeSetKeyRotationThresholdInfo_t* pKeyRotationThrInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlSystemSetConfComputeKeyRotationThresholdInfo
    _check_or_init_nvml()
    if __nvmlSystemSetConfComputeKeyRotationThresholdInfo == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlSystemSetConfComputeKeyRotationThresholdInfo is not found")
    return (<nvmlReturn_t (*)(nvmlConfComputeSetKeyRotationThresholdInfo_t*) noexcept nogil>__nvmlSystemSetConfComputeKeyRotationThresholdInfo)(
        pKeyRotationThrInfo)


cdef nvmlReturn_t _nvmlSystemGetConfComputeSettings(nvmlSystemConfComputeSettings_t* settings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlSystemGetConfComputeSettings
    _check_or_init_nvml()
    if __nvmlSystemGetConfComputeSettings == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlSystemGetConfComputeSettings is not found")
    return (<nvmlReturn_t (*)(nvmlSystemConfComputeSettings_t*) noexcept nogil>__nvmlSystemGetConfComputeSettings)(
        settings)


cdef nvmlReturn_t _nvmlDeviceGetGspFirmwareVersion(nvmlDevice_t device, char* version) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetGspFirmwareVersion
    _check_or_init_nvml()
    if __nvmlDeviceGetGspFirmwareVersion == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetGspFirmwareVersion is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, char*) noexcept nogil>__nvmlDeviceGetGspFirmwareVersion)(
        device, version)


cdef nvmlReturn_t _nvmlDeviceGetGspFirmwareMode(nvmlDevice_t device, unsigned int* isEnabled, unsigned int* defaultMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetGspFirmwareMode
    _check_or_init_nvml()
    if __nvmlDeviceGetGspFirmwareMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetGspFirmwareMode is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*, unsigned int*) noexcept nogil>__nvmlDeviceGetGspFirmwareMode)(
        device, isEnabled, defaultMode)


cdef nvmlReturn_t _nvmlDeviceGetSramEccErrorStatus(nvmlDevice_t device, nvmlEccSramErrorStatus_t* status) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetSramEccErrorStatus
    _check_or_init_nvml()
    if __nvmlDeviceGetSramEccErrorStatus == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetSramEccErrorStatus is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlEccSramErrorStatus_t*) noexcept nogil>__nvmlDeviceGetSramEccErrorStatus)(
        device, status)


cdef nvmlReturn_t _nvmlDeviceGetAccountingMode(nvmlDevice_t device, nvmlEnableState_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetAccountingMode
    _check_or_init_nvml()
    if __nvmlDeviceGetAccountingMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetAccountingMode is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlEnableState_t*) noexcept nogil>__nvmlDeviceGetAccountingMode)(
        device, mode)


cdef nvmlReturn_t _nvmlDeviceGetAccountingStats(nvmlDevice_t device, unsigned int pid, nvmlAccountingStats_t* stats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetAccountingStats
    _check_or_init_nvml()
    if __nvmlDeviceGetAccountingStats == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetAccountingStats is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, nvmlAccountingStats_t*) noexcept nogil>__nvmlDeviceGetAccountingStats)(
        device, pid, stats)


cdef nvmlReturn_t _nvmlDeviceGetAccountingPids(nvmlDevice_t device, unsigned int* count, unsigned int* pids) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetAccountingPids
    _check_or_init_nvml()
    if __nvmlDeviceGetAccountingPids == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetAccountingPids is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*, unsigned int*) noexcept nogil>__nvmlDeviceGetAccountingPids)(
        device, count, pids)


cdef nvmlReturn_t _nvmlDeviceGetAccountingBufferSize(nvmlDevice_t device, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetAccountingBufferSize
    _check_or_init_nvml()
    if __nvmlDeviceGetAccountingBufferSize == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetAccountingBufferSize is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceGetAccountingBufferSize)(
        device, bufferSize)


cdef nvmlReturn_t _nvmlDeviceGetRetiredPages(nvmlDevice_t device, nvmlPageRetirementCause_t cause, unsigned int* pageCount, unsigned long long* addresses) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetRetiredPages
    _check_or_init_nvml()
    if __nvmlDeviceGetRetiredPages == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetRetiredPages is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlPageRetirementCause_t, unsigned int*, unsigned long long*) noexcept nogil>__nvmlDeviceGetRetiredPages)(
        device, cause, pageCount, addresses)


cdef nvmlReturn_t _nvmlDeviceGetRetiredPages_v2(nvmlDevice_t device, nvmlPageRetirementCause_t cause, unsigned int* pageCount, unsigned long long* addresses, unsigned long long* timestamps) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetRetiredPages_v2
    _check_or_init_nvml()
    if __nvmlDeviceGetRetiredPages_v2 == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetRetiredPages_v2 is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlPageRetirementCause_t, unsigned int*, unsigned long long*, unsigned long long*) noexcept nogil>__nvmlDeviceGetRetiredPages_v2)(
        device, cause, pageCount, addresses, timestamps)


cdef nvmlReturn_t _nvmlDeviceGetRetiredPagesPendingStatus(nvmlDevice_t device, nvmlEnableState_t* isPending) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetRetiredPagesPendingStatus
    _check_or_init_nvml()
    if __nvmlDeviceGetRetiredPagesPendingStatus == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetRetiredPagesPendingStatus is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlEnableState_t*) noexcept nogil>__nvmlDeviceGetRetiredPagesPendingStatus)(
        device, isPending)


cdef nvmlReturn_t _nvmlDeviceGetRemappedRows(nvmlDevice_t device, unsigned int* corrRows, unsigned int* uncRows, unsigned int* isPending, unsigned int* failureOccurred) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetRemappedRows
    _check_or_init_nvml()
    if __nvmlDeviceGetRemappedRows == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetRemappedRows is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*, unsigned int*, unsigned int*, unsigned int*) noexcept nogil>__nvmlDeviceGetRemappedRows)(
        device, corrRows, uncRows, isPending, failureOccurred)


cdef nvmlReturn_t _nvmlDeviceGetRowRemapperHistogram(nvmlDevice_t device, nvmlRowRemapperHistogramValues_t* values) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetRowRemapperHistogram
    _check_or_init_nvml()
    if __nvmlDeviceGetRowRemapperHistogram == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetRowRemapperHistogram is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlRowRemapperHistogramValues_t*) noexcept nogil>__nvmlDeviceGetRowRemapperHistogram)(
        device, values)


cdef nvmlReturn_t _nvmlDeviceGetArchitecture(nvmlDevice_t device, nvmlDeviceArchitecture_t* arch) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetArchitecture
    _check_or_init_nvml()
    if __nvmlDeviceGetArchitecture == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetArchitecture is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlDeviceArchitecture_t*) noexcept nogil>__nvmlDeviceGetArchitecture)(
        device, arch)


cdef nvmlReturn_t _nvmlDeviceGetClkMonStatus(nvmlDevice_t device, nvmlClkMonStatus_t* status) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetClkMonStatus
    _check_or_init_nvml()
    if __nvmlDeviceGetClkMonStatus == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetClkMonStatus is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlClkMonStatus_t*) noexcept nogil>__nvmlDeviceGetClkMonStatus)(
        device, status)


cdef nvmlReturn_t _nvmlDeviceGetProcessUtilization(nvmlDevice_t device, nvmlProcessUtilizationSample_t* utilization, unsigned int* processSamplesCount, unsigned long long lastSeenTimeStamp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetProcessUtilization
    _check_or_init_nvml()
    if __nvmlDeviceGetProcessUtilization == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetProcessUtilization is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlProcessUtilizationSample_t*, unsigned int*, unsigned long long) noexcept nogil>__nvmlDeviceGetProcessUtilization)(
        device, utilization, processSamplesCount, lastSeenTimeStamp)


cdef nvmlReturn_t _nvmlDeviceGetProcessesUtilizationInfo(nvmlDevice_t device, nvmlProcessesUtilizationInfo_t* procesesUtilInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetProcessesUtilizationInfo
    _check_or_init_nvml()
    if __nvmlDeviceGetProcessesUtilizationInfo == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetProcessesUtilizationInfo is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlProcessesUtilizationInfo_t*) noexcept nogil>__nvmlDeviceGetProcessesUtilizationInfo)(
        device, procesesUtilInfo)


cdef nvmlReturn_t _nvmlDeviceGetPlatformInfo(nvmlDevice_t device, nvmlPlatformInfo_t* platformInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetPlatformInfo
    _check_or_init_nvml()
    if __nvmlDeviceGetPlatformInfo == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetPlatformInfo is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlPlatformInfo_t*) noexcept nogil>__nvmlDeviceGetPlatformInfo)(
        device, platformInfo)


cdef nvmlReturn_t _nvmlUnitSetLedState(nvmlUnit_t unit, nvmlLedColor_t color) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlUnitSetLedState
    _check_or_init_nvml()
    if __nvmlUnitSetLedState == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlUnitSetLedState is not found")
    return (<nvmlReturn_t (*)(nvmlUnit_t, nvmlLedColor_t) noexcept nogil>__nvmlUnitSetLedState)(
        unit, color)


cdef nvmlReturn_t _nvmlDeviceSetPersistenceMode(nvmlDevice_t device, nvmlEnableState_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetPersistenceMode
    _check_or_init_nvml()
    if __nvmlDeviceSetPersistenceMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetPersistenceMode is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlEnableState_t) noexcept nogil>__nvmlDeviceSetPersistenceMode)(
        device, mode)


cdef nvmlReturn_t _nvmlDeviceSetComputeMode(nvmlDevice_t device, nvmlComputeMode_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetComputeMode
    _check_or_init_nvml()
    if __nvmlDeviceSetComputeMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetComputeMode is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlComputeMode_t) noexcept nogil>__nvmlDeviceSetComputeMode)(
        device, mode)


cdef nvmlReturn_t _nvmlDeviceSetEccMode(nvmlDevice_t device, nvmlEnableState_t ecc) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetEccMode
    _check_or_init_nvml()
    if __nvmlDeviceSetEccMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetEccMode is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlEnableState_t) noexcept nogil>__nvmlDeviceSetEccMode)(
        device, ecc)


cdef nvmlReturn_t _nvmlDeviceClearEccErrorCounts(nvmlDevice_t device, nvmlEccCounterType_t counterType) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceClearEccErrorCounts
    _check_or_init_nvml()
    if __nvmlDeviceClearEccErrorCounts == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceClearEccErrorCounts is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlEccCounterType_t) noexcept nogil>__nvmlDeviceClearEccErrorCounts)(
        device, counterType)


cdef nvmlReturn_t _nvmlDeviceSetDriverModel(nvmlDevice_t device, nvmlDriverModel_t driverModel, unsigned int flags) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetDriverModel
    _check_or_init_nvml()
    if __nvmlDeviceSetDriverModel == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetDriverModel is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlDriverModel_t, unsigned int) noexcept nogil>__nvmlDeviceSetDriverModel)(
        device, driverModel, flags)


cdef nvmlReturn_t _nvmlDeviceSetGpuLockedClocks(nvmlDevice_t device, unsigned int minGpuClockMHz, unsigned int maxGpuClockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetGpuLockedClocks
    _check_or_init_nvml()
    if __nvmlDeviceSetGpuLockedClocks == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetGpuLockedClocks is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, unsigned int) noexcept nogil>__nvmlDeviceSetGpuLockedClocks)(
        device, minGpuClockMHz, maxGpuClockMHz)


cdef nvmlReturn_t _nvmlDeviceResetGpuLockedClocks(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceResetGpuLockedClocks
    _check_or_init_nvml()
    if __nvmlDeviceResetGpuLockedClocks == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceResetGpuLockedClocks is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t) noexcept nogil>__nvmlDeviceResetGpuLockedClocks)(
        device)


cdef nvmlReturn_t _nvmlDeviceSetMemoryLockedClocks(nvmlDevice_t device, unsigned int minMemClockMHz, unsigned int maxMemClockMHz) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetMemoryLockedClocks
    _check_or_init_nvml()
    if __nvmlDeviceSetMemoryLockedClocks == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetMemoryLockedClocks is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, unsigned int) noexcept nogil>__nvmlDeviceSetMemoryLockedClocks)(
        device, minMemClockMHz, maxMemClockMHz)


cdef nvmlReturn_t _nvmlDeviceResetMemoryLockedClocks(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceResetMemoryLockedClocks
    _check_or_init_nvml()
    if __nvmlDeviceResetMemoryLockedClocks == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceResetMemoryLockedClocks is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t) noexcept nogil>__nvmlDeviceResetMemoryLockedClocks)(
        device)


cdef nvmlReturn_t _nvmlDeviceSetAutoBoostedClocksEnabled(nvmlDevice_t device, nvmlEnableState_t enabled) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetAutoBoostedClocksEnabled
    _check_or_init_nvml()
    if __nvmlDeviceSetAutoBoostedClocksEnabled == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetAutoBoostedClocksEnabled is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlEnableState_t) noexcept nogil>__nvmlDeviceSetAutoBoostedClocksEnabled)(
        device, enabled)


cdef nvmlReturn_t _nvmlDeviceSetDefaultAutoBoostedClocksEnabled(nvmlDevice_t device, nvmlEnableState_t enabled, unsigned int flags) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetDefaultAutoBoostedClocksEnabled
    _check_or_init_nvml()
    if __nvmlDeviceSetDefaultAutoBoostedClocksEnabled == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetDefaultAutoBoostedClocksEnabled is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlEnableState_t, unsigned int) noexcept nogil>__nvmlDeviceSetDefaultAutoBoostedClocksEnabled)(
        device, enabled, flags)


cdef nvmlReturn_t _nvmlDeviceSetDefaultFanSpeed_v2(nvmlDevice_t device, unsigned int fan) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetDefaultFanSpeed_v2
    _check_or_init_nvml()
    if __nvmlDeviceSetDefaultFanSpeed_v2 == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetDefaultFanSpeed_v2 is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int) noexcept nogil>__nvmlDeviceSetDefaultFanSpeed_v2)(
        device, fan)


cdef nvmlReturn_t _nvmlDeviceSetFanControlPolicy(nvmlDevice_t device, unsigned int fan, nvmlFanControlPolicy_t policy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetFanControlPolicy
    _check_or_init_nvml()
    if __nvmlDeviceSetFanControlPolicy == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetFanControlPolicy is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, nvmlFanControlPolicy_t) noexcept nogil>__nvmlDeviceSetFanControlPolicy)(
        device, fan, policy)


cdef nvmlReturn_t _nvmlDeviceSetTemperatureThreshold(nvmlDevice_t device, nvmlTemperatureThresholds_t thresholdType, int* temp) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetTemperatureThreshold
    _check_or_init_nvml()
    if __nvmlDeviceSetTemperatureThreshold == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetTemperatureThreshold is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlTemperatureThresholds_t, int*) noexcept nogil>__nvmlDeviceSetTemperatureThreshold)(
        device, thresholdType, temp)


cdef nvmlReturn_t _nvmlDeviceSetPowerManagementLimit(nvmlDevice_t device, unsigned int limit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetPowerManagementLimit
    _check_or_init_nvml()
    if __nvmlDeviceSetPowerManagementLimit == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetPowerManagementLimit is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int) noexcept nogil>__nvmlDeviceSetPowerManagementLimit)(
        device, limit)


cdef nvmlReturn_t _nvmlDeviceSetGpuOperationMode(nvmlDevice_t device, nvmlGpuOperationMode_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetGpuOperationMode
    _check_or_init_nvml()
    if __nvmlDeviceSetGpuOperationMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetGpuOperationMode is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlGpuOperationMode_t) noexcept nogil>__nvmlDeviceSetGpuOperationMode)(
        device, mode)


cdef nvmlReturn_t _nvmlDeviceSetAPIRestriction(nvmlDevice_t device, nvmlRestrictedAPI_t apiType, nvmlEnableState_t isRestricted) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetAPIRestriction
    _check_or_init_nvml()
    if __nvmlDeviceSetAPIRestriction == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetAPIRestriction is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlRestrictedAPI_t, nvmlEnableState_t) noexcept nogil>__nvmlDeviceSetAPIRestriction)(
        device, apiType, isRestricted)


cdef nvmlReturn_t _nvmlDeviceSetFanSpeed_v2(nvmlDevice_t device, unsigned int fan, unsigned int speed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetFanSpeed_v2
    _check_or_init_nvml()
    if __nvmlDeviceSetFanSpeed_v2 == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetFanSpeed_v2 is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, unsigned int) noexcept nogil>__nvmlDeviceSetFanSpeed_v2)(
        device, fan, speed)


cdef nvmlReturn_t _nvmlDeviceSetAccountingMode(nvmlDevice_t device, nvmlEnableState_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetAccountingMode
    _check_or_init_nvml()
    if __nvmlDeviceSetAccountingMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetAccountingMode is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlEnableState_t) noexcept nogil>__nvmlDeviceSetAccountingMode)(
        device, mode)


cdef nvmlReturn_t _nvmlDeviceClearAccountingPids(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceClearAccountingPids
    _check_or_init_nvml()
    if __nvmlDeviceClearAccountingPids == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceClearAccountingPids is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t) noexcept nogil>__nvmlDeviceClearAccountingPids)(
        device)


cdef nvmlReturn_t _nvmlDeviceSetPowerManagementLimit_v2(nvmlDevice_t device, nvmlPowerValue_v2_t* powerValue) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetPowerManagementLimit_v2
    _check_or_init_nvml()
    if __nvmlDeviceSetPowerManagementLimit_v2 == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetPowerManagementLimit_v2 is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlPowerValue_v2_t*) noexcept nogil>__nvmlDeviceSetPowerManagementLimit_v2)(
        device, powerValue)


cdef nvmlReturn_t _nvmlDeviceGetNvLinkState(nvmlDevice_t device, unsigned int link, nvmlEnableState_t* isActive) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetNvLinkState
    _check_or_init_nvml()
    if __nvmlDeviceGetNvLinkState == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetNvLinkState is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, nvmlEnableState_t*) noexcept nogil>__nvmlDeviceGetNvLinkState)(
        device, link, isActive)


cdef nvmlReturn_t _nvmlDeviceGetNvLinkVersion(nvmlDevice_t device, unsigned int link, unsigned int* version) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetNvLinkVersion
    _check_or_init_nvml()
    if __nvmlDeviceGetNvLinkVersion == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetNvLinkVersion is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, unsigned int*) noexcept nogil>__nvmlDeviceGetNvLinkVersion)(
        device, link, version)


cdef nvmlReturn_t _nvmlDeviceGetNvLinkCapability(nvmlDevice_t device, unsigned int link, nvmlNvLinkCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetNvLinkCapability
    _check_or_init_nvml()
    if __nvmlDeviceGetNvLinkCapability == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetNvLinkCapability is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, nvmlNvLinkCapability_t, unsigned int*) noexcept nogil>__nvmlDeviceGetNvLinkCapability)(
        device, link, capability, capResult)


cdef nvmlReturn_t _nvmlDeviceGetNvLinkRemotePciInfo_v2(nvmlDevice_t device, unsigned int link, nvmlPciInfo_t* pci) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetNvLinkRemotePciInfo_v2
    _check_or_init_nvml()
    if __nvmlDeviceGetNvLinkRemotePciInfo_v2 == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetNvLinkRemotePciInfo_v2 is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, nvmlPciInfo_t*) noexcept nogil>__nvmlDeviceGetNvLinkRemotePciInfo_v2)(
        device, link, pci)


cdef nvmlReturn_t _nvmlDeviceGetNvLinkErrorCounter(nvmlDevice_t device, unsigned int link, nvmlNvLinkErrorCounter_t counter, unsigned long long* counterValue) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetNvLinkErrorCounter
    _check_or_init_nvml()
    if __nvmlDeviceGetNvLinkErrorCounter == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetNvLinkErrorCounter is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, nvmlNvLinkErrorCounter_t, unsigned long long*) noexcept nogil>__nvmlDeviceGetNvLinkErrorCounter)(
        device, link, counter, counterValue)


cdef nvmlReturn_t _nvmlDeviceResetNvLinkErrorCounters(nvmlDevice_t device, unsigned int link) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceResetNvLinkErrorCounters
    _check_or_init_nvml()
    if __nvmlDeviceResetNvLinkErrorCounters == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceResetNvLinkErrorCounters is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int) noexcept nogil>__nvmlDeviceResetNvLinkErrorCounters)(
        device, link)


cdef nvmlReturn_t _nvmlDeviceGetNvLinkRemoteDeviceType(nvmlDevice_t device, unsigned int link, nvmlIntNvLinkDeviceType_t* pNvLinkDeviceType) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetNvLinkRemoteDeviceType
    _check_or_init_nvml()
    if __nvmlDeviceGetNvLinkRemoteDeviceType == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetNvLinkRemoteDeviceType is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, nvmlIntNvLinkDeviceType_t*) noexcept nogil>__nvmlDeviceGetNvLinkRemoteDeviceType)(
        device, link, pNvLinkDeviceType)


cdef nvmlReturn_t _nvmlDeviceSetNvLinkDeviceLowPowerThreshold(nvmlDevice_t device, nvmlNvLinkPowerThres_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetNvLinkDeviceLowPowerThreshold
    _check_or_init_nvml()
    if __nvmlDeviceSetNvLinkDeviceLowPowerThreshold == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetNvLinkDeviceLowPowerThreshold is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlNvLinkPowerThres_t*) noexcept nogil>__nvmlDeviceSetNvLinkDeviceLowPowerThreshold)(
        device, info)


cdef nvmlReturn_t _nvmlSystemSetNvlinkBwMode(unsigned int nvlinkBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlSystemSetNvlinkBwMode
    _check_or_init_nvml()
    if __nvmlSystemSetNvlinkBwMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlSystemSetNvlinkBwMode is not found")
    return (<nvmlReturn_t (*)(unsigned int) noexcept nogil>__nvmlSystemSetNvlinkBwMode)(
        nvlinkBwMode)


cdef nvmlReturn_t _nvmlSystemGetNvlinkBwMode(unsigned int* nvlinkBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlSystemGetNvlinkBwMode
    _check_or_init_nvml()
    if __nvmlSystemGetNvlinkBwMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlSystemGetNvlinkBwMode is not found")
    return (<nvmlReturn_t (*)(unsigned int*) noexcept nogil>__nvmlSystemGetNvlinkBwMode)(
        nvlinkBwMode)


cdef nvmlReturn_t _nvmlDeviceGetNvlinkSupportedBwModes(nvmlDevice_t device, nvmlNvlinkSupportedBwModes_t* supportedBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetNvlinkSupportedBwModes
    _check_or_init_nvml()
    if __nvmlDeviceGetNvlinkSupportedBwModes == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetNvlinkSupportedBwModes is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlNvlinkSupportedBwModes_t*) noexcept nogil>__nvmlDeviceGetNvlinkSupportedBwModes)(
        device, supportedBwMode)


cdef nvmlReturn_t _nvmlDeviceGetNvlinkBwMode(nvmlDevice_t device, nvmlNvlinkGetBwMode_t* getBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetNvlinkBwMode
    _check_or_init_nvml()
    if __nvmlDeviceGetNvlinkBwMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetNvlinkBwMode is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlNvlinkGetBwMode_t*) noexcept nogil>__nvmlDeviceGetNvlinkBwMode)(
        device, getBwMode)


cdef nvmlReturn_t _nvmlDeviceSetNvlinkBwMode(nvmlDevice_t device, nvmlNvlinkSetBwMode_t* setBwMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetNvlinkBwMode
    _check_or_init_nvml()
    if __nvmlDeviceSetNvlinkBwMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetNvlinkBwMode is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlNvlinkSetBwMode_t*) noexcept nogil>__nvmlDeviceSetNvlinkBwMode)(
        device, setBwMode)


cdef nvmlReturn_t _nvmlEventSetCreate(nvmlEventSet_t* set) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlEventSetCreate
    _check_or_init_nvml()
    if __nvmlEventSetCreate == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlEventSetCreate is not found")
    return (<nvmlReturn_t (*)(nvmlEventSet_t*) noexcept nogil>__nvmlEventSetCreate)(
        set)


cdef nvmlReturn_t _nvmlDeviceRegisterEvents(nvmlDevice_t device, unsigned long long eventTypes, nvmlEventSet_t set) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceRegisterEvents
    _check_or_init_nvml()
    if __nvmlDeviceRegisterEvents == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceRegisterEvents is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned long long, nvmlEventSet_t) noexcept nogil>__nvmlDeviceRegisterEvents)(
        device, eventTypes, set)


cdef nvmlReturn_t _nvmlDeviceGetSupportedEventTypes(nvmlDevice_t device, unsigned long long* eventTypes) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetSupportedEventTypes
    _check_or_init_nvml()
    if __nvmlDeviceGetSupportedEventTypes == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetSupportedEventTypes is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned long long*) noexcept nogil>__nvmlDeviceGetSupportedEventTypes)(
        device, eventTypes)


cdef nvmlReturn_t _nvmlEventSetWait_v2(nvmlEventSet_t set, nvmlEventData_t* data, unsigned int timeoutms) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlEventSetWait_v2
    _check_or_init_nvml()
    if __nvmlEventSetWait_v2 == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlEventSetWait_v2 is not found")
    return (<nvmlReturn_t (*)(nvmlEventSet_t, nvmlEventData_t*, unsigned int) noexcept nogil>__nvmlEventSetWait_v2)(
        set, data, timeoutms)


cdef nvmlReturn_t _nvmlEventSetFree(nvmlEventSet_t set) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlEventSetFree
    _check_or_init_nvml()
    if __nvmlEventSetFree == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlEventSetFree is not found")
    return (<nvmlReturn_t (*)(nvmlEventSet_t) noexcept nogil>__nvmlEventSetFree)(
        set)


cdef nvmlReturn_t _nvmlSystemEventSetCreate(nvmlSystemEventSetCreateRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlSystemEventSetCreate
    _check_or_init_nvml()
    if __nvmlSystemEventSetCreate == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlSystemEventSetCreate is not found")
    return (<nvmlReturn_t (*)(nvmlSystemEventSetCreateRequest_t*) noexcept nogil>__nvmlSystemEventSetCreate)(
        request)


cdef nvmlReturn_t _nvmlSystemEventSetFree(nvmlSystemEventSetFreeRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlSystemEventSetFree
    _check_or_init_nvml()
    if __nvmlSystemEventSetFree == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlSystemEventSetFree is not found")
    return (<nvmlReturn_t (*)(nvmlSystemEventSetFreeRequest_t*) noexcept nogil>__nvmlSystemEventSetFree)(
        request)


cdef nvmlReturn_t _nvmlSystemRegisterEvents(nvmlSystemRegisterEventRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlSystemRegisterEvents
    _check_or_init_nvml()
    if __nvmlSystemRegisterEvents == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlSystemRegisterEvents is not found")
    return (<nvmlReturn_t (*)(nvmlSystemRegisterEventRequest_t*) noexcept nogil>__nvmlSystemRegisterEvents)(
        request)


cdef nvmlReturn_t _nvmlSystemEventSetWait(nvmlSystemEventSetWaitRequest_t* request) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlSystemEventSetWait
    _check_or_init_nvml()
    if __nvmlSystemEventSetWait == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlSystemEventSetWait is not found")
    return (<nvmlReturn_t (*)(nvmlSystemEventSetWaitRequest_t*) noexcept nogil>__nvmlSystemEventSetWait)(
        request)


cdef nvmlReturn_t _nvmlDeviceModifyDrainState(nvmlPciInfo_t* pciInfo, nvmlEnableState_t newState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceModifyDrainState
    _check_or_init_nvml()
    if __nvmlDeviceModifyDrainState == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceModifyDrainState is not found")
    return (<nvmlReturn_t (*)(nvmlPciInfo_t*, nvmlEnableState_t) noexcept nogil>__nvmlDeviceModifyDrainState)(
        pciInfo, newState)


cdef nvmlReturn_t _nvmlDeviceQueryDrainState(nvmlPciInfo_t* pciInfo, nvmlEnableState_t* currentState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceQueryDrainState
    _check_or_init_nvml()
    if __nvmlDeviceQueryDrainState == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceQueryDrainState is not found")
    return (<nvmlReturn_t (*)(nvmlPciInfo_t*, nvmlEnableState_t*) noexcept nogil>__nvmlDeviceQueryDrainState)(
        pciInfo, currentState)


cdef nvmlReturn_t _nvmlDeviceRemoveGpu_v2(nvmlPciInfo_t* pciInfo, nvmlDetachGpuState_t gpuState, nvmlPcieLinkState_t linkState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceRemoveGpu_v2
    _check_or_init_nvml()
    if __nvmlDeviceRemoveGpu_v2 == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceRemoveGpu_v2 is not found")
    return (<nvmlReturn_t (*)(nvmlPciInfo_t*, nvmlDetachGpuState_t, nvmlPcieLinkState_t) noexcept nogil>__nvmlDeviceRemoveGpu_v2)(
        pciInfo, gpuState, linkState)


cdef nvmlReturn_t _nvmlDeviceDiscoverGpus(nvmlPciInfo_t* pciInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceDiscoverGpus
    _check_or_init_nvml()
    if __nvmlDeviceDiscoverGpus == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceDiscoverGpus is not found")
    return (<nvmlReturn_t (*)(nvmlPciInfo_t*) noexcept nogil>__nvmlDeviceDiscoverGpus)(
        pciInfo)


cdef nvmlReturn_t _nvmlDeviceGetFieldValues(nvmlDevice_t device, int valuesCount, nvmlFieldValue_t* values) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetFieldValues
    _check_or_init_nvml()
    if __nvmlDeviceGetFieldValues == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetFieldValues is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, int, nvmlFieldValue_t*) noexcept nogil>__nvmlDeviceGetFieldValues)(
        device, valuesCount, values)


cdef nvmlReturn_t _nvmlDeviceClearFieldValues(nvmlDevice_t device, int valuesCount, nvmlFieldValue_t* values) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceClearFieldValues
    _check_or_init_nvml()
    if __nvmlDeviceClearFieldValues == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceClearFieldValues is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, int, nvmlFieldValue_t*) noexcept nogil>__nvmlDeviceClearFieldValues)(
        device, valuesCount, values)


cdef nvmlReturn_t _nvmlDeviceGetVirtualizationMode(nvmlDevice_t device, nvmlGpuVirtualizationMode_t* pVirtualMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetVirtualizationMode
    _check_or_init_nvml()
    if __nvmlDeviceGetVirtualizationMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetVirtualizationMode is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlGpuVirtualizationMode_t*) noexcept nogil>__nvmlDeviceGetVirtualizationMode)(
        device, pVirtualMode)


cdef nvmlReturn_t _nvmlDeviceGetHostVgpuMode(nvmlDevice_t device, nvmlHostVgpuMode_t* pHostVgpuMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetHostVgpuMode
    _check_or_init_nvml()
    if __nvmlDeviceGetHostVgpuMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetHostVgpuMode is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlHostVgpuMode_t*) noexcept nogil>__nvmlDeviceGetHostVgpuMode)(
        device, pHostVgpuMode)


cdef nvmlReturn_t _nvmlDeviceSetVirtualizationMode(nvmlDevice_t device, nvmlGpuVirtualizationMode_t virtualMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetVirtualizationMode
    _check_or_init_nvml()
    if __nvmlDeviceSetVirtualizationMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetVirtualizationMode is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlGpuVirtualizationMode_t) noexcept nogil>__nvmlDeviceSetVirtualizationMode)(
        device, virtualMode)


cdef nvmlReturn_t _nvmlDeviceGetVgpuHeterogeneousMode(nvmlDevice_t device, nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetVgpuHeterogeneousMode
    _check_or_init_nvml()
    if __nvmlDeviceGetVgpuHeterogeneousMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetVgpuHeterogeneousMode is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlVgpuHeterogeneousMode_t*) noexcept nogil>__nvmlDeviceGetVgpuHeterogeneousMode)(
        device, pHeterogeneousMode)


cdef nvmlReturn_t _nvmlDeviceSetVgpuHeterogeneousMode(nvmlDevice_t device, const nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetVgpuHeterogeneousMode
    _check_or_init_nvml()
    if __nvmlDeviceSetVgpuHeterogeneousMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetVgpuHeterogeneousMode is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, const nvmlVgpuHeterogeneousMode_t*) noexcept nogil>__nvmlDeviceSetVgpuHeterogeneousMode)(
        device, pHeterogeneousMode)


cdef nvmlReturn_t _nvmlVgpuInstanceGetPlacementId(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuPlacementId_t* pPlacement) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuInstanceGetPlacementId
    _check_or_init_nvml()
    if __nvmlVgpuInstanceGetPlacementId == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuInstanceGetPlacementId is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuInstance_t, nvmlVgpuPlacementId_t*) noexcept nogil>__nvmlVgpuInstanceGetPlacementId)(
        vgpuInstance, pPlacement)


cdef nvmlReturn_t _nvmlDeviceGetVgpuTypeSupportedPlacements(nvmlDevice_t device, nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuPlacementList_t* pPlacementList) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetVgpuTypeSupportedPlacements
    _check_or_init_nvml()
    if __nvmlDeviceGetVgpuTypeSupportedPlacements == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetVgpuTypeSupportedPlacements is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlVgpuTypeId_t, nvmlVgpuPlacementList_t*) noexcept nogil>__nvmlDeviceGetVgpuTypeSupportedPlacements)(
        device, vgpuTypeId, pPlacementList)


cdef nvmlReturn_t _nvmlDeviceGetVgpuTypeCreatablePlacements(nvmlDevice_t device, nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuPlacementList_t* pPlacementList) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetVgpuTypeCreatablePlacements
    _check_or_init_nvml()
    if __nvmlDeviceGetVgpuTypeCreatablePlacements == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetVgpuTypeCreatablePlacements is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlVgpuTypeId_t, nvmlVgpuPlacementList_t*) noexcept nogil>__nvmlDeviceGetVgpuTypeCreatablePlacements)(
        device, vgpuTypeId, pPlacementList)


cdef nvmlReturn_t _nvmlVgpuTypeGetGspHeapSize(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* gspHeapSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuTypeGetGspHeapSize
    _check_or_init_nvml()
    if __nvmlVgpuTypeGetGspHeapSize == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuTypeGetGspHeapSize is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuTypeId_t, unsigned long long*) noexcept nogil>__nvmlVgpuTypeGetGspHeapSize)(
        vgpuTypeId, gspHeapSize)


cdef nvmlReturn_t _nvmlVgpuTypeGetFbReservation(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* fbReservation) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuTypeGetFbReservation
    _check_or_init_nvml()
    if __nvmlVgpuTypeGetFbReservation == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuTypeGetFbReservation is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuTypeId_t, unsigned long long*) noexcept nogil>__nvmlVgpuTypeGetFbReservation)(
        vgpuTypeId, fbReservation)


cdef nvmlReturn_t _nvmlVgpuInstanceGetRuntimeStateSize(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuRuntimeState_t* pState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuInstanceGetRuntimeStateSize
    _check_or_init_nvml()
    if __nvmlVgpuInstanceGetRuntimeStateSize == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuInstanceGetRuntimeStateSize is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuInstance_t, nvmlVgpuRuntimeState_t*) noexcept nogil>__nvmlVgpuInstanceGetRuntimeStateSize)(
        vgpuInstance, pState)


cdef nvmlReturn_t _nvmlDeviceSetVgpuCapabilities(nvmlDevice_t device, nvmlDeviceVgpuCapability_t capability, nvmlEnableState_t state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetVgpuCapabilities
    _check_or_init_nvml()
    if __nvmlDeviceSetVgpuCapabilities == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetVgpuCapabilities is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlDeviceVgpuCapability_t, nvmlEnableState_t) noexcept nogil>__nvmlDeviceSetVgpuCapabilities)(
        device, capability, state)


cdef nvmlReturn_t _nvmlDeviceGetGridLicensableFeatures_v4(nvmlDevice_t device, nvmlGridLicensableFeatures_t* pGridLicensableFeatures) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetGridLicensableFeatures_v4
    _check_or_init_nvml()
    if __nvmlDeviceGetGridLicensableFeatures_v4 == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetGridLicensableFeatures_v4 is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlGridLicensableFeatures_t*) noexcept nogil>__nvmlDeviceGetGridLicensableFeatures_v4)(
        device, pGridLicensableFeatures)


cdef nvmlReturn_t _nvmlGetVgpuDriverCapabilities(nvmlVgpuDriverCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlGetVgpuDriverCapabilities
    _check_or_init_nvml()
    if __nvmlGetVgpuDriverCapabilities == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlGetVgpuDriverCapabilities is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuDriverCapability_t, unsigned int*) noexcept nogil>__nvmlGetVgpuDriverCapabilities)(
        capability, capResult)


cdef nvmlReturn_t _nvmlDeviceGetVgpuCapabilities(nvmlDevice_t device, nvmlDeviceVgpuCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetVgpuCapabilities
    _check_or_init_nvml()
    if __nvmlDeviceGetVgpuCapabilities == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetVgpuCapabilities is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlDeviceVgpuCapability_t, unsigned int*) noexcept nogil>__nvmlDeviceGetVgpuCapabilities)(
        device, capability, capResult)


cdef nvmlReturn_t _nvmlDeviceGetSupportedVgpus(nvmlDevice_t device, unsigned int* vgpuCount, nvmlVgpuTypeId_t* vgpuTypeIds) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetSupportedVgpus
    _check_or_init_nvml()
    if __nvmlDeviceGetSupportedVgpus == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetSupportedVgpus is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*, nvmlVgpuTypeId_t*) noexcept nogil>__nvmlDeviceGetSupportedVgpus)(
        device, vgpuCount, vgpuTypeIds)


cdef nvmlReturn_t _nvmlDeviceGetCreatableVgpus(nvmlDevice_t device, unsigned int* vgpuCount, nvmlVgpuTypeId_t* vgpuTypeIds) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetCreatableVgpus
    _check_or_init_nvml()
    if __nvmlDeviceGetCreatableVgpus == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetCreatableVgpus is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*, nvmlVgpuTypeId_t*) noexcept nogil>__nvmlDeviceGetCreatableVgpus)(
        device, vgpuCount, vgpuTypeIds)


cdef nvmlReturn_t _nvmlVgpuTypeGetClass(nvmlVgpuTypeId_t vgpuTypeId, char* vgpuTypeClass, unsigned int* size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuTypeGetClass
    _check_or_init_nvml()
    if __nvmlVgpuTypeGetClass == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuTypeGetClass is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuTypeId_t, char*, unsigned int*) noexcept nogil>__nvmlVgpuTypeGetClass)(
        vgpuTypeId, vgpuTypeClass, size)


cdef nvmlReturn_t _nvmlVgpuTypeGetName(nvmlVgpuTypeId_t vgpuTypeId, char* vgpuTypeName, unsigned int* size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuTypeGetName
    _check_or_init_nvml()
    if __nvmlVgpuTypeGetName == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuTypeGetName is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuTypeId_t, char*, unsigned int*) noexcept nogil>__nvmlVgpuTypeGetName)(
        vgpuTypeId, vgpuTypeName, size)


cdef nvmlReturn_t _nvmlVgpuTypeGetGpuInstanceProfileId(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* gpuInstanceProfileId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuTypeGetGpuInstanceProfileId
    _check_or_init_nvml()
    if __nvmlVgpuTypeGetGpuInstanceProfileId == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuTypeGetGpuInstanceProfileId is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuTypeId_t, unsigned int*) noexcept nogil>__nvmlVgpuTypeGetGpuInstanceProfileId)(
        vgpuTypeId, gpuInstanceProfileId)


cdef nvmlReturn_t _nvmlVgpuTypeGetDeviceID(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* deviceID, unsigned long long* subsystemID) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuTypeGetDeviceID
    _check_or_init_nvml()
    if __nvmlVgpuTypeGetDeviceID == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuTypeGetDeviceID is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuTypeId_t, unsigned long long*, unsigned long long*) noexcept nogil>__nvmlVgpuTypeGetDeviceID)(
        vgpuTypeId, deviceID, subsystemID)


cdef nvmlReturn_t _nvmlVgpuTypeGetFramebufferSize(nvmlVgpuTypeId_t vgpuTypeId, unsigned long long* fbSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuTypeGetFramebufferSize
    _check_or_init_nvml()
    if __nvmlVgpuTypeGetFramebufferSize == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuTypeGetFramebufferSize is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuTypeId_t, unsigned long long*) noexcept nogil>__nvmlVgpuTypeGetFramebufferSize)(
        vgpuTypeId, fbSize)


cdef nvmlReturn_t _nvmlVgpuTypeGetNumDisplayHeads(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* numDisplayHeads) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuTypeGetNumDisplayHeads
    _check_or_init_nvml()
    if __nvmlVgpuTypeGetNumDisplayHeads == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuTypeGetNumDisplayHeads is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuTypeId_t, unsigned int*) noexcept nogil>__nvmlVgpuTypeGetNumDisplayHeads)(
        vgpuTypeId, numDisplayHeads)


cdef nvmlReturn_t _nvmlVgpuTypeGetResolution(nvmlVgpuTypeId_t vgpuTypeId, unsigned int displayIndex, unsigned int* xdim, unsigned int* ydim) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuTypeGetResolution
    _check_or_init_nvml()
    if __nvmlVgpuTypeGetResolution == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuTypeGetResolution is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuTypeId_t, unsigned int, unsigned int*, unsigned int*) noexcept nogil>__nvmlVgpuTypeGetResolution)(
        vgpuTypeId, displayIndex, xdim, ydim)


cdef nvmlReturn_t _nvmlVgpuTypeGetLicense(nvmlVgpuTypeId_t vgpuTypeId, char* vgpuTypeLicenseString, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuTypeGetLicense
    _check_or_init_nvml()
    if __nvmlVgpuTypeGetLicense == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuTypeGetLicense is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuTypeId_t, char*, unsigned int) noexcept nogil>__nvmlVgpuTypeGetLicense)(
        vgpuTypeId, vgpuTypeLicenseString, size)


cdef nvmlReturn_t _nvmlVgpuTypeGetFrameRateLimit(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* frameRateLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuTypeGetFrameRateLimit
    _check_or_init_nvml()
    if __nvmlVgpuTypeGetFrameRateLimit == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuTypeGetFrameRateLimit is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuTypeId_t, unsigned int*) noexcept nogil>__nvmlVgpuTypeGetFrameRateLimit)(
        vgpuTypeId, frameRateLimit)


cdef nvmlReturn_t _nvmlVgpuTypeGetMaxInstances(nvmlDevice_t device, nvmlVgpuTypeId_t vgpuTypeId, unsigned int* vgpuInstanceCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuTypeGetMaxInstances
    _check_or_init_nvml()
    if __nvmlVgpuTypeGetMaxInstances == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuTypeGetMaxInstances is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlVgpuTypeId_t, unsigned int*) noexcept nogil>__nvmlVgpuTypeGetMaxInstances)(
        device, vgpuTypeId, vgpuInstanceCount)


cdef nvmlReturn_t _nvmlVgpuTypeGetMaxInstancesPerVm(nvmlVgpuTypeId_t vgpuTypeId, unsigned int* vgpuInstanceCountPerVm) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuTypeGetMaxInstancesPerVm
    _check_or_init_nvml()
    if __nvmlVgpuTypeGetMaxInstancesPerVm == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuTypeGetMaxInstancesPerVm is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuTypeId_t, unsigned int*) noexcept nogil>__nvmlVgpuTypeGetMaxInstancesPerVm)(
        vgpuTypeId, vgpuInstanceCountPerVm)


cdef nvmlReturn_t _nvmlVgpuTypeGetBAR1Info(nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuTypeBar1Info_t* bar1Info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuTypeGetBAR1Info
    _check_or_init_nvml()
    if __nvmlVgpuTypeGetBAR1Info == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuTypeGetBAR1Info is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuTypeId_t, nvmlVgpuTypeBar1Info_t*) noexcept nogil>__nvmlVgpuTypeGetBAR1Info)(
        vgpuTypeId, bar1Info)


cdef nvmlReturn_t _nvmlDeviceGetActiveVgpus(nvmlDevice_t device, unsigned int* vgpuCount, nvmlVgpuInstance_t* vgpuInstances) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetActiveVgpus
    _check_or_init_nvml()
    if __nvmlDeviceGetActiveVgpus == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetActiveVgpus is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*, nvmlVgpuInstance_t*) noexcept nogil>__nvmlDeviceGetActiveVgpus)(
        device, vgpuCount, vgpuInstances)


cdef nvmlReturn_t _nvmlVgpuInstanceGetVmID(nvmlVgpuInstance_t vgpuInstance, char* vmId, unsigned int size, nvmlVgpuVmIdType_t* vmIdType) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuInstanceGetVmID
    _check_or_init_nvml()
    if __nvmlVgpuInstanceGetVmID == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuInstanceGetVmID is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuInstance_t, char*, unsigned int, nvmlVgpuVmIdType_t*) noexcept nogil>__nvmlVgpuInstanceGetVmID)(
        vgpuInstance, vmId, size, vmIdType)


cdef nvmlReturn_t _nvmlVgpuInstanceGetUUID(nvmlVgpuInstance_t vgpuInstance, char* uuid, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuInstanceGetUUID
    _check_or_init_nvml()
    if __nvmlVgpuInstanceGetUUID == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuInstanceGetUUID is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuInstance_t, char*, unsigned int) noexcept nogil>__nvmlVgpuInstanceGetUUID)(
        vgpuInstance, uuid, size)


cdef nvmlReturn_t _nvmlVgpuInstanceGetVmDriverVersion(nvmlVgpuInstance_t vgpuInstance, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuInstanceGetVmDriverVersion
    _check_or_init_nvml()
    if __nvmlVgpuInstanceGetVmDriverVersion == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuInstanceGetVmDriverVersion is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuInstance_t, char*, unsigned int) noexcept nogil>__nvmlVgpuInstanceGetVmDriverVersion)(
        vgpuInstance, version, length)


cdef nvmlReturn_t _nvmlVgpuInstanceGetFbUsage(nvmlVgpuInstance_t vgpuInstance, unsigned long long* fbUsage) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuInstanceGetFbUsage
    _check_or_init_nvml()
    if __nvmlVgpuInstanceGetFbUsage == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuInstanceGetFbUsage is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuInstance_t, unsigned long long*) noexcept nogil>__nvmlVgpuInstanceGetFbUsage)(
        vgpuInstance, fbUsage)


cdef nvmlReturn_t _nvmlVgpuInstanceGetLicenseStatus(nvmlVgpuInstance_t vgpuInstance, unsigned int* licensed) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuInstanceGetLicenseStatus
    _check_or_init_nvml()
    if __nvmlVgpuInstanceGetLicenseStatus == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuInstanceGetLicenseStatus is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuInstance_t, unsigned int*) noexcept nogil>__nvmlVgpuInstanceGetLicenseStatus)(
        vgpuInstance, licensed)


cdef nvmlReturn_t _nvmlVgpuInstanceGetType(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuTypeId_t* vgpuTypeId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuInstanceGetType
    _check_or_init_nvml()
    if __nvmlVgpuInstanceGetType == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuInstanceGetType is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuInstance_t, nvmlVgpuTypeId_t*) noexcept nogil>__nvmlVgpuInstanceGetType)(
        vgpuInstance, vgpuTypeId)


cdef nvmlReturn_t _nvmlVgpuInstanceGetFrameRateLimit(nvmlVgpuInstance_t vgpuInstance, unsigned int* frameRateLimit) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuInstanceGetFrameRateLimit
    _check_or_init_nvml()
    if __nvmlVgpuInstanceGetFrameRateLimit == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuInstanceGetFrameRateLimit is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuInstance_t, unsigned int*) noexcept nogil>__nvmlVgpuInstanceGetFrameRateLimit)(
        vgpuInstance, frameRateLimit)


cdef nvmlReturn_t _nvmlVgpuInstanceGetEccMode(nvmlVgpuInstance_t vgpuInstance, nvmlEnableState_t* eccMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuInstanceGetEccMode
    _check_or_init_nvml()
    if __nvmlVgpuInstanceGetEccMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuInstanceGetEccMode is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuInstance_t, nvmlEnableState_t*) noexcept nogil>__nvmlVgpuInstanceGetEccMode)(
        vgpuInstance, eccMode)


cdef nvmlReturn_t _nvmlVgpuInstanceGetEncoderCapacity(nvmlVgpuInstance_t vgpuInstance, unsigned int* encoderCapacity) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuInstanceGetEncoderCapacity
    _check_or_init_nvml()
    if __nvmlVgpuInstanceGetEncoderCapacity == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuInstanceGetEncoderCapacity is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuInstance_t, unsigned int*) noexcept nogil>__nvmlVgpuInstanceGetEncoderCapacity)(
        vgpuInstance, encoderCapacity)


cdef nvmlReturn_t _nvmlVgpuInstanceSetEncoderCapacity(nvmlVgpuInstance_t vgpuInstance, unsigned int encoderCapacity) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuInstanceSetEncoderCapacity
    _check_or_init_nvml()
    if __nvmlVgpuInstanceSetEncoderCapacity == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuInstanceSetEncoderCapacity is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuInstance_t, unsigned int) noexcept nogil>__nvmlVgpuInstanceSetEncoderCapacity)(
        vgpuInstance, encoderCapacity)


cdef nvmlReturn_t _nvmlVgpuInstanceGetEncoderStats(nvmlVgpuInstance_t vgpuInstance, unsigned int* sessionCount, unsigned int* averageFps, unsigned int* averageLatency) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuInstanceGetEncoderStats
    _check_or_init_nvml()
    if __nvmlVgpuInstanceGetEncoderStats == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuInstanceGetEncoderStats is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuInstance_t, unsigned int*, unsigned int*, unsigned int*) noexcept nogil>__nvmlVgpuInstanceGetEncoderStats)(
        vgpuInstance, sessionCount, averageFps, averageLatency)


cdef nvmlReturn_t _nvmlVgpuInstanceGetEncoderSessions(nvmlVgpuInstance_t vgpuInstance, unsigned int* sessionCount, nvmlEncoderSessionInfo_t* sessionInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuInstanceGetEncoderSessions
    _check_or_init_nvml()
    if __nvmlVgpuInstanceGetEncoderSessions == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuInstanceGetEncoderSessions is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuInstance_t, unsigned int*, nvmlEncoderSessionInfo_t*) noexcept nogil>__nvmlVgpuInstanceGetEncoderSessions)(
        vgpuInstance, sessionCount, sessionInfo)


cdef nvmlReturn_t _nvmlVgpuInstanceGetFBCStats(nvmlVgpuInstance_t vgpuInstance, nvmlFBCStats_t* fbcStats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuInstanceGetFBCStats
    _check_or_init_nvml()
    if __nvmlVgpuInstanceGetFBCStats == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuInstanceGetFBCStats is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuInstance_t, nvmlFBCStats_t*) noexcept nogil>__nvmlVgpuInstanceGetFBCStats)(
        vgpuInstance, fbcStats)


cdef nvmlReturn_t _nvmlVgpuInstanceGetFBCSessions(nvmlVgpuInstance_t vgpuInstance, unsigned int* sessionCount, nvmlFBCSessionInfo_t* sessionInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuInstanceGetFBCSessions
    _check_or_init_nvml()
    if __nvmlVgpuInstanceGetFBCSessions == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuInstanceGetFBCSessions is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuInstance_t, unsigned int*, nvmlFBCSessionInfo_t*) noexcept nogil>__nvmlVgpuInstanceGetFBCSessions)(
        vgpuInstance, sessionCount, sessionInfo)


cdef nvmlReturn_t _nvmlVgpuInstanceGetGpuInstanceId(nvmlVgpuInstance_t vgpuInstance, unsigned int* gpuInstanceId) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuInstanceGetGpuInstanceId
    _check_or_init_nvml()
    if __nvmlVgpuInstanceGetGpuInstanceId == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuInstanceGetGpuInstanceId is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuInstance_t, unsigned int*) noexcept nogil>__nvmlVgpuInstanceGetGpuInstanceId)(
        vgpuInstance, gpuInstanceId)


cdef nvmlReturn_t _nvmlVgpuInstanceGetGpuPciId(nvmlVgpuInstance_t vgpuInstance, char* vgpuPciId, unsigned int* length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuInstanceGetGpuPciId
    _check_or_init_nvml()
    if __nvmlVgpuInstanceGetGpuPciId == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuInstanceGetGpuPciId is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuInstance_t, char*, unsigned int*) noexcept nogil>__nvmlVgpuInstanceGetGpuPciId)(
        vgpuInstance, vgpuPciId, length)


cdef nvmlReturn_t _nvmlVgpuTypeGetCapabilities(nvmlVgpuTypeId_t vgpuTypeId, nvmlVgpuCapability_t capability, unsigned int* capResult) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuTypeGetCapabilities
    _check_or_init_nvml()
    if __nvmlVgpuTypeGetCapabilities == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuTypeGetCapabilities is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuTypeId_t, nvmlVgpuCapability_t, unsigned int*) noexcept nogil>__nvmlVgpuTypeGetCapabilities)(
        vgpuTypeId, capability, capResult)


cdef nvmlReturn_t _nvmlVgpuInstanceGetMdevUUID(nvmlVgpuInstance_t vgpuInstance, char* mdevUuid, unsigned int size) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuInstanceGetMdevUUID
    _check_or_init_nvml()
    if __nvmlVgpuInstanceGetMdevUUID == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuInstanceGetMdevUUID is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuInstance_t, char*, unsigned int) noexcept nogil>__nvmlVgpuInstanceGetMdevUUID)(
        vgpuInstance, mdevUuid, size)


cdef nvmlReturn_t _nvmlGpuInstanceGetCreatableVgpus(nvmlGpuInstance_t gpuInstance, nvmlVgpuTypeIdInfo_t* pVgpus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlGpuInstanceGetCreatableVgpus
    _check_or_init_nvml()
    if __nvmlGpuInstanceGetCreatableVgpus == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlGpuInstanceGetCreatableVgpus is not found")
    return (<nvmlReturn_t (*)(nvmlGpuInstance_t, nvmlVgpuTypeIdInfo_t*) noexcept nogil>__nvmlGpuInstanceGetCreatableVgpus)(
        gpuInstance, pVgpus)


cdef nvmlReturn_t _nvmlVgpuTypeGetMaxInstancesPerGpuInstance(nvmlVgpuTypeMaxInstance_t* pMaxInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuTypeGetMaxInstancesPerGpuInstance
    _check_or_init_nvml()
    if __nvmlVgpuTypeGetMaxInstancesPerGpuInstance == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuTypeGetMaxInstancesPerGpuInstance is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuTypeMaxInstance_t*) noexcept nogil>__nvmlVgpuTypeGetMaxInstancesPerGpuInstance)(
        pMaxInstance)


cdef nvmlReturn_t _nvmlGpuInstanceGetActiveVgpus(nvmlGpuInstance_t gpuInstance, nvmlActiveVgpuInstanceInfo_t* pVgpuInstanceInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlGpuInstanceGetActiveVgpus
    _check_or_init_nvml()
    if __nvmlGpuInstanceGetActiveVgpus == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlGpuInstanceGetActiveVgpus is not found")
    return (<nvmlReturn_t (*)(nvmlGpuInstance_t, nvmlActiveVgpuInstanceInfo_t*) noexcept nogil>__nvmlGpuInstanceGetActiveVgpus)(
        gpuInstance, pVgpuInstanceInfo)


cdef nvmlReturn_t _nvmlGpuInstanceSetVgpuSchedulerState(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerState_t* pScheduler) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlGpuInstanceSetVgpuSchedulerState
    _check_or_init_nvml()
    if __nvmlGpuInstanceSetVgpuSchedulerState == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlGpuInstanceSetVgpuSchedulerState is not found")
    return (<nvmlReturn_t (*)(nvmlGpuInstance_t, nvmlVgpuSchedulerState_t*) noexcept nogil>__nvmlGpuInstanceSetVgpuSchedulerState)(
        gpuInstance, pScheduler)


cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuSchedulerState(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerStateInfo_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlGpuInstanceGetVgpuSchedulerState
    _check_or_init_nvml()
    if __nvmlGpuInstanceGetVgpuSchedulerState == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlGpuInstanceGetVgpuSchedulerState is not found")
    return (<nvmlReturn_t (*)(nvmlGpuInstance_t, nvmlVgpuSchedulerStateInfo_t*) noexcept nogil>__nvmlGpuInstanceGetVgpuSchedulerState)(
        gpuInstance, pSchedulerStateInfo)


cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuSchedulerLog(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerLogInfo_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlGpuInstanceGetVgpuSchedulerLog
    _check_or_init_nvml()
    if __nvmlGpuInstanceGetVgpuSchedulerLog == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlGpuInstanceGetVgpuSchedulerLog is not found")
    return (<nvmlReturn_t (*)(nvmlGpuInstance_t, nvmlVgpuSchedulerLogInfo_t*) noexcept nogil>__nvmlGpuInstanceGetVgpuSchedulerLog)(
        gpuInstance, pSchedulerLogInfo)


cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuTypeCreatablePlacements(nvmlGpuInstance_t gpuInstance, nvmlVgpuCreatablePlacementInfo_t* pCreatablePlacementInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlGpuInstanceGetVgpuTypeCreatablePlacements
    _check_or_init_nvml()
    if __nvmlGpuInstanceGetVgpuTypeCreatablePlacements == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlGpuInstanceGetVgpuTypeCreatablePlacements is not found")
    return (<nvmlReturn_t (*)(nvmlGpuInstance_t, nvmlVgpuCreatablePlacementInfo_t*) noexcept nogil>__nvmlGpuInstanceGetVgpuTypeCreatablePlacements)(
        gpuInstance, pCreatablePlacementInfo)


cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuHeterogeneousMode(nvmlGpuInstance_t gpuInstance, nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlGpuInstanceGetVgpuHeterogeneousMode
    _check_or_init_nvml()
    if __nvmlGpuInstanceGetVgpuHeterogeneousMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlGpuInstanceGetVgpuHeterogeneousMode is not found")
    return (<nvmlReturn_t (*)(nvmlGpuInstance_t, nvmlVgpuHeterogeneousMode_t*) noexcept nogil>__nvmlGpuInstanceGetVgpuHeterogeneousMode)(
        gpuInstance, pHeterogeneousMode)


cdef nvmlReturn_t _nvmlGpuInstanceSetVgpuHeterogeneousMode(nvmlGpuInstance_t gpuInstance, const nvmlVgpuHeterogeneousMode_t* pHeterogeneousMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlGpuInstanceSetVgpuHeterogeneousMode
    _check_or_init_nvml()
    if __nvmlGpuInstanceSetVgpuHeterogeneousMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlGpuInstanceSetVgpuHeterogeneousMode is not found")
    return (<nvmlReturn_t (*)(nvmlGpuInstance_t, const nvmlVgpuHeterogeneousMode_t*) noexcept nogil>__nvmlGpuInstanceSetVgpuHeterogeneousMode)(
        gpuInstance, pHeterogeneousMode)


cdef nvmlReturn_t _nvmlVgpuInstanceGetMetadata(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuMetadata_t* vgpuMetadata, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuInstanceGetMetadata
    _check_or_init_nvml()
    if __nvmlVgpuInstanceGetMetadata == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuInstanceGetMetadata is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuInstance_t, nvmlVgpuMetadata_t*, unsigned int*) noexcept nogil>__nvmlVgpuInstanceGetMetadata)(
        vgpuInstance, vgpuMetadata, bufferSize)


cdef nvmlReturn_t _nvmlDeviceGetVgpuMetadata(nvmlDevice_t device, nvmlVgpuPgpuMetadata_t* pgpuMetadata, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetVgpuMetadata
    _check_or_init_nvml()
    if __nvmlDeviceGetVgpuMetadata == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetVgpuMetadata is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlVgpuPgpuMetadata_t*, unsigned int*) noexcept nogil>__nvmlDeviceGetVgpuMetadata)(
        device, pgpuMetadata, bufferSize)


cdef nvmlReturn_t _nvmlGetVgpuCompatibility(nvmlVgpuMetadata_t* vgpuMetadata, nvmlVgpuPgpuMetadata_t* pgpuMetadata, nvmlVgpuPgpuCompatibility_t* compatibilityInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlGetVgpuCompatibility
    _check_or_init_nvml()
    if __nvmlGetVgpuCompatibility == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlGetVgpuCompatibility is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuMetadata_t*, nvmlVgpuPgpuMetadata_t*, nvmlVgpuPgpuCompatibility_t*) noexcept nogil>__nvmlGetVgpuCompatibility)(
        vgpuMetadata, pgpuMetadata, compatibilityInfo)


cdef nvmlReturn_t _nvmlDeviceGetPgpuMetadataString(nvmlDevice_t device, char* pgpuMetadata, unsigned int* bufferSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetPgpuMetadataString
    _check_or_init_nvml()
    if __nvmlDeviceGetPgpuMetadataString == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetPgpuMetadataString is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, char*, unsigned int*) noexcept nogil>__nvmlDeviceGetPgpuMetadataString)(
        device, pgpuMetadata, bufferSize)


cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerLog(nvmlDevice_t device, nvmlVgpuSchedulerLog_t* pSchedulerLog) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetVgpuSchedulerLog
    _check_or_init_nvml()
    if __nvmlDeviceGetVgpuSchedulerLog == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetVgpuSchedulerLog is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlVgpuSchedulerLog_t*) noexcept nogil>__nvmlDeviceGetVgpuSchedulerLog)(
        device, pSchedulerLog)


cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerState(nvmlDevice_t device, nvmlVgpuSchedulerGetState_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetVgpuSchedulerState
    _check_or_init_nvml()
    if __nvmlDeviceGetVgpuSchedulerState == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetVgpuSchedulerState is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlVgpuSchedulerGetState_t*) noexcept nogil>__nvmlDeviceGetVgpuSchedulerState)(
        device, pSchedulerState)


cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerCapabilities(nvmlDevice_t device, nvmlVgpuSchedulerCapabilities_t* pCapabilities) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetVgpuSchedulerCapabilities
    _check_or_init_nvml()
    if __nvmlDeviceGetVgpuSchedulerCapabilities == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetVgpuSchedulerCapabilities is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlVgpuSchedulerCapabilities_t*) noexcept nogil>__nvmlDeviceGetVgpuSchedulerCapabilities)(
        device, pCapabilities)


cdef nvmlReturn_t _nvmlDeviceSetVgpuSchedulerState(nvmlDevice_t device, nvmlVgpuSchedulerSetState_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetVgpuSchedulerState
    _check_or_init_nvml()
    if __nvmlDeviceSetVgpuSchedulerState == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetVgpuSchedulerState is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlVgpuSchedulerSetState_t*) noexcept nogil>__nvmlDeviceSetVgpuSchedulerState)(
        device, pSchedulerState)


cdef nvmlReturn_t _nvmlGetVgpuVersion(nvmlVgpuVersion_t* supported, nvmlVgpuVersion_t* current) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlGetVgpuVersion
    _check_or_init_nvml()
    if __nvmlGetVgpuVersion == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlGetVgpuVersion is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuVersion_t*, nvmlVgpuVersion_t*) noexcept nogil>__nvmlGetVgpuVersion)(
        supported, current)


cdef nvmlReturn_t _nvmlSetVgpuVersion(nvmlVgpuVersion_t* vgpuVersion) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlSetVgpuVersion
    _check_or_init_nvml()
    if __nvmlSetVgpuVersion == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlSetVgpuVersion is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuVersion_t*) noexcept nogil>__nvmlSetVgpuVersion)(
        vgpuVersion)


cdef nvmlReturn_t _nvmlDeviceGetVgpuUtilization(nvmlDevice_t device, unsigned long long lastSeenTimeStamp, nvmlValueType_t* sampleValType, unsigned int* vgpuInstanceSamplesCount, nvmlVgpuInstanceUtilizationSample_t* utilizationSamples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetVgpuUtilization
    _check_or_init_nvml()
    if __nvmlDeviceGetVgpuUtilization == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetVgpuUtilization is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned long long, nvmlValueType_t*, unsigned int*, nvmlVgpuInstanceUtilizationSample_t*) noexcept nogil>__nvmlDeviceGetVgpuUtilization)(
        device, lastSeenTimeStamp, sampleValType, vgpuInstanceSamplesCount, utilizationSamples)


cdef nvmlReturn_t _nvmlDeviceGetVgpuInstancesUtilizationInfo(nvmlDevice_t device, nvmlVgpuInstancesUtilizationInfo_t* vgpuUtilInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetVgpuInstancesUtilizationInfo
    _check_or_init_nvml()
    if __nvmlDeviceGetVgpuInstancesUtilizationInfo == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetVgpuInstancesUtilizationInfo is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlVgpuInstancesUtilizationInfo_t*) noexcept nogil>__nvmlDeviceGetVgpuInstancesUtilizationInfo)(
        device, vgpuUtilInfo)


cdef nvmlReturn_t _nvmlDeviceGetVgpuProcessUtilization(nvmlDevice_t device, unsigned long long lastSeenTimeStamp, unsigned int* vgpuProcessSamplesCount, nvmlVgpuProcessUtilizationSample_t* utilizationSamples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetVgpuProcessUtilization
    _check_or_init_nvml()
    if __nvmlDeviceGetVgpuProcessUtilization == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetVgpuProcessUtilization is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned long long, unsigned int*, nvmlVgpuProcessUtilizationSample_t*) noexcept nogil>__nvmlDeviceGetVgpuProcessUtilization)(
        device, lastSeenTimeStamp, vgpuProcessSamplesCount, utilizationSamples)


cdef nvmlReturn_t _nvmlDeviceGetVgpuProcessesUtilizationInfo(nvmlDevice_t device, nvmlVgpuProcessesUtilizationInfo_t* vgpuProcUtilInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetVgpuProcessesUtilizationInfo
    _check_or_init_nvml()
    if __nvmlDeviceGetVgpuProcessesUtilizationInfo == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetVgpuProcessesUtilizationInfo is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlVgpuProcessesUtilizationInfo_t*) noexcept nogil>__nvmlDeviceGetVgpuProcessesUtilizationInfo)(
        device, vgpuProcUtilInfo)


cdef nvmlReturn_t _nvmlVgpuInstanceGetAccountingMode(nvmlVgpuInstance_t vgpuInstance, nvmlEnableState_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuInstanceGetAccountingMode
    _check_or_init_nvml()
    if __nvmlVgpuInstanceGetAccountingMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuInstanceGetAccountingMode is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuInstance_t, nvmlEnableState_t*) noexcept nogil>__nvmlVgpuInstanceGetAccountingMode)(
        vgpuInstance, mode)


cdef nvmlReturn_t _nvmlVgpuInstanceGetAccountingPids(nvmlVgpuInstance_t vgpuInstance, unsigned int* count, unsigned int* pids) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuInstanceGetAccountingPids
    _check_or_init_nvml()
    if __nvmlVgpuInstanceGetAccountingPids == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuInstanceGetAccountingPids is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuInstance_t, unsigned int*, unsigned int*) noexcept nogil>__nvmlVgpuInstanceGetAccountingPids)(
        vgpuInstance, count, pids)


cdef nvmlReturn_t _nvmlVgpuInstanceGetAccountingStats(nvmlVgpuInstance_t vgpuInstance, unsigned int pid, nvmlAccountingStats_t* stats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuInstanceGetAccountingStats
    _check_or_init_nvml()
    if __nvmlVgpuInstanceGetAccountingStats == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuInstanceGetAccountingStats is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuInstance_t, unsigned int, nvmlAccountingStats_t*) noexcept nogil>__nvmlVgpuInstanceGetAccountingStats)(
        vgpuInstance, pid, stats)


cdef nvmlReturn_t _nvmlVgpuInstanceClearAccountingPids(nvmlVgpuInstance_t vgpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuInstanceClearAccountingPids
    _check_or_init_nvml()
    if __nvmlVgpuInstanceClearAccountingPids == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuInstanceClearAccountingPids is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuInstance_t) noexcept nogil>__nvmlVgpuInstanceClearAccountingPids)(
        vgpuInstance)


cdef nvmlReturn_t _nvmlVgpuInstanceGetLicenseInfo_v2(nvmlVgpuInstance_t vgpuInstance, nvmlVgpuLicenseInfo_t* licenseInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlVgpuInstanceGetLicenseInfo_v2
    _check_or_init_nvml()
    if __nvmlVgpuInstanceGetLicenseInfo_v2 == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlVgpuInstanceGetLicenseInfo_v2 is not found")
    return (<nvmlReturn_t (*)(nvmlVgpuInstance_t, nvmlVgpuLicenseInfo_t*) noexcept nogil>__nvmlVgpuInstanceGetLicenseInfo_v2)(
        vgpuInstance, licenseInfo)


cdef nvmlReturn_t _nvmlGetExcludedDeviceCount(unsigned int* deviceCount) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlGetExcludedDeviceCount
    _check_or_init_nvml()
    if __nvmlGetExcludedDeviceCount == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlGetExcludedDeviceCount is not found")
    return (<nvmlReturn_t (*)(unsigned int*) noexcept nogil>__nvmlGetExcludedDeviceCount)(
        deviceCount)


cdef nvmlReturn_t _nvmlGetExcludedDeviceInfoByIndex(unsigned int index, nvmlExcludedDeviceInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlGetExcludedDeviceInfoByIndex
    _check_or_init_nvml()
    if __nvmlGetExcludedDeviceInfoByIndex == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlGetExcludedDeviceInfoByIndex is not found")
    return (<nvmlReturn_t (*)(unsigned int, nvmlExcludedDeviceInfo_t*) noexcept nogil>__nvmlGetExcludedDeviceInfoByIndex)(
        index, info)


cdef nvmlReturn_t _nvmlDeviceSetMigMode(nvmlDevice_t device, unsigned int mode, nvmlReturn_t* activationStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetMigMode
    _check_or_init_nvml()
    if __nvmlDeviceSetMigMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetMigMode is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, nvmlReturn_t*) noexcept nogil>__nvmlDeviceSetMigMode)(
        device, mode, activationStatus)


cdef nvmlReturn_t _nvmlDeviceGetMigMode(nvmlDevice_t device, unsigned int* currentMode, unsigned int* pendingMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetMigMode
    _check_or_init_nvml()
    if __nvmlDeviceGetMigMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetMigMode is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*, unsigned int*) noexcept nogil>__nvmlDeviceGetMigMode)(
        device, currentMode, pendingMode)


cdef nvmlReturn_t _nvmlDeviceGetGpuInstanceProfileInfoV(nvmlDevice_t device, unsigned int profile, nvmlGpuInstanceProfileInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetGpuInstanceProfileInfoV
    _check_or_init_nvml()
    if __nvmlDeviceGetGpuInstanceProfileInfoV == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetGpuInstanceProfileInfoV is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, nvmlGpuInstanceProfileInfo_v2_t*) noexcept nogil>__nvmlDeviceGetGpuInstanceProfileInfoV)(
        device, profile, info)


cdef nvmlReturn_t _nvmlDeviceGetGpuInstancePossiblePlacements_v2(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstancePlacement_t* placements, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetGpuInstancePossiblePlacements_v2
    _check_or_init_nvml()
    if __nvmlDeviceGetGpuInstancePossiblePlacements_v2 == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetGpuInstancePossiblePlacements_v2 is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, nvmlGpuInstancePlacement_t*, unsigned int*) noexcept nogil>__nvmlDeviceGetGpuInstancePossiblePlacements_v2)(
        device, profileId, placements, count)


cdef nvmlReturn_t _nvmlDeviceGetGpuInstanceRemainingCapacity(nvmlDevice_t device, unsigned int profileId, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetGpuInstanceRemainingCapacity
    _check_or_init_nvml()
    if __nvmlDeviceGetGpuInstanceRemainingCapacity == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetGpuInstanceRemainingCapacity is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, unsigned int*) noexcept nogil>__nvmlDeviceGetGpuInstanceRemainingCapacity)(
        device, profileId, count)


cdef nvmlReturn_t _nvmlDeviceCreateGpuInstance(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstance_t* gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceCreateGpuInstance
    _check_or_init_nvml()
    if __nvmlDeviceCreateGpuInstance == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceCreateGpuInstance is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, nvmlGpuInstance_t*) noexcept nogil>__nvmlDeviceCreateGpuInstance)(
        device, profileId, gpuInstance)


cdef nvmlReturn_t _nvmlDeviceCreateGpuInstanceWithPlacement(nvmlDevice_t device, unsigned int profileId, const nvmlGpuInstancePlacement_t* placement, nvmlGpuInstance_t* gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceCreateGpuInstanceWithPlacement
    _check_or_init_nvml()
    if __nvmlDeviceCreateGpuInstanceWithPlacement == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceCreateGpuInstanceWithPlacement is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, const nvmlGpuInstancePlacement_t*, nvmlGpuInstance_t*) noexcept nogil>__nvmlDeviceCreateGpuInstanceWithPlacement)(
        device, profileId, placement, gpuInstance)


cdef nvmlReturn_t _nvmlGpuInstanceDestroy(nvmlGpuInstance_t gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlGpuInstanceDestroy
    _check_or_init_nvml()
    if __nvmlGpuInstanceDestroy == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlGpuInstanceDestroy is not found")
    return (<nvmlReturn_t (*)(nvmlGpuInstance_t) noexcept nogil>__nvmlGpuInstanceDestroy)(
        gpuInstance)


cdef nvmlReturn_t _nvmlDeviceGetGpuInstances(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstance_t* gpuInstances, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetGpuInstances
    _check_or_init_nvml()
    if __nvmlDeviceGetGpuInstances == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetGpuInstances is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, nvmlGpuInstance_t*, unsigned int*) noexcept nogil>__nvmlDeviceGetGpuInstances)(
        device, profileId, gpuInstances, count)


cdef nvmlReturn_t _nvmlDeviceGetGpuInstanceById(nvmlDevice_t device, unsigned int id, nvmlGpuInstance_t* gpuInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetGpuInstanceById
    _check_or_init_nvml()
    if __nvmlDeviceGetGpuInstanceById == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetGpuInstanceById is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, nvmlGpuInstance_t*) noexcept nogil>__nvmlDeviceGetGpuInstanceById)(
        device, id, gpuInstance)


cdef nvmlReturn_t _nvmlGpuInstanceGetInfo(nvmlGpuInstance_t gpuInstance, nvmlGpuInstanceInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlGpuInstanceGetInfo
    _check_or_init_nvml()
    if __nvmlGpuInstanceGetInfo == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlGpuInstanceGetInfo is not found")
    return (<nvmlReturn_t (*)(nvmlGpuInstance_t, nvmlGpuInstanceInfo_t*) noexcept nogil>__nvmlGpuInstanceGetInfo)(
        gpuInstance, info)


cdef nvmlReturn_t _nvmlGpuInstanceGetComputeInstanceProfileInfoV(nvmlGpuInstance_t gpuInstance, unsigned int profile, unsigned int engProfile, nvmlComputeInstanceProfileInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlGpuInstanceGetComputeInstanceProfileInfoV
    _check_or_init_nvml()
    if __nvmlGpuInstanceGetComputeInstanceProfileInfoV == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlGpuInstanceGetComputeInstanceProfileInfoV is not found")
    return (<nvmlReturn_t (*)(nvmlGpuInstance_t, unsigned int, unsigned int, nvmlComputeInstanceProfileInfo_v2_t*) noexcept nogil>__nvmlGpuInstanceGetComputeInstanceProfileInfoV)(
        gpuInstance, profile, engProfile, info)


cdef nvmlReturn_t _nvmlGpuInstanceGetComputeInstanceRemainingCapacity(nvmlGpuInstance_t gpuInstance, unsigned int profileId, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlGpuInstanceGetComputeInstanceRemainingCapacity
    _check_or_init_nvml()
    if __nvmlGpuInstanceGetComputeInstanceRemainingCapacity == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlGpuInstanceGetComputeInstanceRemainingCapacity is not found")
    return (<nvmlReturn_t (*)(nvmlGpuInstance_t, unsigned int, unsigned int*) noexcept nogil>__nvmlGpuInstanceGetComputeInstanceRemainingCapacity)(
        gpuInstance, profileId, count)


cdef nvmlReturn_t _nvmlGpuInstanceGetComputeInstancePossiblePlacements(nvmlGpuInstance_t gpuInstance, unsigned int profileId, nvmlComputeInstancePlacement_t* placements, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlGpuInstanceGetComputeInstancePossiblePlacements
    _check_or_init_nvml()
    if __nvmlGpuInstanceGetComputeInstancePossiblePlacements == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlGpuInstanceGetComputeInstancePossiblePlacements is not found")
    return (<nvmlReturn_t (*)(nvmlGpuInstance_t, unsigned int, nvmlComputeInstancePlacement_t*, unsigned int*) noexcept nogil>__nvmlGpuInstanceGetComputeInstancePossiblePlacements)(
        gpuInstance, profileId, placements, count)


cdef nvmlReturn_t _nvmlGpuInstanceCreateComputeInstance(nvmlGpuInstance_t gpuInstance, unsigned int profileId, nvmlComputeInstance_t* computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlGpuInstanceCreateComputeInstance
    _check_or_init_nvml()
    if __nvmlGpuInstanceCreateComputeInstance == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlGpuInstanceCreateComputeInstance is not found")
    return (<nvmlReturn_t (*)(nvmlGpuInstance_t, unsigned int, nvmlComputeInstance_t*) noexcept nogil>__nvmlGpuInstanceCreateComputeInstance)(
        gpuInstance, profileId, computeInstance)


cdef nvmlReturn_t _nvmlGpuInstanceCreateComputeInstanceWithPlacement(nvmlGpuInstance_t gpuInstance, unsigned int profileId, const nvmlComputeInstancePlacement_t* placement, nvmlComputeInstance_t* computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlGpuInstanceCreateComputeInstanceWithPlacement
    _check_or_init_nvml()
    if __nvmlGpuInstanceCreateComputeInstanceWithPlacement == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlGpuInstanceCreateComputeInstanceWithPlacement is not found")
    return (<nvmlReturn_t (*)(nvmlGpuInstance_t, unsigned int, const nvmlComputeInstancePlacement_t*, nvmlComputeInstance_t*) noexcept nogil>__nvmlGpuInstanceCreateComputeInstanceWithPlacement)(
        gpuInstance, profileId, placement, computeInstance)


cdef nvmlReturn_t _nvmlComputeInstanceDestroy(nvmlComputeInstance_t computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlComputeInstanceDestroy
    _check_or_init_nvml()
    if __nvmlComputeInstanceDestroy == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlComputeInstanceDestroy is not found")
    return (<nvmlReturn_t (*)(nvmlComputeInstance_t) noexcept nogil>__nvmlComputeInstanceDestroy)(
        computeInstance)


cdef nvmlReturn_t _nvmlGpuInstanceGetComputeInstances(nvmlGpuInstance_t gpuInstance, unsigned int profileId, nvmlComputeInstance_t* computeInstances, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlGpuInstanceGetComputeInstances
    _check_or_init_nvml()
    if __nvmlGpuInstanceGetComputeInstances == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlGpuInstanceGetComputeInstances is not found")
    return (<nvmlReturn_t (*)(nvmlGpuInstance_t, unsigned int, nvmlComputeInstance_t*, unsigned int*) noexcept nogil>__nvmlGpuInstanceGetComputeInstances)(
        gpuInstance, profileId, computeInstances, count)


cdef nvmlReturn_t _nvmlGpuInstanceGetComputeInstanceById(nvmlGpuInstance_t gpuInstance, unsigned int id, nvmlComputeInstance_t* computeInstance) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlGpuInstanceGetComputeInstanceById
    _check_or_init_nvml()
    if __nvmlGpuInstanceGetComputeInstanceById == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlGpuInstanceGetComputeInstanceById is not found")
    return (<nvmlReturn_t (*)(nvmlGpuInstance_t, unsigned int, nvmlComputeInstance_t*) noexcept nogil>__nvmlGpuInstanceGetComputeInstanceById)(
        gpuInstance, id, computeInstance)


cdef nvmlReturn_t _nvmlComputeInstanceGetInfo_v2(nvmlComputeInstance_t computeInstance, nvmlComputeInstanceInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlComputeInstanceGetInfo_v2
    _check_or_init_nvml()
    if __nvmlComputeInstanceGetInfo_v2 == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlComputeInstanceGetInfo_v2 is not found")
    return (<nvmlReturn_t (*)(nvmlComputeInstance_t, nvmlComputeInstanceInfo_t*) noexcept nogil>__nvmlComputeInstanceGetInfo_v2)(
        computeInstance, info)


cdef nvmlReturn_t _nvmlDeviceIsMigDeviceHandle(nvmlDevice_t device, unsigned int* isMigDevice) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceIsMigDeviceHandle
    _check_or_init_nvml()
    if __nvmlDeviceIsMigDeviceHandle == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceIsMigDeviceHandle is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceIsMigDeviceHandle)(
        device, isMigDevice)


cdef nvmlReturn_t _nvmlDeviceGetGpuInstanceId(nvmlDevice_t device, unsigned int* id) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetGpuInstanceId
    _check_or_init_nvml()
    if __nvmlDeviceGetGpuInstanceId == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetGpuInstanceId is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceGetGpuInstanceId)(
        device, id)


cdef nvmlReturn_t _nvmlDeviceGetComputeInstanceId(nvmlDevice_t device, unsigned int* id) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetComputeInstanceId
    _check_or_init_nvml()
    if __nvmlDeviceGetComputeInstanceId == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetComputeInstanceId is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceGetComputeInstanceId)(
        device, id)


cdef nvmlReturn_t _nvmlDeviceGetMaxMigDeviceCount(nvmlDevice_t device, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetMaxMigDeviceCount
    _check_or_init_nvml()
    if __nvmlDeviceGetMaxMigDeviceCount == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetMaxMigDeviceCount is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlDeviceGetMaxMigDeviceCount)(
        device, count)


cdef nvmlReturn_t _nvmlDeviceGetMigDeviceHandleByIndex(nvmlDevice_t device, unsigned int index, nvmlDevice_t* migDevice) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetMigDeviceHandleByIndex
    _check_or_init_nvml()
    if __nvmlDeviceGetMigDeviceHandleByIndex == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetMigDeviceHandleByIndex is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, nvmlDevice_t*) noexcept nogil>__nvmlDeviceGetMigDeviceHandleByIndex)(
        device, index, migDevice)


cdef nvmlReturn_t _nvmlDeviceGetDeviceHandleFromMigDeviceHandle(nvmlDevice_t migDevice, nvmlDevice_t* device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetDeviceHandleFromMigDeviceHandle
    _check_or_init_nvml()
    if __nvmlDeviceGetDeviceHandleFromMigDeviceHandle == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetDeviceHandleFromMigDeviceHandle is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlDevice_t*) noexcept nogil>__nvmlDeviceGetDeviceHandleFromMigDeviceHandle)(
        migDevice, device)


cdef nvmlReturn_t _nvmlGpmSampleGet(nvmlDevice_t device, nvmlGpmSample_t gpmSample) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlGpmSampleGet
    _check_or_init_nvml()
    if __nvmlGpmSampleGet == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlGpmSampleGet is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlGpmSample_t) noexcept nogil>__nvmlGpmSampleGet)(
        device, gpmSample)


cdef nvmlReturn_t _nvmlGpmMigSampleGet(nvmlDevice_t device, unsigned int gpuInstanceId, nvmlGpmSample_t gpmSample) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlGpmMigSampleGet
    _check_or_init_nvml()
    if __nvmlGpmMigSampleGet == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlGpmMigSampleGet is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, nvmlGpmSample_t) noexcept nogil>__nvmlGpmMigSampleGet)(
        device, gpuInstanceId, gpmSample)


cdef nvmlReturn_t _nvmlGpmQueryDeviceSupport(nvmlDevice_t device, nvmlGpmSupport_t* gpmSupport) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlGpmQueryDeviceSupport
    _check_or_init_nvml()
    if __nvmlGpmQueryDeviceSupport == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlGpmQueryDeviceSupport is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlGpmSupport_t*) noexcept nogil>__nvmlGpmQueryDeviceSupport)(
        device, gpmSupport)


cdef nvmlReturn_t _nvmlGpmQueryIfStreamingEnabled(nvmlDevice_t device, unsigned int* state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlGpmQueryIfStreamingEnabled
    _check_or_init_nvml()
    if __nvmlGpmQueryIfStreamingEnabled == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlGpmQueryIfStreamingEnabled is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int*) noexcept nogil>__nvmlGpmQueryIfStreamingEnabled)(
        device, state)


cdef nvmlReturn_t _nvmlGpmSetStreamingEnabled(nvmlDevice_t device, unsigned int state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlGpmSetStreamingEnabled
    _check_or_init_nvml()
    if __nvmlGpmSetStreamingEnabled == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlGpmSetStreamingEnabled is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int) noexcept nogil>__nvmlGpmSetStreamingEnabled)(
        device, state)


cdef nvmlReturn_t _nvmlDeviceGetCapabilities(nvmlDevice_t device, nvmlDeviceCapabilities_t* caps) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetCapabilities
    _check_or_init_nvml()
    if __nvmlDeviceGetCapabilities == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetCapabilities is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlDeviceCapabilities_t*) noexcept nogil>__nvmlDeviceGetCapabilities)(
        device, caps)


cdef nvmlReturn_t _nvmlDeviceWorkloadPowerProfileClearRequestedProfiles(nvmlDevice_t device, nvmlWorkloadPowerProfileRequestedProfiles_t* requestedProfiles) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceWorkloadPowerProfileClearRequestedProfiles
    _check_or_init_nvml()
    if __nvmlDeviceWorkloadPowerProfileClearRequestedProfiles == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceWorkloadPowerProfileClearRequestedProfiles is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlWorkloadPowerProfileRequestedProfiles_t*) noexcept nogil>__nvmlDeviceWorkloadPowerProfileClearRequestedProfiles)(
        device, requestedProfiles)


cdef nvmlReturn_t _nvmlDevicePowerSmoothingActivatePresetProfile(nvmlDevice_t device, nvmlPowerSmoothingProfile_t* profile) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDevicePowerSmoothingActivatePresetProfile
    _check_or_init_nvml()
    if __nvmlDevicePowerSmoothingActivatePresetProfile == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDevicePowerSmoothingActivatePresetProfile is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlPowerSmoothingProfile_t*) noexcept nogil>__nvmlDevicePowerSmoothingActivatePresetProfile)(
        device, profile)


cdef nvmlReturn_t _nvmlDevicePowerSmoothingUpdatePresetProfileParam(nvmlDevice_t device, nvmlPowerSmoothingProfile_t* profile) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDevicePowerSmoothingUpdatePresetProfileParam
    _check_or_init_nvml()
    if __nvmlDevicePowerSmoothingUpdatePresetProfileParam == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDevicePowerSmoothingUpdatePresetProfileParam is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlPowerSmoothingProfile_t*) noexcept nogil>__nvmlDevicePowerSmoothingUpdatePresetProfileParam)(
        device, profile)


cdef nvmlReturn_t _nvmlDevicePowerSmoothingSetState(nvmlDevice_t device, nvmlPowerSmoothingState_t* state) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDevicePowerSmoothingSetState
    _check_or_init_nvml()
    if __nvmlDevicePowerSmoothingSetState == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDevicePowerSmoothingSetState is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlPowerSmoothingState_t*) noexcept nogil>__nvmlDevicePowerSmoothingSetState)(
        device, state)


cdef nvmlReturn_t _nvmlDeviceGetAddressingMode(nvmlDevice_t device, nvmlDeviceAddressingMode_t* mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetAddressingMode
    _check_or_init_nvml()
    if __nvmlDeviceGetAddressingMode == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetAddressingMode is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlDeviceAddressingMode_t*) noexcept nogil>__nvmlDeviceGetAddressingMode)(
        device, mode)


cdef nvmlReturn_t _nvmlDeviceGetRepairStatus(nvmlDevice_t device, nvmlRepairStatus_t* repairStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetRepairStatus
    _check_or_init_nvml()
    if __nvmlDeviceGetRepairStatus == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetRepairStatus is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlRepairStatus_t*) noexcept nogil>__nvmlDeviceGetRepairStatus)(
        device, repairStatus)


cdef nvmlReturn_t _nvmlDeviceGetPowerMizerMode_v1(nvmlDevice_t device, nvmlDevicePowerMizerModes_v1_t* powerMizerMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetPowerMizerMode_v1
    _check_or_init_nvml()
    if __nvmlDeviceGetPowerMizerMode_v1 == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetPowerMizerMode_v1 is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlDevicePowerMizerModes_v1_t*) noexcept nogil>__nvmlDeviceGetPowerMizerMode_v1)(
        device, powerMizerMode)


cdef nvmlReturn_t _nvmlDeviceSetPowerMizerMode_v1(nvmlDevice_t device, nvmlDevicePowerMizerModes_v1_t* powerMizerMode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetPowerMizerMode_v1
    _check_or_init_nvml()
    if __nvmlDeviceSetPowerMizerMode_v1 == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetPowerMizerMode_v1 is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlDevicePowerMizerModes_v1_t*) noexcept nogil>__nvmlDeviceSetPowerMizerMode_v1)(
        device, powerMizerMode)


cdef nvmlReturn_t _nvmlDeviceGetPdi(nvmlDevice_t device, nvmlPdi_t* pdi) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetPdi
    _check_or_init_nvml()
    if __nvmlDeviceGetPdi == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetPdi is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlPdi_t*) noexcept nogil>__nvmlDeviceGetPdi)(
        device, pdi)


cdef nvmlReturn_t _nvmlDeviceSetHostname_v1(nvmlDevice_t device, nvmlHostname_v1_t* hostname) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceSetHostname_v1
    _check_or_init_nvml()
    if __nvmlDeviceSetHostname_v1 == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceSetHostname_v1 is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlHostname_v1_t*) noexcept nogil>__nvmlDeviceSetHostname_v1)(
        device, hostname)


cdef nvmlReturn_t _nvmlDeviceGetHostname_v1(nvmlDevice_t device, nvmlHostname_v1_t* hostname) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetHostname_v1
    _check_or_init_nvml()
    if __nvmlDeviceGetHostname_v1 == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetHostname_v1 is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlHostname_v1_t*) noexcept nogil>__nvmlDeviceGetHostname_v1)(
        device, hostname)


cdef nvmlReturn_t _nvmlDeviceGetNvLinkInfo(nvmlDevice_t device, nvmlNvLinkInfo_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetNvLinkInfo
    _check_or_init_nvml()
    if __nvmlDeviceGetNvLinkInfo == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetNvLinkInfo is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlNvLinkInfo_t*) noexcept nogil>__nvmlDeviceGetNvLinkInfo)(
        device, info)


cdef nvmlReturn_t _nvmlDeviceReadWritePRM_v1(nvmlDevice_t device, nvmlPRMTLV_v1_t* buffer) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceReadWritePRM_v1
    _check_or_init_nvml()
    if __nvmlDeviceReadWritePRM_v1 == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceReadWritePRM_v1 is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlPRMTLV_v1_t*) noexcept nogil>__nvmlDeviceReadWritePRM_v1)(
        device, buffer)


cdef nvmlReturn_t _nvmlDeviceGetGpuInstanceProfileInfoByIdV(nvmlDevice_t device, unsigned int profileId, nvmlGpuInstanceProfileInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetGpuInstanceProfileInfoByIdV
    _check_or_init_nvml()
    if __nvmlDeviceGetGpuInstanceProfileInfoByIdV == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetGpuInstanceProfileInfoByIdV is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, unsigned int, nvmlGpuInstanceProfileInfo_v2_t*) noexcept nogil>__nvmlDeviceGetGpuInstanceProfileInfoByIdV)(
        device, profileId, info)


cdef nvmlReturn_t _nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts(nvmlDevice_t device, nvmlEccSramUniqueUncorrectedErrorCounts_t* errorCounts) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil:
    global __nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts
    _check_or_init_nvml()
    if __nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts == NULL:
        with gil:
            raise FunctionNotFoundError("function nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts is not found")
    return (<nvmlReturn_t (*)(nvmlDevice_t, nvmlEccSramUniqueUncorrectedErrorCounts_t*) noexcept nogil>__nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts)(
        device, errorCounts)