Examples
Practical examples for common NCShare workflows. Example code and scripts are available in the NCShare/examples repository. Have questions or feedback about an example? Leave a comment at the bottom of its page.
Contributions Welcome
NCShare is a community effort. Please share your use cases and examples with us to be featured here so we can continue to build and improve this space together!
Join our Community Forum to engage in discussions about these examples and other Research Computing topics.
Container recipes
-
Jupyter Lab with CUDA and PyTorch
Build a container with Jupyter Lab, CUDA, and PyTorch for OnDemand or the command line.
-
FHI-aims
Build a container for FHI-aims density functional theory calculations, with CUDA support.
-
Computer vision
Build a container with OpenCV and Ultralytics for computer vision applications.
AI agents
-
Setting up OpenCode
Install the OpenCode coding agent on NCShare and connect it to models through Duke's AI Gateway.
-
Setting up OpenAI Codex CLI
Install OpenAI's Codex CLI on NCShare and sign in with ChatGPT or Duke's AI Gateway.
-
Duke's AI Gateway
Query the OpenAI-compatible API on Duke's AI Gateway from NCShare.
-
Equation of State with AI skills
Have an OpenCode agent use a skill to fit an equation of state and plot the results.
Local LLMs on H200 GPUs
-
LLM server with Ollama
Host an Ollama server on a GPU node and run inference from anywhere on the cluster.
-
OpenCode with Ollama
Run agentic OpenCode workflows against a local model served by Ollama.
-
Inference with vLLM
Run inference on local models directly from Python with vLLM, with no separate server.
-
vLLM server
Serve a local model to many concurrent clients with an authenticated vLLM server.
-
OpenCode with vLLM
Run agentic OpenCode workflows against a local model served by vLLM.
HPC and GPU workflows
-
GPU matrix multiplication
Compare GPU and CPU timings for matrix multiplication with PyTorch and CUDA.
-
Multi-node MPI jobs
Learn MPI basics with a ring-communication example that runs across nodes.
-
Slurm REST API
Inspect partitions, submit and cancel jobs, and query accounting data with curl.