.. _error-code-enki007:

.. meta::
   :description: AWS Neuron SDK Graph Compiler error code documentation for error ENKI007.

NCC_ENKI007
===========

**Error message**: NKI kernel cache directory <dir> is not private to the current user: it must be a directory owned by the current user and not writable by group or others.

This error occurs when the compiler resolves an NKI (Neuron Kernel Interface) kernel from the default per-user NKI compile cache, ``/var/tmp/nki-intermediate-cache-uid<uid>``, and that directory can be modified by other users.

Why the compiler checks the directory
-------------------------------------

When ``NKI_COMPILE_CACHE_URL`` is not set, NKI and ``neuronx-cc`` use a per-user cache directory under ``/var/tmp``. Its name is predictable, so the compiler only loads kernels from it when it is a real directory (not a symbolic link), owned by the user running the compiler, and not writable by group or others. NKI creates the directory with mode ``0700`` and applies the same check.

Common causes
-------------

- The directory was created by another user before you first compiled.
- The directory permissions were changed, for example with ``chmod 777``.
- The default path is a symbolic link.

Resolution
----------

Choose one of the following:

1. **Delete the directory.** NKI recreates it with the right owner and permissions the next time you trace the model. Retrace the model before compiling again.
2. **Set** ``NKI_COMPILE_CACHE_URL`` to the directory NKI used when compiling the kernel, for example a directory only you or your group can write to. An explicit ``NKI_COMPILE_CACHE_URL`` is used as given, and you are responsible for managing its permissions.
