On 1/20/20 12:07 PM, Jakub Jelinek wrote:
I'd say easiest would be to do that in the gcn specific mkoffload. But there needs to be a way for the user to specify that he wants only a particular variant and not all of them (perhaps look for -march= in the offload options?)?

I think that relates to the general issues with telling libgomp what offload-target has been used.

(Might be solved differently, but it is at least related. Thinking of complications would be: main program and a linked library uses different offload targets [e.g. nvptx vs. host or gcn vs. host+nvptx] or the library is not linked but dlopen'ed. — Likewise for the issue of this thread: library and host program might use different gfx… for the march.)

 * * *

Regarding the -foffload=<target(s)>: Assume a GCC installation which has plugins for a certain device. If one now uses a simple hello-world program with OpenMP target or OpenACC then:

With "-fopenacc -foffload=disable" – and a device available – it fails at run time with "libgomp: target function wasn't mapped". (Work around: set env var ACC_DEVICE_TYPE to "host".)

With "-fopenmp -foffload=disable" or "-fopenacc -foffload=disable" – and no device available, it fails with: libgomp: while loading libgomp-plugin-nvptx.so.1: libcuda.so.1: cannot open shared object file: No such file or directory

And – at least with HSA/GCN: If there is a permission issue for /dev/…, it will fail when the devices are enumerated (I mean: gomp_init_targets_once → *get_num_devices) – even if -foffload=disable is used.

See also: PR 81886 and, related, PR 67300.

Cheers,

Tobias

Reply via email to