NvRmMemInitNvmap failed with Permission denied

Python 3.8.10 (default, May 26 2023, 14:05:08) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.is_available()
NvRmMemInitNvmap failed with Permission denied
549: Memory Manager Not supported



****NvRmMemInit failed**** error type: 196626


*** NvRmMemInit failed NvRmMemConstructor
/usr/local/lib/python3.8/dist-packages/torch/cuda/__init__.py:115: UserWarning: CUDA initialization: Unexpected error from cudaGetDeviceCount(). Did you run some cuda functions before calling NumCudaDevices() that might have already set an error? Error 801: operation not supported (Triggered internally at /opt/pytorch/pytorch/c10/cuda/CUDAFunctions.cpp:108.)
  return torch._C._cuda_getDeviceCount() > 0
False

docker: nvcr.io/nvidia/l4t-tensorrt:r8.5.2.2-devel
PyTorch installation method: Installing PyTorch for Jetson Platform - NVIDIA Docs

start docker command:

docker run -it --rm --runtime=nvidia --gpus all nvcr.io/nvidia/l4t-tensorrt:r8.5.2.2-devel

If it is the root user, it can get the correct result.

I created a user named “walker” and it cannot be used under that user, resulting in the above error.

The command to create a user is as follows:

USER=walker
useradd --create-home --user-group --groups sudo --shell /bin/bash "$USER"

# Add sudo permission for $USER
mkdir -p /etc/sudoers.d
printf '%s ALL=(ALL:ALL) NOPASSWD: ALL\n' "$USER" | \
  tee /etc/sudoers.d/nopasswd

chmod 440 /etc/sudoers.d/nopasswd
mkdir -p /var/lib/sudo/lectured/
touch /var/lib/sudo/lectured/"$USER"
chmod 600 /var/lib/sudo/lectured/"$USER"

1 Like

May I know which platform and SW you’re using?

env | grep JET
JETSON_CUDA_ARCH_BIN=8.7
JETSON_MODULE=NVIDIA Jetson AGX Orin
JETSON_L4T=35.2.1
JETSON_CODENAME=Concord
JETSON_MODEL=Jetson AGX Orin
JETSON_SERIAL_NUMBER=1421322011417
JETSON_SOC=tegra23x
JETSON_P_NUMBER=p3701-0000
JETSON_JETPACK=5.1

Hi,

Please check if you are facing the same issue of the below topic:

Thanks.

I have tried, but it didn’t work.

Hi,

Do you use the below command to launch the container?

docker run -it --rm --runtime=nvidia --gpus all nvcr.io/nvidia/l4t-tensorrt:r8.5.2.2-devel

The --gpu all is a dGPU flag. Could you remove it and try it again?

Thanks.

I tried.
Can be used by the root user, but not after creating a new user

Hi,

Thanks.
We will give it a check and get back to you later.

Okay, thanks.

Hi,

Thanks for your patience.

Please add below link to enable the authority:

usermod -aG sudo,video,i2c "$USER"

Thanks.

1 Like

Okay, thanks.

I’ll try and get back to you later.

Thanks, solved!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.