title: How to check what CUDA compute compatibility is the library compiled with?
body: <p>I am on Ubuntu 16.04. Suppose I am given a random libtestcuda.so file, is there anyway I can check what CUDA compute compatibility is the library compiled with?</p>
  
  <p>I have tried </p>
  
  <pre><code>ll libtestcuda.so
  </code></pre>
  
  <p>It doesn't show much.</p>
  
  <p>I want to know this because if I compile my code with </p>
  
  <pre><code>-gencode arch=compute_30,code=sm_30;
  </code></pre>
  
  <p>It compiles and runs fine on a small cuda program I wrote, but when I run deviceQuery on my GPU it actually shows CUDA compute compatibility 3.5, so I am curious to know whether this code will be executed in the 3.0 or 3.5 architecture.</p>
  
  <p>If I compile and run it with </p>
  
  <pre><code>-gencode arch=compute_20,code=sm_20;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>-gencode arch=compute_50,code=sm_50;
  </code></pre>
  
  <p>it fails as expected.</p>
  
  <p>If I compile and run it with </p>
  
  <pre><code>-gencode arch=compute_35,code=sm_35;
  </code></pre>
  
  <p>it runs fine as expected.</p>