Forum Discussion

ndevenish's avatar
ndevenish
Icon for New Contributor rankNew Contributor
3 years ago
Solved

Configuring for non-root-user access without "Error opening AFC: insufficient privileges"

We have a new machine with two PAC D5005 cards, which we intend to use both for compilation and running. Because the oneAPI toolkit requires Red Hat 8, and the PAC drivers only support Red Hat 7, I have installed the toolkit according to the instructions here: https://www.intel.com/content/www/us/en/developer/articles/technical/oneapi-dpcpp-fpga-designs-on-rhel-7.html.

When running as root, this works fine - compiled programs can enumerate the cards,

aocl list-devices
lists devices.

When running as a non-root normal user, running

aocl list-devices
, or many other programs, prints "Error opening AFC: insufficient privileges". A bare bones enumerator:

int main(void) {
// Loop through the available platforms
for (auto const& platform : platform::get_platforms()) {
}
}

crashes with:

% ./enumerate
Error opening AFC: insufficient privileges
terminate called after throwing an instance of 'cl::sycl::runtime_error'
what(): Native API failed. Native API returns: -2 (CL_DEVICE_NOT_AVAILABLE) -2 (CL_DEVICE_NOT_AVAILABLE)
zsh: abort ./enumerate

however, running it under

sudo
works fine.

I have used devcloud and other systems intel has lent, and this has worked fine as a normal non-root user account. How can I configure oneAPI or the FPGA drivers so that other users can use the devices?

  • Hi @BoonBengT_Altera ,

    This didn't work directly - however it did lead me to discover that I needed to change the permissions on /dev/intel-fpga-fme.0 and /dev/intel-fpga-port.0 to 0666 (chmod a+rw). This now works from other users (and I could change the group details if I needed finer control).

    Thank you.

    Nick

3 Replies