Rapidsai JupyterLab cupy CUDARuntimeError: cudaErrorNoDevice: no CUDA-capable device is detected

Hello! I’m working on Ubuntu 23.04 and start RapidsAI in docker via this command:

docker run --gpus all --pull always --rm -it
–shm-size=1g --ulimit memlock=-1 --ulimit stack=67108864
-p 8888:8888 -p 8787:8787 -p 8786:8786
nvcr.io/nvidia/rapidsai/notebooks:24.10-cuda12.0-py3.10

I work with networkx and it generally seems to work on GPU (see nvidi-smi output below), however per nvtop I rarely hit the mark of 50%.

Then I try to execute this code from cudf demo notebooks:
import cupy as cp
import pandas as pd
import cudf
import dask_cudf
cp.random.seed(12)

After this, I get this error from cupy:
File /opt/conda/lib/python3.10/site-packages/cupy/random/_generator.py:1280, in seed(seed)
1266 def seed(seed=None):
1267 “”“Resets the state of the random number generator with a seed.
1268
1269 This function resets the state of the global random number generator for
(…)
1278
1279 “””
→ 1280 get_random_state().seed(seed)

File /opt/conda/lib/python3.10/site-packages/cupy/random/_generator.py:1306, in get_random_state()
1294 def get_random_state():
1295 “”“Gets the state of the random number generator for the current device.
1296
1297 If the state for the current device is not created yet, this function
(…)
1304
1305 “””
→ 1306 dev = cuda.Device()
1307 rs = _random_states.get(dev.id, None)
1308 if rs is None:

File cupy/cuda/device.pyx:148, in cupy.cuda.device.Device.init()

File cupy_backends/cuda/api/runtime.pyx:202, in cupy_backends.cuda.api.runtime.getDevice()

File cupy_backends/cuda/api/runtime.pyx:146, in cupy_backends.cuda.api.runtime.check_status()

CUDARuntimeError: cudaErrorNoDevice: no CUDA-capable device is detected

output of nvidia-smi:

I would be glad to provide further information.

Thank you in advance for helping me.