Cuda 8.0을 사용하는 Ubuntu 16.04에서 cuda 코드를 프로파일하려고하는데 "프로파일 링 할 수 없습니다 .Unified Memory profiling failed"입니다. 나는 터미널과 Nisght Eclipe에서 프로파일 링을 시도했다. 코드가 컴파일되고 실행 중이지만 프로필을 가져올 수 없습니다. -o 교수 nvprof 코드 -통합 메모리 프로파일 링에 실패했습니다.
NVCC -lcusparse main.cu -o hello.out
- 프로파일
를 컴파일
코드 -
cusparseHandle_t handle;
cusparseCreate(&handle);
cusparseSafeCall(cusparseCreate(&handle));
//set the parameters
const int n_i = 10;
const int d = 18;
const int n_t = 40;
const int n_tau = 2;
const int n_k = 10;
float *data = generate_matrix3_1(d, n_i, n_t);
//float* data = get_data1(d, n_i,n_t);
float* a = generate_matrix3_1(n_i,n_k,n_tau);
float* b = sparse_generate_matrix1(n_k,d,0.5);
float* c = sparse_generate_matrix1(n_k,d,0.5);
float* previous_a = generate_matrix3_1(n_i,n_k,n_tau);
float* previous_b = sparse_generate_matrix1(n_k,d,0.1);
float* previous_c = sparse_generate_matrix1(n_k,d,0.1);
// calculate norm of data
float norm_data = 0;
for (int i = 0; i < n_i; i++)
{
for (int t = n_tau; t < n_t; t++)
{
for (int p = 0; p < d; p++)
{
norm_data = norm_data + ((data[p*n_i*n_t + i*n_t + t])*(data[p*n_i*n_t + i*n_t + t]));
}
}
}
// set lambda and gamma parameter
float lambda = 0.0001;
float gamma_a = 2;
float gamma_b = 3;
float gamma_c = 4;
float updated_t = 1;
float updated_t1 = 0;
float rel_error = 0;
int loop = 1;
float objective = 0;
// create sparse format for the data
float **h_data = new float*[1];
int **h_data_RowIndices = new int*[1];
int **h_data_ColIndices = new int*[1];
int nnz_data = create_sparse_MY(data,d,n_i*n_t,h_data,h_data_RowIndices,h_data_ColIndices);
// transfer sparse data to device memory
int *d_data_RowIndices; (cudaMalloc(&d_data_RowIndices, (d+1) * sizeof(int)));
(cudaMemcpy(d_data_RowIndices, h_data_RowIndices[0], (d+1) * sizeof(int), cudaMemcpyHostToDevice));
int *d_data_ColIndices; (cudaMalloc(&d_data_ColIndices, nnz_data * sizeof(int)));
(cudaMemcpy(d_data_ColIndices, h_data_ColIndices[0], (nnz_data) * sizeof(int), cudaMemcpyHostToDevice));
명령 ./ hello.out
오류 -
== 13621 == NVPROF는 프로파일 링 프로세스 13621, 명령입니다. ./hello.out ======== 오류 : 통합 메모리 프로파일 링에 실패했습니다.
누군가 나를 도와 줄 수 있습니까?
간단한 테스트 케이스를 제공하십시오. 프로파일 링하려는 프로그램, 컴파일 된 방법, 프로필 작성에 사용 된 전체 명령 및 전체 출력 메시지. –
질문 업데이트 –