Open 81reap opened 7 months ago
I am attempting to get gstreamer's cudaconvert
and cudascale
pipeline elements working that also depend on the cuda toolkit.
To list the elements available I run gst-inspect-1.0 nvcodec
, which currently returns:
> gst-inspect-1.0 nvcodec
Plugin Details:
Name nvcodec
Description GStreamer NVCODEC plugin
Filename /usr/lib64/gstreamer-1.0/libgstnvcodec.so
Version 1.24.4
License LGPL
Source module gst-plugins-bad
Documentation https://gstreamer.freedesktop.org/documentation/nvcodec/
Source release date 2024-05-29
Binary package Fedora GStreamer-plugins-bad package
Origin URL http://download.fedoraproject.org
Info: CUDA runtime compilation library "libnvrtc.so" was not found, check CUDA toolkit package installation
cudadownload: CUDA downloader
cudaipcsink: CUDA IPC Sink
cudaipcsrc: CUDA IPC Src
cudaupload: CUDA uploader
nvautogpuh264enc: NVENC H.264 Video Encoder Auto GPU select Mode
nvautogpuh265enc: NVENC H.265 Video Encoder Auto GPU select Mode
nvav1dec: NVDEC AV1 Decoder
nvcudah264enc: NVENC H.264 Video Encoder CUDA Mode
nvcudah265enc: NVENC H.265 Video Encoder CUDA Mode
nvh264dec: NVDEC H.264 Decoder
nvh264enc: NVENC H.264 Video Encoder
nvh265dec: NVDEC H.265 Decoder
nvh265enc: NVENC HEVC Video Encoder
nvjpegdec: NVDEC jpeg Video Decoder
nvmpeg2videodec: NVDEC mpeg2video Video Decoder
nvmpeg4videodec: NVDEC mpeg4video Video Decoder
nvmpegvideodec: NVDEC mpegvideo Video Decoder
nvvp8dec: NVDEC VP8 Decoder
nvvp9dec: NVDEC VP9 Decoder
19 features:
+-- 19 elements
i.e. cudaconvert
and cudascale
are missing from the list because of the error Info: CUDA runtime compilation library "libnvrtc.so" was not found, check CUDA toolkit package installation
.
After doing the workaround from the top comment, I see that libnvrtc.so
is available at /usr/local/cuda/targets/x86_64-linux/lib
, but gstreamer is still not finding it, adding the exports to bashrc didn't help.
EDIT: cudaconvert
and cudascale
started appearing in that list, maybe rm -rf ~/.cache/gstreamer-1.0/
helped.
For those who are attempting to do this now, you should know that you have to use the version of CUDA that is appropriate for both your GPU driver's version and the version of CUDA that your GPU supports.
For example, as of writing, the GTX 1650 SUPER supports CUDA 12.6 and is on driver version 560.35.03. That means, you have to use:
wget https://developer.download.nvidia.com/compute/cuda/12.6.1/local_installers/cuda_12.6.1_560.35.03_linux.run
Keep in mind that, if your GPU supports 12.6, then it supports any 12.6.x version, and thus you should download the highest 12.6.x version you can get. You should format the rest of the commands as follows:
sudo sh cuda_12.6.1_560.35.03_linux.run
export PATH=/usr/local/cuda-12.6/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-12.6/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
You may notice that last two commands don't include 12.6.1
, but instead they include 12.6
. This is normal, you should not include any number after the second decimal point.
Like @81reap says, you should add the last two commands to your .bashrc file. This is located in your Home directory in Dolphin File Explorer. If you can't see it, enable Show Hidden Files.
Remember: this is different for each GPU, use nvidia-smi
to find your GPU driver's version and its CUDA support, so you can adapt the above instructions for your hardware.
Steps To Recreate
bazzite-nvidia
.nvcc --version
. It will fail to find the command.Expected Behavior
rpm-ostree
andnvidia-smi
show that cuda and cuda toolkit should be installed, howevernvcc --version
fails to work.Hardware
B550I Aurus Pro AX AMD Ryzen 7 5700G Nvidia RTX 4000 SFF Ada Gen 2x32GB @ 3200 MHz 2TB NVME Drive
Setup Notes
The Workaround
note :: The workaround does not fix the issue for podman containers running with CDI. Any cuda required workloads will have to be run in the userspace.
note :: you may need to change the cuda version in these commands. See here
Related Issues