HIP icon indicating copy to clipboard operation
HIP copied to clipboard

hipMemcpy problem: Data_d cannot be accessed on the device side

Open xianwujie opened this issue 2 years ago • 2 comments

hello,everyone. I would like to ask a question about hipMemcpy.I hope someone can help me with this. The question are as follows: I want to copy a table to the device side and get the key of the table on the device side.

error: Memory access fault by GPU node-8 (Agent handle: 0x9bc790) on address 0xb05000. Reason: Page not present or supervisor privilege.

code as below: dict struct as below: typedef struct dictEntry { void *key; void *val; struct dictEntry *next; } dictEntry;

typedef struct dict { dictEntry **table; dictType *type; unsigned long size; unsigned long sizemask; unsigned long used; void *privdata; } dict;

dictEntry entry; hipMalloc((dictEntry*)&entry, sizeof(ht->table[i])); hipMemcpy(entry, ht->table[i], sizeof(ht->table[i]), hipMemcpyHostToDevice); hipLaunchKernelGGL(test,1,5,0,0, key, entry);

global void test(char *key1, dictEntry entry) { while(entry){ int i =0; auto key2 = (char)entry->key; while(key1[i] == key2[i] && i < 24){ // memory access fault i++; } .... }

on host side, I can get the vallue of entry->key[i] ,but on test kernel, I can't access entry->key[i]. If you have a solution or a good suggestion, please feel free to communicate. I look forward to hearing from you!

xianwujie avatar Sep 22 '22 09:09 xianwujie

A complete example might be helpful.

zjin-lcf avatar Sep 23 '22 01:09 zjin-lcf

@xianwujie Hi, were you able to resolve this issue on the latest HIP? If so can we close this ticket?

abhimeda avatar Feb 07 '24 18:02 abhimeda