You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected #666
Now that I finally converted all of my videos using Tdarr I like how I can leave it running and when new videos are downloaded it compresses them. And this works... But then it dies with "CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected". Now I've configured my Docker container to run Tdarr using Nvidia and I have properly configured it so that that works. But then it breaks with that error. The solution is simply to restart the Docker container and then re-queue the videos but why does it break in the first place?
Another data point. When transcode fails in the docker container I can replicate the ffmpeg command on the desktop (IOW outside of the docker container) and it works fine.
Hmm seems like a bug between FFmpeg/Docker/Hardware, perhaps an FFmpeg update will fix the issue. The dev container has an FFmpeg update, looking to get it out soon.
I can try out the new version when it becomes available. I was suspecting it may be the Nvidia for Cocker containers (I have a foggy memory of installing that to get GPU transcoding to work in a Docker container) and something there broke down causing the CUDA_ERROR_NO_DEVICE. Lately, I'm seeing it just about transcodes a video or two and suddenly there are no devices left to GPU transcode. Restarting the Docker container always fixes the problem but it's essentially babysitting Tdarr, which shouldn't have to be the case.
I had cron'ed a restart of the Docker container at midnight in an attempt to mitigate this issue but it remains.
It might be nice if Tdarr allowed access to their database so I could interrogate the state and restart the Docker container if need be but then again if the bug is fixed it would be unnecessary.
Out of curiosity, @Sc0th, what's your environment? Where are you running the Docker container? What OS/machine? And where's your server?
A result higher than 0 indicates it's got stuck, I did look at using this to 'self heal' by restating the docker on trigger, however the jobs do not appear to requeue automatically so that did not quite go to plan.
I wait with greatful anticipation of the next release with hope of a fix!
Yeah, I think that it will end up being some interaction between Tdarr and the Nvidia runtime for the Docker container that causes Nvidia to lose track of available devices thus reporting NO_CUDA_DEVICE.
I'm running on my Thelio desktop running Ubuntu 22.04. I have the following:
Earth:apt list| grep nvidia-container
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
libnvidia-container-dev/bionic 1.10.0-1 amd64
libnvidia-container-tools/bionic,now 1.10.0-1 amd64 [installed,automatic]
libnvidia-container1-dbg/bionic 1.10.0-1 amd64
libnvidia-container1/bionic,now 1.10.0-1 amd64 [installed,automatic]
nvidia-container-runtime/bionic 3.10.0-1 all
nvidia-container-toolkit/bionic,now 1.10.0-1 amd64 [installed]
Earth:
Still have this issue however today I think I captured a log of Tdarr working on a video when the CUDA_ERROR_NO_DEVICE happened right in the middle. Maybe this log will help in debugging this bug
. to7uvYRwN-log.txt
.
I am trying downgrading nvidia-docker2 back to 2.10.0-1 from 2.11.0-1 and seeing if that makes any difference as a workaround. If not I may try 2.9.1-1.
Downgrading to the nvidia-docker2 version 2.9.1-1 seems to be a workaround to this issue, at least in the day of testing. If it STOPS working I will let you know.
Annoying to have my updates reporting a heald-back package, but better than Tdarr-node breaking every hour or two.
Hmmm... Still having found how to get to the GRUB menu on my System76 Thelio but I figured I'd simply try to update-grub with the change put into /etc/defaults/grub. I rebooted and went through a few transcodes that queued up without a problem. That was yesterday. Today a new download came in and it transcoded with success! First time I had my Tdarr node survive and overnight! Look like this may be the fix.
Of course, I wonder if Nvidia will fix this and use the newer cgroup hierarchy and how I might be notified so I can remove this setting and start using the newer setting.
I'm not sure if this is a Nvidia or a Tdarr issue. I have two other Docker containers (plex and foldingathome) that both use the same GPU as my Tdarr container, and they never had any issues before or after I added the kernel parameter. Only Tdarr would "lose" the GPU from time to time.
Inntereing observation! I didn't think about it but yes, my Plex also runs in a Docker container and uses the CPUs for hardware transcoding. This sounds like good info for the developer.
Well for me it's working. What OS/distro are you on? If you didn't type in the right stuff, didn't run update-grub or didn't reboot the Linux kernel will not warn you that you got it wrong.
I'm on Ubuntu 22.04 and I have the following in /etc/defautls/grub
I've run update-grub and rebooted. My Tdarr node has stayed up for about 2 days, much longer than ever before without complaining about this error, and has been transcoding videos. In fact, it just transcoded 4 videos.
The grub parameter change seems to be working for me. I am on Ubuntu 22.04.1 LTS.
This is an OK workaround, but hopefully this can get fixed so that users are not required to change how the kernel is operating just to make this work.
+1 for this being a workaround, but not an actual fix. However, since we have at least 3 people here who this seemed to resolve their issue, I'm sure there are others that have had similar issues and didn't find this solution.
@HaveAGitGat, could we possibly document this workaround somewhere in the README/on docs.tdarr.io until a better or more permanent solution is found?
I'd been having the same issues - tdarr would work fine for about a day, and then I'd have to restart the containers in order for transcodes to ocurr. When i finally chased it down, I was getting the same error as OP and found a solution on the Arch wiki - though i am running Ubuntu 22.04 and docker 20.10.22. Seems to be an nvidia / docker issue. see Howard O-Neil's reply here. About half way through his answer he gives an alternative method where he details two ways to make this work that don't require adding kernel parameters:
(1) set the container to privileged. After doing this, i never got the "CUDA_ERROR_NO_DEVICE" error and transcoding continues to work just fine without requiring container restarts.
(2) Alternatively, if you don't wish to run the container with elevated privileges, you can change the way you do gpu passthrough to use nvidia-container-runtime. nvidia-container-toolkit on ubuntu now contains nvidia-container-runtime, so nothing to install and /etc/docker/daemon.json exists and doesn't require changes. You just need to change the docker run: change --gpus=all to --runtime nvidia and then explicitly add all the /dev/nvidia devices:
Similarly, you can change the compose file to effect these same changes / additions.
Running the containers this way has also resulted in no "CUDA_ERROR_NO_DEVICE" errors and transcoding works without requiring daily-ish restarts.
EDIT - in this 2nd alternative, i found i had to create an override to my docker.service systemd unit which basically waits for the existence of the above nvidia devices to exists.
systemctl edit docker add [Unit] and then add a line for each device: ConditionPathExists=/dev/nvidia0 etc for each of the other devices, but whereas /dev/nvidia-caps is a directory, i just listed the whole path to it's 2 files - e.g., ConditionPathExists=/dev/nvidia-caps/nvidia-cap1
OR you could add [Service] and add an ExecStartPre=/usr/bin/sleep 30 to delay start of docker giving it long enough for the device files to exist - 30 seconds is probably overkill...
EDIT 2 - 2nd method did fail after a few days, so the only way i could make it work for container to stay up was to make it privileged.
Docker GPU detection can be especially tricky - nvidia-smi working on the host doesn't guarantee container access.
Key Docker GPU troubleshooting steps:
Verify nvidia-container-runtime is installed and configured
Check Docker daemon config includes nvidia runtime
Ensure container has proper --runtime=nvidia or --gpus all flags
Validate CUDA libraries are accessible inside container
I built env-doctor specifically to help diagnose these Docker+GPU issues. It checks:
Docker runtime configuration
GPU forwarding to containers
CUDA library paths and permissions
Works both inside/outside Docker to pinpoint where detection fails
Full disclosure: I'm the author. Sharing because Docker GPU setup has unique challenges vs host GPU detection. Hope it helps others troubleshoot these issues!
Activity
adefaria commentedon Aug 2, 2022
Another data point. When transcode fails in the docker container I can replicate the ffmpeg command on the desktop (IOW outside of the docker container) and it works fine.
Why does it break in the docker container?
HaveAGitGat commentedon Aug 8, 2022
Hmm seems like a bug between FFmpeg/Docker/Hardware, perhaps an FFmpeg update will fix the issue. The dev container has an FFmpeg update, looking to get it out soon.
adefaria commentedon Aug 9, 2022
I can try out the new version when it becomes available. I was suspecting it may be the Nvidia for Cocker containers (I have a foggy memory of installing that to get GPU transcoding to work in a Docker container) and something there broke down causing the CUDA_ERROR_NO_DEVICE. Lately, I'm seeing it just about transcodes a video or two and suddenly there are no devices left to GPU transcode. Restarting the Docker container always fixes the problem but it's essentially babysitting Tdarr, which shouldn't have to be the case.
Sc0th commentedon Aug 18, 2022
FWIW I am seeing this exact behavior, happy to supply logs/test if it helps at all, a restart of the docker fixes it every time.
adefaria commentedon Aug 18, 2022
I had cron'ed a restart of the Docker container at midnight in an attempt to mitigate this issue but it remains.
It might be nice if Tdarr allowed access to their database so I could interrogate the state and restart the Docker container if need be but then again if the bug is fixed it would be unnecessary.
Out of curiosity, @Sc0th, what's your environment? Where are you running the Docker container? What OS/machine? And where's your server?
Sc0th commentedon Aug 19, 2022
Apologies, I could have made that post slightly more useful!
I also tried the automated reboot, also to no avail. I am running the docker using podman on a VM running on Proxmox with PCI pass-through.
Some (maybe) useful detail:
I am using the following line monitored by Zabbix to alert me when it gets stuck:
A result higher than 0 indicates it's got stuck, I did look at using this to 'self heal' by restating the docker on trigger, however the jobs do not appear to requeue automatically so that did not quite go to plan.
I wait with greatful anticipation of the next release with hope of a fix!
adefaria commentedon Aug 19, 2022
Yeah, I think that it will end up being some interaction between Tdarr and the Nvidia runtime for the Docker container that causes Nvidia to lose track of available devices thus reporting NO_CUDA_DEVICE.
I'm running on my Thelio desktop running Ubuntu 22.04. I have the following:
adefaria commentedon Aug 23, 2022
Still have this issue however today I think I captured a log of Tdarr working on a video when the CUDA_ERROR_NO_DEVICE happened right in the middle. Maybe this log will help in debugging this bug
.
to7uvYRwN-log.txt
.
Lebo77 commentedon Aug 27, 2022
I am trying downgrading nvidia-docker2 back to 2.10.0-1 from 2.11.0-1 and seeing if that makes any difference as a workaround. If not I may try 2.9.1-1.
I am having this same issue on Ubuntu 22.04 LTS.
Lebo77 commentedon Aug 28, 2022
Downgrading to the nvidia-docker2 version 2.9.1-1 seems to be a workaround to this issue, at least in the day of testing. If it STOPS working I will let you know.
Annoying to have my updates reporting a heald-back package, but better than Tdarr-node breaking every hour or two.
HaveAGitGat commentedon Aug 28, 2022
Ok thanks for the update 👍
adefaria commentedon Aug 29, 2022
Thanks. Downgraded to 2.9.1-1. Will report what happens.
Sc0th commentedon Aug 29, 2022
You have seen this 'With the release of Docker 19.03, usage of nvidia-docker2 packages is deprecated since NVIDIA GPUs are now natively supported as devices in the Docker runtime.' here: - https://docs.nvidia.com/ai-enterprise/deployment-guide/dg-docker.html ?
I am using podman, with:
And am seeing the same issue.
adefaria commentedon Aug 29, 2022
So are you saying I can just remove nvidia-docker2 and restart the docker container and it'll all work?
34 remaining items
Lebo77 commentedon Oct 6, 2022
Well, I just added the recommended parameter to grub and rebooted. We will see if that fixes it.
adefaria commentedon Oct 6, 2022
Hmmm...
Stillhaving found how to get to the GRUB menu on my System76 Thelio but I figured I'd simply try to update-grub with the change put into /etc/defaults/grub. I rebooted and went through a few transcodes that queued up without a problem. That was yesterday. Today a new download came in and it transcoded with success! First time I had my Tdarr node survive and overnight! Look like this may be the fix.Of course, I wonder if Nvidia will fix this and use the newer cgroup hierarchy and how I might be notified so I can remove this setting and start using the newer setting.
tedcook94 commentedon Oct 6, 2022
I'm not sure if this is a Nvidia or a Tdarr issue. I have two other Docker containers (
plexandfoldingathome) that both use the same GPU as my Tdarr container, and they never had any issues before or after I added the kernel parameter. Only Tdarr would "lose" the GPU from time to time.I'm no expert on cgroups, but it looks like there were some deprecated features when going from v1 to v2. Maybe Tdarr is either directly or indirectly using some deprecated v1 feature?
adefaria commentedon Oct 6, 2022
Inntereing observation! I didn't think about it but yes, my Plex also runs in a Docker container and uses the CPUs for hardware transcoding. This sounds like good info for the developer.
Sc0th commentedon Oct 7, 2022
FWIW this completely broke it for me, so it may not be the full fix.
adefaria commentedon Oct 7, 2022
Well for me it's working. What OS/distro are you on? If you didn't type in the right stuff, didn't run update-grub or didn't reboot the Linux kernel will not warn you that you got it wrong.
I'm on Ubuntu 22.04 and I have the following in
/etc/defautls/grubI've run
update-gruband rebooted. My Tdarr node has stayed up for about 2 days, much longer than ever before without complaining about this error, and has been transcoding videos. In fact, it just transcoded 4 videos.Lebo77 commentedon Oct 12, 2022
The grub parameter change seems to be working for me. I am on Ubuntu 22.04.1 LTS.
This is an OK workaround, but hopefully this can get fixed so that users are not required to change how the kernel is operating just to make this work.
adefaria commentedon Oct 12, 2022
Agreed. Not sure if I should close this as fixed with this workaround or leave it open to be fixed more properly.
tedcook94 commentedon Oct 12, 2022
+1 for this being a workaround, but not an actual fix. However, since we have at least 3 people here who this seemed to resolve their issue, I'm sure there are others that have had similar issues and didn't find this solution.
@HaveAGitGat, could we possibly document this workaround somewhere in the README/on docs.tdarr.io until a better or more permanent solution is found?
tomgehrke commentedon Oct 12, 2022
Can also confirm the workaround worked for me.
So another vote for the "not fixed, but here's a workaround" option.
yajrendrag commentedon Dec 31, 2022
I'd been having the same issues - tdarr would work fine for about a day, and then I'd have to restart the containers in order for transcodes to ocurr. When i finally chased it down, I was getting the same error as OP and found a solution on the Arch wiki - though i am running Ubuntu 22.04 and docker 20.10.22. Seems to be an nvidia / docker issue. see Howard O-Neil's reply here. About half way through his answer he gives an alternative method where he details two ways to make this work that don't require adding kernel parameters:
(1) set the container to privileged. After doing this, i never got the "CUDA_ERROR_NO_DEVICE" error and transcoding continues to work just fine without requiring container restarts.
(2) Alternatively, if you don't wish to run the container with elevated privileges, you can change the way you do gpu passthrough to use nvidia-container-runtime. nvidia-container-toolkit on ubuntu now contains nvidia-container-runtime, so nothing to install and
/etc/docker/daemon.jsonexists and doesn't require changes. You just need to change the docker run: change--gpus=allto--runtime nvidiaand then explicitly add all the /dev/nvidia devices:Similarly, you can change the compose file to effect these same changes / additions.
Running the containers this way has also resulted in no "CUDA_ERROR_NO_DEVICE" errors and transcoding works without requiring daily-ish restarts.
EDIT - in this 2nd alternative, i found i had to create an override to my docker.service systemd unit which basically waits for the existence of the above nvidia devices to exists.
systemctl edit dockeradd[Unit]and then add a line for each device:ConditionPathExists=/dev/nvidia0etc for each of the other devices, but whereas /dev/nvidia-caps is a directory, i just listed the whole path to it's 2 files - e.g.,ConditionPathExists=/dev/nvidia-caps/nvidia-cap1OR you could add
[Service]and add anExecStartPre=/usr/bin/sleep 30to delay start of docker giving it long enough for the device files to exist - 30 seconds is probably overkill...EDIT 2 - 2nd method did fail after a few days, so the only way i could make it work for container to stay up was to make it privileged.
HaveAGitGat commentedon Feb 7, 2023
@tedcook94 added to the troubleshooting section:
https://docs.tdarr.io/docs/troubleshooting/#cuda_error_no_device-no-cuda-capable-device
HaveAGitGat commentedon Mar 17, 2023
Issue is open on Jellyfin here so will let solution be handled there ty: jellyfin/jellyfin#9287
tharun571 commentedon Jan 20, 2026
Docker GPU detection can be especially tricky - nvidia-smi working on the host doesn't guarantee container access.
Key Docker GPU troubleshooting steps:
nvidia-container-runtimeis installed and configured--runtime=nvidiaor--gpus allflagsI built env-doctor specifically to help diagnose these Docker+GPU issues. It checks:
Full disclosure: I'm the author. Sharing because Docker GPU setup has unique challenges vs host GPU detection. Hope it helps others troubleshoot these issues!