-
Notifications
You must be signed in to change notification settings - Fork 656
Description
Describe the question.
CUDA driver API error CUDA_ERROR_NO_DEVICE (100): no CUDA-capable device is detected Current pipeline object is no longer valid.
I encounter an issue while trying to use DALI to read video frames, and I would greatly appreciate your help in solving it. The specific error I received is:
CUDA driver API error: CUDA_ERROR_NO_DEVICE (100): no CUDA-capable device is detected.
However, my GPU (NVIDIA A800-SXM4-80GB) works fine when running the image loading example provided by DALI, which suggests that the CUDA environment itself is functioning properly. I'm unsure why the device cannot be detected only when processing video data.
Here is my current setup:
- OS: Linux x86_64 GNU/Linux
- CUDA version: 11.7
- DALI version: nvidia-dali-cuda110 == 1.48.0
- GPU: NVIDIA A800-SXM4-80GB
Please let me know if you need more logs or code snippets to reproduce the issue. Thank you very much for your time and support! Best regards!
nvidia-smi
Sun Jun 8 02:48:13 2025
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.104.12 Driver Version: 535.104.12 CUDA Version: 12.2 |
|-----------------------------------------+----------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========+====+====|
| 0 NVIDIA A800-SXM4-80GB On | 00000000:D0:00.0 Off | 0 |
| N/A 36C P0 65W / 500W | 2MiB / 81920MiB | 0% Default |
| | | Disabled |
+-----------------------------------------+----------------------+----------------------+
| 1 NVIDIA A800-SXM4-80GB On | 00000000:D4:00.0 Off | 0 |
| N/A 36C P0 63W / 500W | 2MiB / 81920MiB | 0% Default |
| | | Disabled |
+-----------------------------------------+----------------------+----------------------+
+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|===================|
| No running processes found |
+---------------------------------------------------------------------------------------+
install
for CUDA 11.0:
'pip install --extra-index-url https://pypi.nvidia.com --upgrade nvidia-dali-cuda110'
Error
DALI版本: 1.48.0 [/opt/dali/dali/operators/video/legacy/reader/video_loader.h:179] file_list_include_preceding_frame uses the default value False. In future releases, the default value will be changed to True. /opt/dali/dali/operators/video/legacy/reader/nvdecoder/nvdecoder.cc:197: Unable to decode file trailer.mp4 Traceback (most recent call last): File "test.py", line 113, in sequences = pipe.run() File "/root/.local/lib/python3.8/site-packages/nvidia/dali/pipeline.py", line 1419, in run return self.outputs(cuda_stream) File "/root/.local/lib/python3.8/site-packages/nvidia/dali/pipeline.py", line 1230, in outputs return self._outputs(cuda_stream) File "/root/.local/lib/python3.8/site-packages/nvidia/dali/pipeline.py", line 1337, in _outputs return self._pipe.Outputs(types._raw_cuda_stream_ptr(cuda_stream)) RuntimeError: Critical error in pipeline: Error in GPU operator nvidia.dali.fn.readers.video, which was used in the pipeline definition with the following traceback: File "test.py", line 98, in video_pipeline return fn.readers.video( encountered: CUDA driver API error CUDA_ERROR_NO_DEVICE (100): no CUDA-capable device is detected Current pipeline object is no longer valid.
Code:
`# 测试读取图片:成功。
from nvidia.dali.pipeline import Pipeline
from nvidia.dali import pipeline_def
import nvidia.dali.fn as fn
import nvidia.dali.types as types
image_dir = "./images/"
max_batch_size = 8
@pipeline_def
def random_rotated_gpu_pipeline():
jpegs, labels = fn.readers.file(
file_root=image_dir, random_shuffle=True, initial_fill=21,file_filters=[".jpg", ".png"]
)
images = fn.decoders.image(jpegs, device="cpu")
angle = fn.random.uniform(range=(-10.0, 10.0))
rotated_images = fn.rotate(images.gpu(), angle=angle, fill_value=0)
return rotated_images, labels
pipe = random_rotated_gpu_pipeline(
batch_size=max_batch_size, num_threads=1, device_id=0, seed=1234
)
pipe.build()
pipe_out = pipe.run()
print(pipe_out)
'
'# 测试读取视频
from nvidia.dali import pipeline_def
import nvidia.dali.fn as fn
import nvidia.dali.types as types
import torch
assert torch.cuda.is_available()
import nvidia.dali as dali
print(f"DALI版本: {dali.version}") # Expected output: 1.48.0
@pipeline_def(batch_size=1, num_threads=2, device_id=0)
def video_pipeline():
return fn.readers.video(
device="gpu",
filenames=["trailer.mp4"],
sequence_length=8,
skip_vfr_check=True,
dtype=types.UINT8,
# image_type=types.RGB,
# enable_frame_num=False
)
pipe = video_pipeline()
pipe.build()
for i in range(3):
sequences = pipe.run()
print(f"Batch {i} 抽帧结果(GPU张量): {sequences[0].as_tensor().shape}")`
Check for duplicates
- I have searched the open bugs/issues and have found no duplicates for this bug report