title: CUDA profiling tools "no kernels were profiled"
body: <p>I can't get CUDA profiling tools from being working. My laptop Asus has two video cards. One integrated (Intel) and another one, Nvidia GTX 960M.</p>
  <p>I suspected that the visual profiler is using the integrated video card, so I changed the default video card for this specific application, under the “Nvidia Control Panel” and “Manager 3d Settings-&gt;Program Settings” to use the “High-Performance NVidia Processor”.</p>
  <p>Nothing changed. Running the Visual Profiler, in the “Overall GPU usage” tab, I get “No GPU devices in Session”, which means I far as I can understand that no GPU’s were used.</p>
  <p>Also, I noticed that the Nvidia display icon in the notification area is not reporting any applications that are using the video card.</p>
  <p>What seems to be the problem here? How can I enable also the Nvidia GPU for both Visual Profiler and the command line nvprof.exe application? It seems neither Nsight works for me.</p>
  <p>The code I am testing is the following:</p>
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;iostream&gt;
  #include&lt;stdlib.h&gt;
  #include&lt;string.h&gt;
  
  
  #define NUM_THREADS 256
  
  #define IMG_SIZE 1048576
  
  struct Coefficients_SOA {
    int r;
    int b;
    int g;
    int hue;
    int saturation;
    int maxVal;
    int minVal;
    int finalVal; 
  };
  
  
  __global__
  void complicatedCalculation(Coefficients_SOA*  data)
  {
    int i = blockIdx.x*blockDim.x + threadIdx.x;
  
  
    int grayscale = (data[i].r + data[i].g + data[i].b)/data[i].maxVal;
    int hue_sat = data[i].hue * data[i].saturation / data[i].minVal;
    data[i].finalVal = grayscale*hue_sat; 
  }
  
  void complicatedCalculation()
  {
  
    Coefficients_SOA* d_x;
  
    cudaMalloc(&amp;d_x, IMG_SIZE*sizeof(Coefficients_SOA)); 
  
    int num_blocks = IMG_SIZE/NUM_THREADS;
  
    complicatedCalculation&lt;&lt;&lt;num_blocks,NUM_THREADS&gt;&gt;&gt;(d_x);
  
    cudaFree(d_x);
  }
  
  
  
  int main(int argc, char*argv[])
  {
  
      complicatedCalculation();
      return 0;
  }
  </code></pre>
  <p>Best Regards,</p>
  <p>PS: I installed CUDA Version 11 under win10/64bit</p>
  <p><a href="https://i.stack.imgur.com/SisAa.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SisAa.jpg" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/tDPBU.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tDPBU.jpg" alt="enter image description here" /></a></p>
  <p>Also, I verified the CUDA installation according to <a href="https://docs.nvidia.com/cuda/pdf/CUDA_Installation_Guide_Windows.pdf" rel="nofollow noreferrer">https://docs.nvidia.com/cuda/pdf/CUDA_Installation_Guide_Windows.pdf</a></p>
  <p>I attach the DeviceQuery and BandwidthTest CUDA sample programs for your convenience.</p>
  <h2>deviceQuery Sample report</h2>
  <pre><code>    D:\Program Files\nVidia\CUDA Samples\v11.0\bin\win64\Release&gt;deviceQuery
  deviceQuery Starting...
  
   CUDA Device Query (Runtime API) version (CUDART static linking)
  
  Detected 1 CUDA Capable device(s)
  
  Device 0: &quot;GeForce GTX 960M&quot;
    CUDA Driver Version / Runtime Version          11.0 / 11.0
    CUDA Capability Major/Minor version number:    5.0
    Total amount of global memory:                 4096 MBytes (4294967296 bytes)
    ( 5) Multiprocessors, (128) CUDA Cores/MP:     640 CUDA Cores
    GPU Max Clock rate:                            1176 MHz (1.18 GHz)
    Memory Clock rate:                             2505 Mhz
    Memory Bus Width:                              128-bit
    L2 Cache Size:                                 2097152 bytes
    Maximum Texture Dimension Size (x,y,z)         1D=(65536), 2D=(65536, 65536), 3D=(4096, 4096, 4096)
    Maximum Layered 1D Texture Size, (num) layers  1D=(16384), 2048 layers
    Maximum Layered 2D Texture Size, (num) layers  2D=(16384, 16384), 2048 layers
    Total amount of constant memory:               65536 bytes
    Total amount of shared memory per block:       49152 bytes
    Total number of registers available per block: 65536
    Warp size:                                     32
    Maximum number of threads per multiprocessor:  2048
    Maximum number of threads per block:           1024
    Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
    Max dimension size of a grid size    (x,y,z): (2147483647, 65535, 65535)
    Maximum memory pitch:                          2147483647 bytes
    Texture alignment:                             512 bytes
    Concurrent copy and kernel execution:          Yes with 4 copy engine(s)
    Run time limit on kernels:                     Yes
    Integrated GPU sharing Host Memory:            No
    Support host page-locked memory mapping:       Yes
    Alignment requirement for Surfaces:            Yes
    Device has ECC support:                        Disabled
    CUDA Device Driver Mode (TCC or WDDM):         WDDM (Windows Display Driver Model)
    Device supports Unified Addressing (UVA):      Yes
    Device supports Managed Memory:                Yes
    Device supports Compute Preemption:            No
    Supports Cooperative Kernel Launch:            No
    Supports MultiDevice Co-op Kernel Launch:      No
    Device PCI Domain ID / Bus ID / location ID:   0 / 1 / 0
    Compute Mode:
       &lt; Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) &gt;
  
  deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 11.0, CUDA Runtime Version = 11.0, NumDevs = 1
  Result = PASS
  </code></pre>
  <h2>BandwidthTest Sample report</h2>
  <pre><code>D:\Program Files\nVidia\CUDA Samples\v11.0\bin\win64\Release&gt;bandwidthTest
  [CUDA Bandwidth Test] - Starting...
  Running on...
  
   Device 0: GeForce GTX 960M
   Quick Mode
  
   Host to Device Bandwidth, 1 Device(s)
   PINNED Memory Transfers
     Transfer Size (Bytes)        Bandwidth(GB/s)
     32000000                     12.2
  
   Device to Host Bandwidth, 1 Device(s)
   PINNED Memory Transfers
     Transfer Size (Bytes)        Bandwidth(GB/s)
     32000000                     11.8
  
   Device to Device Bandwidth, 1 Device(s)
   PINNED Memory Transfers
     Transfer Size (Bytes)        Bandwidth(GB/s)
     32000000                     68.9
  
  Result = PASS
  
  NOTE: The CUDA Samples are not meant for performance measurements. Results may vary when GPU Boost is enabled.
  </code></pre>