2011-03-15 51 views
2

我有一個簡單的(測試)pycuda應用程序,我正試圖分析它。我試過NVidia的計算視覺探查,運行程序11次,然後發出這樣的錯誤:如何在Linux中分析PyCuda代碼?

NV_Warning: Ignoring the invalid profiler config option: fb0_subp0_read_sectors 
Error : Profiler data file '/home/jguy/proj/gpu/tdbp/pyArch/temp_compute_profiler_0_0.csv' does not contain profiler output.This can happen when: 
a) Profiling is disabled during the entire run of the application. 
b) The application does not invoke any kernel launches or memory transfers. 
c) The application does not release resources (contexts, events, etc.). The program needs to be modified to properly free up all resources before termination. 

我也試圖運行「CUDA_PROFILE蟒蛇scriptname.py ARG1」。它創建了一個包含一個文件:

NV_Warning: Ignoring the invalid profiler config option: instructions 
# CUDA_PROFILE_LOG_VERSION 2.0 
# CUDA_DEVICE 0 GeForce GTX 560 Ti 
# CUDA_PROFILE_CSV 1 
# TIMESTAMPFACTOR fffff7003e38fec8 
gpustarttimestamp,method,gputime,cputime,occupancy 

在情況下,它是非常有用的,我也有這些環境乏設置:

CUDA_PROFILE_CONFIG=temp_cuda_profiler.conf 
CUDA_PROFILE_CSV=1 
CUDA_PROFILE_LOG=profile.csv 
CUDA_PROFILE=1 

和temp_cuda_profiler.conf包含

gpustarttimestamp 
instructions 

谷歌上搜索了一個小時或者。沒有運氣。感謝您提供的任何見解!

回答

1

當使用import pycuda.autoinit時,在程序結束時使用pycuda.autoinit.context.detach()是很重要的。這解決了這個問題。