Dagger
Search

gpu

This module has been generated via dagger init and serves as a reference to
basic module structure as you get started with Dagger.

Two functions have been pre-created. You can modify, delete, or add to them,
as needed. They demonstrate usage of arguments and return types using simple
echo and grep commands. The functions can be called from the dagger CLI or
from one of the SDKs.

The first line in this comment block is a short description line and the
rest is a long description with more detail on the module's purpose or usage,
if appropriate. All modules should have a short description.

Installation

dagger install github.com/samalba/dagger-modules/nvidia-gpu@289cbc638c405fe5f507bf32f25ce9bb2a95a08c

Entrypoint

Return Type
Gpu
Example
dagger -m github.com/samalba/dagger-modules/nvidia-gpu@289cbc638c405fe5f507bf32f25ce9bb2a95a08c call \
func (m *myModule) example() *Gpu  {
	return dag.
			Gpu()
}
@function
def example() -> dag.Gpu:
	return (
		dag.gpu()
	)
@func()
example(): Gpu {
	return dag
		.gpu()
}

Types

Gpu 🔗

deployDaggerOnFly() 🔗

Returns lines that match a pattern in the files of the provided Directory Once deployed, in order to point to the new remote engine: export _EXPERIMENTAL_DAGGER_RUNNER_HOST=tcp://.internal:2345

Return Type
String !
Arguments
NameTypeDefault ValueDescription
tokenSecret !-No description provided
orgString !-No description provided
Example
dagger -m github.com/samalba/dagger-modules/nvidia-gpu@289cbc638c405fe5f507bf32f25ce9bb2a95a08c call \
 deploy-dagger-on-fly --token env:MYSECRET --org string
func (m *myModule) example(ctx context.Context, token *Secret, org string) string  {
	return dag.
			Gpu().
			DeployDaggerOnFly(ctx, token, org)
}
@function
async def example(token: dagger.Secret, org: str) -> str:
	return await (
		dag.gpu()
		.deploy_dagger_on_fly(token, org)
	)
@func()
async example(token: Secret, org: string): Promise<string> {
	return dag
		.gpu()
		.deployDaggerOnFly(token, org)
}

testCuda() 🔗

TestCuda tests if it can access the GPU, requires a machine with an NVIDIA GPU

Return Type
String !
Example
dagger -m github.com/samalba/dagger-modules/nvidia-gpu@289cbc638c405fe5f507bf32f25ce9bb2a95a08c call \
 test-cuda
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			Gpu().
			TestCuda(ctx)
}
@function
async def example() -> str:
	return await (
		dag.gpu()
		.test_cuda()
	)
@func()
async example(): Promise<string> {
	return dag
		.gpu()
		.testCuda()
}

ollamaWithGpu() 🔗

Return Type
String !
Example
dagger -m github.com/samalba/dagger-modules/nvidia-gpu@289cbc638c405fe5f507bf32f25ce9bb2a95a08c call \
 ollama-with-gpu
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			Gpu().
			OllamaWithGpu(ctx)
}
@function
async def example() -> str:
	return await (
		dag.gpu()
		.ollama_with_gpu()
	)
@func()
async example(): Promise<string> {
	return dag
		.gpu()
		.ollamaWithGpu()
}

ollamaWithCpu() 🔗

Return Type
String !
Example
dagger -m github.com/samalba/dagger-modules/nvidia-gpu@289cbc638c405fe5f507bf32f25ce9bb2a95a08c call \
 ollama-with-cpu
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			Gpu().
			OllamaWithCpu(ctx)
}
@function
async def example() -> str:
	return await (
		dag.gpu()
		.ollama_with_cpu()
	)
@func()
async example(): Promise<string> {
	return dag
		.gpu()
		.ollamaWithCpu()
}

destroyDaggerOnFly() 🔗

Destroy the remote Flyio app

Return Type
String !
Arguments
NameTypeDefault ValueDescription
tokenSecret !-No description provided
appString !-No description provided
Example
dagger -m github.com/samalba/dagger-modules/nvidia-gpu@289cbc638c405fe5f507bf32f25ce9bb2a95a08c call \
 destroy-dagger-on-fly --token env:MYSECRET --app string
func (m *myModule) example(ctx context.Context, token *Secret, app string) string  {
	return dag.
			Gpu().
			DestroyDaggerOnFly(ctx, token, app)
}
@function
async def example(token: dagger.Secret, app: str) -> str:
	return await (
		dag.gpu()
		.destroy_dagger_on_fly(token, app)
	)
@func()
async example(token: Secret, app: string): Promise<string> {
	return dag
		.gpu()
		.destroyDaggerOnFly(token, app)
}