Python nv-sglrun nvidia-smi doesnt set cuda version

Im using rocky linux 9 and I installed [command]doas pkg install lib6-shim[/command]

then I tried

Code:
SHIM_DEBUG=1 nv-sglrun nvidia-smi                                                                                                                                                                                                                                                                                                                            14:47
/usr/local/lib/libc6-shim/libc6-debug.so: shim init
Fri Sep 25 14:47:45 2026       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 595.99.02              Driver Version: 595.99.02      CUDA Version: N/A      |
+-----------------------------------------+------------------------+----------------------+
| 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 RTX 4000 SFF Ada ...    Off |   00000000:01:00.0 Off |                  Off |
| 30%   55C    P8              6W /   70W |     263MiB /  20475MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
|   1  NVIDIA GeForce RTX 4080        Off |   00000000:04:00.0  On |                  N/A |
|  0%   49C    P8             19W /  320W |     852MiB /  16376MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A            6137    C+G   wf-panel                                 29MiB |
|    0   N/A  N/A            6139    C+G   wf-background                           186MiB |
|    1   N/A  N/A            6123      G   wayfire                                  60MiB |
|    1   N/A  N/A            6139      G   wf-background                           219MiB |
|    1   N/A  N/A            6141      G   Xwayland                                  4MiB |
|    1   N/A  N/A            6165      G   /usr/local/bin/firefox                  277MiB |
|    1   N/A  N/A            6679      G   /usr/local/bin/kitty                     84MiB |
|    1   N/A  N/A           11184      G   /usr/local/bin/Telegram                  11MiB |
+-----------------------------------------------------------------------------------------+

But cuda version still shows N/A, is this expected or should I change/review something?

My idea is to be able to use pytorch with cuda
 
Seems I was missing linux-nvidia-libs

$ pkg search libc6-shim 16:04
$ pkg install libc6-shim-20260428
$ pkg info linux-nvidia-libs pkg: No package(s) matching linux-nvidia-libs
$ nvidia-smi | grep -i driver # to get correct driver number
$ search linux-nvidia-libs | grep 595
$ doas pkg install linux-nvidia-libs-595.99.02
$ nv-sglrun nvidia-smi | grep -i cuda # should print correct cuda version
/usr/local/lib/libc6-shim/libc6.so: shim init
| NVIDIA-SMI 595.99.02 Driver Version: 595.99.02 CUDA Version: 13.2 |

I was following this https://github.com/verm/freebsd-stable-diffusion but Im stuck now at this error

(base) [tyoc213@bzd ~]$ source ~/linux-conda-install/etc/profile.d/conda.sh
(base) [tyoc213@bzd ~]$ conda activate pytorch
(pytorch) [tyoc213@bzd ~]$ LD_PRELOAD="/home/tyoc213/linux-conda-install/dummy-uvm.so" python3 -c 'import torch; print(torch.cuda.is_available())'
/home/tyoc213/linux-conda-install/envs/pytorch/lib/python3.12/site-packages/torch/cuda/__init__.py:228: UserWarning: CUDA initialization: Unexpected error from cudaGetDeviceCount(). Did you run some cuda functions before calling NumCudaDevices() that might have already set an error? Error 304: OS call failed or operation not supported on this OS (Triggered internally at /__w/pytorch/pytorch/c10/cuda/CUDAFunctions.cpp:119.)
return torch._C._cuda_getDeviceCount() > 0
False

any hints?
 
Back
Top