NCA Performance Optimization & Debugging 2 — Questions and Answers
Question 1: Which NVIDIA tool provides real-time GPU utilization, memory usage, and temperature monitoring from the command line?
- nvidia-smi (Correct answer)
- nvprof
- Nsight Systems
- CUDA-GDB
Correct answer: nvidia-smi
nvidia-smi (NVIDIA System Management Interface) provides real-time monitoring of GPU metrics including utilization, memory, and temperature directly from the terminal.
Question 2: A CUDA kernel achieves only 40% of theoretical memory bandwidth. What is the most likely cause?
- Uncoalesced global memory accesses (Correct answer)
- Too many thread blocks
- Insufficient shared memory allocation
- Excessive register usage
Correct answer: Uncoalesced global memory accesses
Uncoalesced global memory accesses force the GPU to issue multiple memory transactions instead of one, significantly reducing effective bandwidth utilization.
Question 3: In Nsight Compute, a kernel shows high 'Stall: Long Scoreboard' metric. What does this indicate?
- Threads are stalled waiting for global memory loads to complete (Correct answer)
- The kernel has too many active warps
- Shared memory bank conflicts are occurring
- Register file pressure is causing spilling
Correct answer: Threads are stalled waiting for global memory loads to complete
Long Scoreboard stalls indicate threads are waiting for data from global memory loads, pointing to a memory-bound kernel needing better latency hiding or access pattern optimization.
Question 4: Which technique most effectively hides global memory latency in CUDA kernels?
- Increasing the number of active warps per SM (Correct answer)
- Using larger thread blocks
- Reducing kernel launch overhead
- Enabling ECC memory
Correct answer: Increasing the number of active warps per SM
Higher occupancy (more active warps per SM) allows the GPU scheduler to switch to ready warps while others wait for memory, hiding latency effectively.
Question 5: What does the CUDA event timing API measure that CPU timers cannot accurately capture?
- Precise GPU kernel execution time excluding CPU overhead (Correct answer)
- Host-to-device transfer bandwidth
- GPU temperature during execution
- Number of CUDA cores utilized
Correct answer: Precise GPU kernel execution time excluding CPU overhead
CUDA events are recorded on the GPU timeline and measure actual kernel execution time without CPU-side scheduling jitter or synchronization overhead.
Question 6: A developer notices that cudaMemcpy from device to host takes longer than the same-size host-to-device transfer. What is the most probable reason?
- The host memory is not page-locked (pinned) (Correct answer)
- PCIe bandwidth is asymmetric by design
- The GPU memory is fragmented
- ECC correction is adding overhead
Correct answer: The host memory is not page-locked (pinned)
Non-pinned (pageable) host memory requires an extra staging buffer copy through the OS, adding overhead especially noticeable on device-to-host transfers.
Question 7: Which CUDA occupancy metric should a developer target to maximize throughput for a compute-bound kernel?
- Maximize active warps relative to maximum supported warps per SM (Correct answer)
- Maximize the number of registers per thread
- Minimize the number of thread blocks
- Maximize shared memory usage per block
Correct answer: Maximize active warps relative to maximum supported warps per SM
For compute-bound kernels, higher occupancy (ratio of active to maximum warps) keeps execution units busy and improves throughput by better utilizing SM resources.
Which NVIDIA tool provides real-time GPU utilization, memory usage, and temperature monitoring from the command line?