RuntimeError: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver

Hello.

I’m trying to install PyTorch and Stable Diffusion on the Linuxulator on FreeBSD,following this tutorial :

I found some problems during the configuration of Linux and I’ve started this thread :

This is the context where the error come from :

[marietto@marietto ~]$ bash
[marietto@marietto ~]$ source /compat/linux/home/marietto/Desktop/stable-diffusion/conda/etc/profile.d/conda.sh
[marietto@marietto ~]$ conda activate
(base) [marietto@marietto ~]$ conda activate pytorch
(pytorch) [marietto@marietto ~]$ LD_PRELOAD=/compat/linux/home/marietto/Desktop/stable-diffusion/dummy-uvm.so python3 -c 'import torch; print(torch.cuda.get_device_name(0))'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/compat/linux/home/marietto/Desktop/stable-diffusion/conda/envs/pytorch/lib/python3.10/site-packages/torch/cuda/__init__.py", line 329, in get_device_name
    return get_device_properties(device).name
  File "/compat/linux/home/marietto/Desktop/stable-diffusion/conda/envs/pytorch/lib/python3.10/site-packages/torch/cuda/__init__.py", line 359, in get_device_properties
    _lazy_init()  # will define _get_device_properties
  File "/compat/linux/home/marietto/Desktop/stable-diffusion/conda/envs/pytorch/lib/python3.10/site-packages/torch/cuda/__init__.py", line 217, in _lazy_init
    torch._C._cuda_init()
RuntimeError: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx

this is the fix suggested by verm,the author of the tutorial :

You could try adding CUDA_VISIBLE_DEVICES before the LD_PRELOAD and cycle through the numbers to see if it picks up on your card you may need to use the BUS ID too but try it this way first.

CUDA_VISIBLE_DEVICES=0 LD_PRELOAD=./dummy-uvm.so python3 -c 'import torch; print(torch.cuda.get_device_name(0))'

Change the 0 to 1,2,3,4 as required to see if it finds your device.

I tried to follow his suggestion,trying from 0 to 4,but it didn’t work :

[marietto@marietto ~]$ bash
[marietto@marietto ~]$ source /compat/linux/home/marietto/Desktop/stable-diffusion/conda/etc/profile.d/conda.sh
[marietto@marietto ~]$ conda activate
(base) [marietto@marietto ~]$ conda activate pytorch
(pytorch) [marietto@marietto ~]$ CUDA_VISIBLE_DEVICES=0 LD_PRELOAD=/compat/linux/home/marietto/Desktop/stable-diffusion/dummy-uvm.so python3 -c 'import torch; print(torch.cuda.get_device_name(0))'

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/compat/linux/home/marietto/Desktop/stable-diffusion/conda/envs/pytorch/lib/python3.10/site-packages/torch/cuda/__init__.py", line 329, in get_device_name
    return get_device_properties(device).name
  File "/compat/linux/home/marietto/Desktop/stable-diffusion/conda/envs/pytorch/lib/python3.10/site-packages/torch/cuda/__init__.py", line 359, in get_device_properties
    _lazy_init()  # will define _get_device_properties
  File "/compat/linux/home/marietto/Desktop/stable-diffusion/conda/envs/pytorch/lib/python3.10/site-packages/torch/cuda/__init__.py", line 217, in _lazy_init
    torch._C._cuda_init()
RuntimeError: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx

at this point,maybe I can follow the second suggestion given by verm : “you may need to use the BUS ID too but try it this way first”.

ok,but how ? I have no idea about how to do that.