I'm deploying on livekit cloud. I got this error w...
# ask-ai
c
I'm deploying on livekit cloud. I got this error with my agent in prod
Copy code
Failed to load CUDA modules. maybe the NVIDIA driver is not installed?
Failed to initialize CUDA context.
Failed to open VAAPI display.
Failed to open VA display. Maybe the AMD video driver or libva-dev/libdrm-dev is not installed?
Failed to load CUDA modules. maybe the NVIDIA driver is not installed?
Failed to initialize CUDA context.
t
Thanks for reaching out, Guillaume. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
It looks like the errors you're seeing are related to GPU-accelerated video encoding. Don’t worry, I’m here to help you work through them! Here are some friendly steps you can try: • CUDA Errors: First, please check that your NVIDIA driver is installed and up-to-date. You can verify this by running
nvidia-smi
. If you're using Docker, make sure to use the
nvidia-docker
runtime and properly mount your GPU devices. • VAAPI Errors: You might need to install some necessary libraries. You can do this by running
sudo apt install libva2 libva-drm2 libva-dev intel-media-driver
. After that, try running
vainfo
to see which profiles are supported. • Also, please double-check that your deployment is using GPU-enabled instances and that all drivers and libraries are correctly set up. If you’d like, feel free to share more details about your GPU model, driver version, and whether your setup is self-hosted or on LiveKit Cloud. I’m here to help you get this sorted out! Sources: webrtc-sys/build.rs | Yeah, but can it run DOOM?
c
I'm seeing ERRORlivekit.agentsunhandled exception while running the job task How can I get more details about this error? There's no stack trace
t
I'd love to help you get more details about the error you're encountering! Here are some friendly steps you can try to enable detailed logging and include stack traces: • Try setting the log level to
DEBUG
or
ERROR
in your logging configuration. Using the
setup_logging
function can really help make sure tracebacks are captured properly. • During development, it’s a good idea to disable the custom
sys.excepthook
in subprocesses so stack traces aren’t hidden. You can do this by overriding it with
sys.excepthook = sys.__excepthook__
. • Applying the
@log_exceptions
decorator on your entrypoint functions is a great way to keep error logging consistent and include those helpful tracebacks. • Enabling Sentry by setting the
SENTRY_DSN
secret can capture full stack traces and context in one centralized place, making troubleshooting smoother. • Running your agent with CLI flags like
--log-level DEBUG
and
--devmode
can also improve observability and give you more insight. If you’d like, just let me know a bit about your current logging setup or runtime environment, and I’d be happy to guide you through the next steps! Sources: livekit-agents/livekit/agents/tts/fallback_adapter.py | Log collection | LiveKit Docs | Logs, metrics, and telemetry | LiveKit Docs
c
can you explain in more details how to enable sentry
t
I'd be happy to help you enable Sentry for your LiveKit agents! Here’s a simple step-by-step guide to get you started: 1. Obtain the SENTRY_DSN: First, head over to your Sentry dashboard and find your project’s DSN under Project Settings > Client Keys (DSN). 2. Add the Secret: Next, add the
SENTRY_DSN
to your LiveKit environment. You can do this in two ways: ◦ Via CLI: Run
lk agent update-secrets --secrets SENTRY_DSN=<your-dsn>
. ◦ Via Dashboard: Or, go to the LiveKit Cloud dashboard, find your agent configuration, and add
SENTRY_DSN
in the secrets section. 1. Verify the Integration: After deployment, check your Sentry dashboard to see if logs are coming through. You can also run
lk agent logs
via the LiveKit CLI to spot any issues with secret injection or connectivity. If you run into any questions or need a hand with any part of this, just let me know—I’m here to help! Sources: Log collection | LiveKit Docs
c
I used log exceptions, it logs the error but doesn't show a trace
t
I'm sorry to hear you're having trouble seeing tracebacks when using
log_exceptions
. This can happen for a few reasons, and I'd love to help you get to the bottom of it! • Sometimes, a custom exception hook like
_no_traceback_excepthook
in multiprocessing setups can suppress tracebacks. • It’s also possible that the logging configuration isn’t set up to capture
exc_info
. Using a formatter such as
JsonFormatter
that includes
exc_info
in the output usually helps. • Additionally, the
LogQueueHandler
in LiveKit might be stripping out
exc_info
when forwarding logs via IPC. You might need to adjust this if you want to keep the tracebacks. Here are some steps you can try to resolve this: 1. Double-check that your logger is configured to include
exc_info
with a compatible formatter. 2. Consider wrapping important code sections with
try-except
blocks and use
logger.exception()
to explicitly capture the tracebacks. 3. If you want to keep tracebacks accessible over time, forwarding your logs to an external service like Sentry or CloudWatch can be very helpful. Please feel free to reach out if you'd like me to walk you through adjusting the logging setup or handling exceptions more effectively. I'm here to help! Sources: livekit-agents/livekit/agents/ipc/log_queue.py | Log collection | LiveKit Docs