Skip to content

🐞 Experimental support for NVIDIA is broken #9015

Closed

Description

@samalba

What is the issue?

I've been experimenting with gpu-enabled Dagger engine on Fly.io: gerhard/daggerverse#4 in order to get an easy access to a physical GPU usable with Dagger.

I ran some examples to re-evaluate the ability for Dagger to use a GPU, and it seems to be all broken...

Dagger version

dagger v0.14.0 (registry.dagger.io/engine:v0.14.0) darwin/arm64

Steps to reproduce

Using a remote dagger engine (export _EXPERIMENTAL_DAGGER_RUNNER_HOST=tcp://<FLY_APP_NAME>.internal:2345).

Code snippet (with commented unsuccessful workarounds):

// TestCuda tests if it can access the GPU, requires a machine with an NVIDIA GPU
func (m *Gpu) TestCuda(ctx context.Context) (string, error) {
	return dag.Container().
		// From("nvidia/cuda:12.6.2-base-ubuntu24.04").
		From("nvidia/cuda:11.7.1-base-ubuntu20.04").
		// FIXME: this is an attempt to fix the error: "fork/exec /usr/bin/nvidia-container-runtime-hook: no such file or directory"
		// WithExec([]string{"sh", "-c", "apt update && apt install -y nvidia-container-toolkit"}).
		ExperimentalWithAllGPUs().
		WithExec([]string{"nvidia-smi", "-L"}).
		Stdout(ctx)
}

Log output

Error: response from query: input: gpu.testCuda resolve: call function "TestCuda": process "/runtime" did not complete successfully: exit code: 2

Stdout:
invoke: input: container.from.withExec.experimentalWithAllGPUs.withExec.stdout resolve: process "nvidia-smi -L" did not complete successfully: exit code: 1
/usr/local/bin/runc did not terminate successfully: exit status 1: container does not exist


Stderr:
runc run failed: unable to start container process: error during container init: error running hook #0: fork/exec /usr/bin/nvidia-container-runtime-hook: no such file or directory

cc @gerhard

Activity

  1. added
    kind/bug
    on Nov 21, 2024
  2. gerhard commented on Nov 21, 2024

    @gerhard
    Contributor

    Does the GPU variants of our image - v0.14.0-gpu & v0.14.0-wolfi-gpu - fail the same way?

  3. jedevc commented on Nov 21, 2024

    @jedevc
    Contributor

    Definitely worth confirming that the gpu variant is being used, but I also wouldn't be particularly surprised if it's bit-rotted a bit.

    We have no CI tests for GPU support - if we're committing to providing examples for GPU support in dagger (which we definitely should do), then I think we need to add GPU tests in CI for sure.

  4. samalba commented on Nov 21, 2024

    @samalba
    ContributorAuthor

    I confirm I am now using the -gpu variant: here is what I get:

    NVIDIA-SMI couldn't find libnvidia-ml.so library in your system. Please make sure that the NVIDIA Display Driver is properly installed and present in your system.
    Please also try adding directory that contains libnvidia-ml.so to your system PATH.

    I keep digging... Here is a trace for the who can access: https://dagger.cloud/samalba/traces/a8be4e92d6691e5886928bbbb5d8d87e?listen=f96092b08c3043b3&listen=e2afe3eab45439c0

  5. rajatjindal commented on Nov 22, 2024

    @rajatjindal
    Contributor

    I've been looking at it and able to reproduce the issue. I enabled debug logging for the nvidia-container-toolkit, and captured some additional logs:

    nvidia-container-toolkit.log

    I am still looking into why this is happening.

    Just FYI, I am now using the same docker image to run TestCuda function, that we use for engine and therefore expect it to have same packages installed, but still get same error. so my 2 cents is that the nvidia-container-toolkit is not able to inject something successfully when running the container.

  6. rajatjindal commented on Nov 22, 2024

    @rajatjindal
    Contributor

    a little search of the error string leads to a few related issues https://github.com/search?q=%22missing+compat32+library%22&type=issues&s=updated&o=desc

    I am going to go through these and see if I can use any of the suggested workarounds there.

  7. rajatjindal commented on Nov 25, 2024

    @rajatjindal
    Contributor

    I finally have this working after installing libnvidia-compute-565. The nvidia drivers are really touchy w.r.t version numbers as such, but I found installing this package fix it for both nvidia/cuda:12.6.2-base-ubuntu24.04 and nvidia/cuda:11.7.1-base-ubuntu20.04.

    The diff to @samalba repo: https://github.com/samalba/dagger-modules/compare/main...rajatjindal:samalba-dagger-modules:fix-gpu?expand=1

    sample output:

    ## calling this from a fly.io app (running dagger engine) console:
    
    dagger call -m github.com/rajatjindal/samalba-dagger-modules/nvidia-gpu@fix-gpu test-cuda 
    ✔ connect 0.0s
    ✔ loading module 5.4s
    ✔ parsing command line arguments 0.0s
    ✔ gpu: Gpu! 0.0s
    ✔ Gpu.testCuda: String! 0.4s
    
    Setup tracing at https://dagger.cloud/traces/setup. To hide: export SHUTUP=1
    
    GPU 0: NVIDIA L40S (UUID: GPU-250b202c-761c-5976-c4d3-f49dadc4bcd1)
    
    root@e2866099b69708:/# 
    
  8. marcosnils commented on Nov 25, 2024

    @marcosnils
    Contributor

    I finally have this working after installing libnvidia-compute-565. The nvidia drivers are really touchy w.r.t version numbers as such, but I found installing this package fix it for both nvidia/cuda:12.6.2-base-ubuntu24.04 and nvidia/cuda:11.7.1-base-ubuntu20.04.

    The diff to @samalba repo: https://github.com/samalba/dagger-modules/compare/main...rajatjindal:samalba-dagger-modules:fix-gpu?expand=1

    That's awesome Rajat! Seems like the diff link you've shared is not showing any changes, maybe you forgot to commit?

  9. rajatjindal commented on Nov 25, 2024

    @rajatjindal
    Contributor

    hmm, that is strange, I do see the changes using that URL.

    Screenshot 2024-11-25 at 9 14 54 PM

    although the diff is just to run the following two commands:

    apt-get update
    apt-get install -y libnvidia-compute-565
    
  10. rajatjindal commented on Nov 25, 2024

    @rajatjindal
    Contributor

    another workaround that I found to be working was to mount /.fly-upper-layer to the container and add /<mounted-path>/usr/lib/x86_64-linux-gnu to LD_LIBRARY_PATH.

    Note: I found the required *.so files in both /.fly-upper-layer AND /usr/lib/x86_64-linux-gnu/ on the fly.io app machine, so I am assuming mounting either of them should work, but I tried mounting /.fly-upper-layer only.

    list of `*.so` files
    root@91852944c72198:/# find . -name 'libnvidia-ml.so.1'
    ./usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1
    ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1
    root@91852944c72198:/# sha256sum ./usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1
    05c8df9cec2c01c935594c57d37287ee358ed4e759270dbfec350061d342ad80  ./usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1
    root@91852944c72198:/# sha256sum ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1
    05c8df9cec2c01c935594c57d37287ee358ed4e759270dbfec350061d342ad80  ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1
    root@91852944c72198:/# 
    
    root@91852944c72198:/# find . -name '*.so*' | xargs grep -i nvidia
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-container-go.so.1: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-container-go.so.1.17.0: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-container.so.1.17.0: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libblkid.so.1: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libblkid.so.1.1.0: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-container.so.1: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-ptxjitcompiler.so.565.57.01: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-sandboxutils.so.1: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-opticalflow.so.565.57.01: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-cfg.so.565.57.01: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libcudadebugger.so.565.57.01: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libcuda.so.565.57.01: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-cfg.so.1: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-encode.so.565.57.01: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-encode.so.1: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-allocator.so.565.57.01: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-opticalflow.so.1: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-pkcs11-openssl3.so.565.57.01: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libcuda.so.1: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-nvvm.so.565.57.01: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-fbc.so.565.57.01: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-allocator.so.1: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/gbm/nvidia-drm_gbm.so: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/nvidia/xorg/nvidia_drv.so: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-gpucomp.so.1: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-ptxjitcompiler.so: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvcuvid.so: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/vdpau/libvdpau_nvidia.so.565.57.01: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/vdpau/libvdpau_nvidia.so.1: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/vdpau/libvdpau_nvidia.so: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-sandboxutils.so.565.57.01: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-gpucomp.so.565.57.01: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-encode.so: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvcuvid.so.1: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-fbc.so.1: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-ml.so.565.57.01: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libcuda.so: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-opencl.so.565.57.01: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-ptxjitcompiler.so.1: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-nvvm.so.4: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-opencl.so.1: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvcuvid.so.565.57.01: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libcudadebugger.so.1: binary file matches
    grep: ./usr/lib/x86_64-linux-gnu/libnvidia-cfg.so: binary file matches
    grep: ./usr/lib/libnvidia-gtk3.so.565.57.01: binary file matches
    grep: ./usr/lib/libnvidia-gtk2.so.565.57.01: binary file matches
    grep: ./usr/lib/libnvidia-wayland-client.so.565.57.01: binary file matches
    grep: ./etc/ld.so.cache: binary file matches
    grep: ./etc/ld.so.conf.d: Is a directory
    grep: ./run/buildkit/buildkitd.sock: No such device or address
    grep: ./.fly-upper-layer/run/buildkit/buildkitd.sock: No such device or address
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvidia-ptxjitcompiler.so.565.57.01: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvidia-sandboxutils.so.1: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvidia-opticalflow.so.565.57.01: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvidia-cfg.so.565.57.01: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libcudadebugger.so.565.57.01: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libcuda.so.565.57.01: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvidia-cfg.so.1: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvidia-encode.so.565.57.01: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvidia-encode.so.1: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvidia-allocator.so.565.57.01: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvidia-opticalflow.so.1: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvidia-pkcs11-openssl3.so.565.57.01: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libcuda.so.1: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvidia-nvvm.so.565.57.01: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvidia-fbc.so.565.57.01: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvidia-allocator.so.1: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/gbm/nvidia-drm_gbm.so: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/nvidia/xorg/nvidia_drv.so: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvidia-gpucomp.so.1: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvidia-ptxjitcompiler.so: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvcuvid.so: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/vdpau/libvdpau_nvidia.so.565.57.01: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/vdpau/libvdpau_nvidia.so.1: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/vdpau/libvdpau_nvidia.so: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvidia-sandboxutils.so.565.57.01: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvidia-gpucomp.so.565.57.01: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvidia-encode.so: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvcuvid.so.1: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvidia-fbc.so.1: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvidia-ml.so.565.57.01: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libcuda.so: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvidia-opencl.so.565.57.01: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvidia-ptxjitcompiler.so.1: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvidia-nvvm.so.4: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvidia-opencl.so.1: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvcuvid.so.565.57.01: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libcudadebugger.so.1: binary file matches
    grep: ./.fly-upper-layer/usr/lib/x86_64-linux-gnu/libnvidia-cfg.so: binary file matches
    grep: ./.fly-upper-layer/usr/lib/libnvidia-gtk3.so.565.57.01: binary file matches
    grep: ./.fly-upper-layer/usr/lib/libnvidia-gtk2.so.565.57.01: binary file matches
    grep: ./.fly-upper-layer/usr/lib/libnvidia-wayland-client.so.565.57.01: binary file matches
    root@91852944c72198:/# 
    
  11. rajatjindal commented on Dec 2, 2024

    @rajatjindal
    Contributor

    I just tried this on a GPU VM that @marcosnils helped me get access to, and it seems to have worked without any additional package installation. I am going to investigate this more tomorrow but it seems like the issue could be specific to how fly.io setup the firecracker vm.

  12. samalba commented on Dec 3, 2024

    @samalba
    ContributorAuthor

    That's neat, thanks @rajatjindal for gathering all those info. I confirm the workaround on fly. Given we can't hardcode a path on the host, it's probably better (more portable) to rely on installing libnvidia-compute-565.

    Here is the working test for the record:

    func (m *Gpu) TestCuda(ctx context.Context) (string, error) {
    	return dag.Container().
    		From("nvidia/cuda:12.6.2-base-ubuntu24.04").
    		WithExec([]string{"apt-get", "update"}).
    		WithExec([]string{"apt-get", "install", "-y", "libnvidia-compute-565"}).
    		ExperimentalWithAllGPUs().
    		WithExec([]string{"sh", "-c", "nvidia-smi -L"}).
    		Stdout(ctx)
    }
  13. marcosnils commented on Dec 3, 2024

    @marcosnils
    Contributor

    @samalba regarding your question about Lambda labs, seems like it'll work out of the box similarly to our tests in Oblivus. Let us know in case you give it a try and it doesn't work for some reason.

  14. samalba commented on Dec 10, 2024

    @samalba
    ContributorAuthor

    @samalba regarding your question about Lambda labs, seems like it'll work out of the box similarly to our tests in Oblivus. Let us know in case you give it a try and it doesn't work for some reason.

    So I had some time to try it out today:

    I keep getting this error, every time I invoke the ExperimentalWithAllGPUs() call:

    stderr: Auto-detected mode as 'legacy'
    nvidia-container-cli: initialization error: load library failed: libnvidia-ml.so.1: cannot open shared object file: no such file or directory

    Out of the box, a Lambda VM comes with an Ubuntu 22.04.5 LTS and it seems to have the right packages installed:

    ii  libnvidia-cfg1-550-server:amd64                  550.127.05-0lambda0.22.04.1                  amd64        NVIDIA binary OpenGL/GLX configuration library
    ii  libnvidia-compute-550:amd64                      550.127.05-0lambda0.22.04.1                  amd64        NVIDIA libcompute package
    rc  libnvidia-compute-550-server:amd64               550.127.05-0lambda0.22.04.1                  amd64        NVIDIA libcompute package
    ii  libnvidia-container-tools                        1.17.2+dfsg-0lambda0.22.04.1                 amd64        Package for configuring containers with NVIDIA hardware (CLI tool)
    ii  libnvidia-container1:amd64                       1.17.2+dfsg-0lambda0.22.04.1                 amd64        Package for configuring containers with NVIDIA hardware (shared library)
    ii  libnvidia-extra-550-server:amd64                 550.127.05-0lambda0.22.04.1                  amd64        Extra libraries for the NVIDIA driver
    ii  libnvidia-ml-dev:amd64                           12.4.127~12.4.1-0lambda0.22.04.2             amd64        NVIDIA Management Library (NVML) development files
    rc  nvidia-compute-utils-550-server                  550.127.05-0lambda0.22.04.1                  amd64        NVIDIA compute utilities
    ii  nvidia-container-toolkit                         1.17.2-0lambda0.22.04.1                      amd64        OCI hook for configuring containers for NVIDIA hardware
    ii  nvidia-container-toolkit-base                    1.17.2-0lambda0.22.04.1                      amd64        Container runtime for NVIDIA hardware
    ii  nvidia-cuda-dev:amd64                            12.4.127~12.4.1-0lambda0.22.04.2             amd64        NVIDIA CUDA development files
    ii  nvidia-cuda-toolkit                              12.4.131~12.4.1-0lambda0.22.04.2             amd64        NVIDIA CUDA development toolkit
    ii  nvidia-cuda-toolkit-gcc                          12.4.1-0lambda0.22.04.2                      amd64        NVIDIA CUDA development toolkit (GCC compatibility)
    ii  nvidia-dkms-550-server                           550.127.05-0lambda0.22.04.1                  amd64        NVIDIA DKMS package
    ii  nvidia-fabricmanager-550                         550.127.05-0lambda0.22.04.1                  amd64        NVIDIA Fabric Manager for NVSwitch systems
    ii  nvidia-firmware-550-server-550.127.05            550.127.05-0lambda0.22.04.1                  amd64        Firmware files used by the kernel module
    ii  nvidia-kernel-common-550-server                  550.127.05-0lambda0.22.04.1                  amd64        Shared files used with the kernel module
    ii  nvidia-kernel-source-550-server                  550.127.05-0lambda0.22.04.1                  amd64        NVIDIA kernel source package
    ii  nvidia-opencl-dev:amd64                          12.4.127~12.4.1-0lambda0.22.04.2             amd64        NVIDIA OpenCL development files
    ii  nvidia-profiler                                  12.4.127~12.4.1-0lambda0.22.04.2             amd64        NVIDIA Profiler for CUDA and OpenCL

    Here is how I started the dagger-engine after stopping the default one (v0.14.0):

    docker run -d --privileged -e _EXPERIMENTAL_DAGGER_GPU_SUPPORT=true --name dagger-engine-v0.14.0 registry.dagger.io/engine:v0.14.0-gpu -- --debug

    For the record I did my test with an instance with an Nvidia A6000 attached (gpu_1x_a6000). @marcosnils and @rajatjindal I gave you both an access to my account in case you want to have a look.

  15. rajatjindal commented on Dec 10, 2024

    @rajatjindal
    Contributor

    I think I found the problem, we need to start dagger with --gpus all. once I did that I was able to run a cuda test container on Lambda labs instance.

    docker run --gpus all -d --privileged -e _EXPERIMENTAL_DAGGER_GPU_SUPPORT=true --name dagger-engine-v0.14.0 registry.dagger.io/engine:v0.14.0-gpu -- --debug
    
    ## and then
    
    dagger -i core container from --address=nvidia/cuda:12.3.1-runtime-ubuntu22.04  experimental-with-all-gp-us with-exec --args nvidia-smi stdout
    ✔ connect 0.6s
    ✔ inspecting core types 1.1s
    ✔ parsing command line arguments 0.0s
    ✔ container: Container! 0.0s
    ✔ Container.from(address: "nvidia/cuda:12.3.1-runtime-ubuntu22.04"): Container! 0.6s
    ✔ Container.experimentalWithAllGPUs: Container! 0.0s
    ✔ Container.withExec(args: ["nvidia-smi"]): Container! 3.7s
    ✔ Container.stdout: String! 3.8s
    
    Setup tracing at https://dagger.cloud/traces/setup. To hide: export STOPIT=1
    
    Tue Dec 10 05:08:24 2024
    +-----------------------------------------------------------------------------------------+
    | NVIDIA-SMI 550.127.05             Driver Version: 550.127.05     CUDA Version: 12.4     |
    |-----------------------------------------+------------------------+----------------------+
    | 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 A6000               On  |   00000000:06:00.0 Off |                  Off |
    | 30%   30C    P8             14W /  300W |       2MiB /  49140MiB |      0%      Default |
    |                                         |                        |                  N/A |
    +-----------------------------------------+------------------------+----------------------+
    
    +-----------------------------------------------------------------------------------------+
    | Processes:                                                                              |
    |  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
    |        ID   ID                                                               Usage      |
    |=========================================================================================|
    |  No running processes found                                                             |
    +-----------------------------------------------------------------------------------------+
    
  16. samalba commented on Dec 10, 2024

    @samalba
    ContributorAuthor

    Indeed, I can make it work when starting the engine container with GPU. I guess fly.io transparently set this as well.

    Thanks for the help! I am closing this issue as we have several ways to access the GPU, I am working on documenting all this (planning to open the PR in the next few days).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions