{"action":"created","issue":{"url":"https://api.github.com/repos/dmalhotra/pvfmm/issues/3","repository_url":"https://api.github.com/repos/dmalhotra/pvfmm","labels_url":"https://api.github.com/repos/dmalhotra/pvfmm/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/dmalhotra/pvfmm/issues/3/comments","events_url":"https://api.github.com/repos/dmalhotra/pvfmm/issues/3/events","html_url":"https://github.com/dmalhotra/pvfmm/issues/3","id":171550127,"number":3,"title":"Segmentation fault when compiled with cuda","user":{"login":"wenyan4work","id":21070332,"avatar_url":"https://avatars.githubusercontent.com/u/21070332?v=3","gravatar_id":"","url":"https://api.github.com/users/wenyan4work","html_url":"https://github.com/wenyan4work","followers_url":"https://api.github.com/users/wenyan4work/followers","following_url":"https://api.github.com/users/wenyan4work/following{/other_user}","gists_url":"https://api.github.com/users/wenyan4work/gists{/gist_id}","starred_url":"https://api.github.com/users/wenyan4work/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wenyan4work/subscriptions","organizations_url":"https://api.github.com/users/wenyan4work/orgs","repos_url":"https://api.github.com/users/wenyan4work/repos","events_url":"https://api.github.com/users/wenyan4work/events{/privacy}","received_events_url":"https://api.github.com/users/wenyan4work/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dmalhotra/pvfmm/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"dmalhotra","id":2135781,"avatar_url":"https://avatars.githubusercontent.com/u/2135781?v=3","gravatar_id":"","url":"https://api.github.com/users/dmalhotra","html_url":"https://github.com/dmalhotra","followers_url":"https://api.github.com/users/dmalhotra/followers","following_url":"https://api.github.com/users/dmalhotra/following{/other_user}","gists_url":"https://api.github.com/users/dmalhotra/gists{/gist_id}","starred_url":"https://api.github.com/users/dmalhotra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmalhotra/subscriptions","organizations_url":"https://api.github.com/users/dmalhotra/orgs","repos_url":"https://api.github.com/users/dmalhotra/repos","events_url":"https://api.github.com/users/dmalhotra/events{/privacy}","received_events_url":"https://api.github.com/users/dmalhotra/received_events","type":"User","site_admin":false},"assignees":[{"login":"dmalhotra","id":2135781,"avatar_url":"https://avatars.githubusercontent.com/u/2135781?v=3","gravatar_id":"","url":"https://api.github.com/users/dmalhotra","html_url":"https://github.com/dmalhotra","followers_url":"https://api.github.com/users/dmalhotra/followers","following_url":"https://api.github.com/users/dmalhotra/following{/other_user}","gists_url":"https://api.github.com/users/dmalhotra/gists{/gist_id}","starred_url":"https://api.github.com/users/dmalhotra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmalhotra/subscriptions","organizations_url":"https://api.github.com/users/dmalhotra/orgs","repos_url":"https://api.github.com/users/dmalhotra/repos","events_url":"https://api.github.com/users/dmalhotra/events{/privacy}","received_events_url":"https://api.github.com/users/dmalhotra/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2016-08-17T00:42:19Z","updated_at":"2016-08-17T15:22:39Z","closed_at":"2016-08-17T15:22:39Z","body":"Hi I am trying to compile your code and had a segmentation fault problem when compiled with cuda.\r\n\r\nSoftware:\r\n        Centos 7, mpicxx(openmpi 1.10.0 + gcc 4.8.5), cuda-7.5, nvidia-driver 367.35\r\nHardware:\r\n        Xeon E5 2643 V3 x2, 128GB mem\r\npvfmm cloned from the github repo.\r\n\r\nWhen compiled with cpu only, the examples run smoothly. When I configured it with cuda, for example:\r\n\r\n```bash\r\n /configure MPICXX=/usr/lib64/openmpi/bin/mpicxx --prefix=/home_local/wyan_local/software/PVFMM/install --with-cuda=/usr/local/cuda \r\n```\r\n\r\nThe examples throw segmentation fault. For example with 1 openmp thread:\r\n```bash\r\nexample1 -N 512\r\n```\r\ngives\r\n```bash\r\n        W-List {\r\n        }\r\n        U-List {\r\n        }\r\n        V-List {\r\n        }\r\n        D2H_Wait:LocExp {\r\nSegmentation fault (core dumped)\r\n```\r\nI looked the code a bit and it seems the loop copy dev_ptr to host_ptr at line 681 in fmm_tree.txx gives that segmentation fault\r\n```c++\r\n  Profile::Tic(\"D2H_Wait:LocExp\",this->Comm(),false,5);\r\n  if(device) if(setup_data[0+MAX_DEPTH*2].output_data!=NULL){\r\n    Real_t* dev_ptr=(Real_t*)&fmm_mat->staging_buffer[0];\r\n    Matrix<Real_t>& output_data=*setup_data[0+MAX_DEPTH*2].output_data;\r\n    size_t n=output_data.Dim(0)*output_data.Dim(1);\r\n    Real_t* host_ptr=output_data[0];\r\n    output_data.Device2HostWait();\r\n\r\n    #pragma omp parallel for\r\n    for(size_t i=0;i<n;i++){\r\n      host_ptr[i]+=dev_ptr[i];\r\n    }\r\n  }\r\n``` \r\n\r\n\r\nI have tried moving from openmpi 1.10 to 2.0(latest), and to latest mpich. Also configured pvfmm with different gcc/nvcc compiling flags from '-g -O0' to '-O2' to 'mtune=native', '-gencode arch=compute_52,code=sm_52 '. All the combinations give the same segamentation fault.\r\n\r\nCould you please help me locate the problem?\r\n\r\nThank you,\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/dmalhotra/pvfmm/issues/comments/240447095","html_url":"https://github.com/dmalhotra/pvfmm/issues/3#issuecomment-240447095","issue_url":"https://api.github.com/repos/dmalhotra/pvfmm/issues/3","id":240447095,"user":{"login":"dmalhotra","id":2135781,"avatar_url":"https://avatars.githubusercontent.com/u/2135781?v=3","gravatar_id":"","url":"https://api.github.com/users/dmalhotra","html_url":"https://github.com/dmalhotra","followers_url":"https://api.github.com/users/dmalhotra/followers","following_url":"https://api.github.com/users/dmalhotra/following{/other_user}","gists_url":"https://api.github.com/users/dmalhotra/gists{/gist_id}","starred_url":"https://api.github.com/users/dmalhotra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmalhotra/subscriptions","organizations_url":"https://api.github.com/users/dmalhotra/orgs","repos_url":"https://api.github.com/users/dmalhotra/repos","events_url":"https://api.github.com/users/dmalhotra/events{/privacy}","received_events_url":"https://api.github.com/users/dmalhotra/received_events","type":"User","site_admin":false},"created_at":"2016-08-17T15:22:39Z","updated_at":"2016-08-17T15:22:39Z","body":"The latest commit has fixed this bug."}}
{"actor":{"display_login":"dmalhotra"}}