You are not logged in.
Hi,
I'm trying to run a CUDA application (easy-diffusion, for the records) in a systemd unit. The unit:
[Unit]
Description=Easy Diffusion Service
[Service]
Type=simple
ExecStart=/opt/easy-diffusion/start.sh
WorkingDirectory=/opt/easy-diffusion/
Environment=NVIDIA_VISIBLE_DEVICES=all
[Install]
WantedBy=default.targetThe outcome:
18:21:23.489 ERROR MainThread CUDA unknown error - this may be due to an incorrectly set up environment, e.g. changing env variable CUDA_VISIBLE_DEVICES after program start. Setting the available devices to be zero.
18:21:23.497 WARNING MainThread WARNING: Could not find a compatible GPU. Using the CPU, but this will be very slow!It works running locally, so I assume either something missing in the environment or systemd running some form of isolation. I found some problems from users with docker, which is where I got the NVIDIA_VISIBLE_DEVICES from. I've created the unit as a --user unit.
Any idea?
Offline
You'll probably want to enable the nvidia-persistenced.service for these kind of usecases, is that the case? It could also shoot too early if your nvidia modules aren't yet loaded/in which case you might want to enable early module loading: https://wiki.archlinux.org/title/NVIDIA#Early_loading
Last edited by V1del (2023-04-12 16:46:25)
Offline
For the latter: no, I'm starting it (the unit) from a running desktop, so everything is up and dandy. But thanks for the hint, it might be problematic to start it automatically (I might not want that, though - not sure yet).
Offline